Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

How to make a glow / color fade with PIXI.filters.GlowFilter?

$
0
0

I want to add a really big blue glow to the gray hold bar. This example looks pretty good but I want it to look less like a tight border and more like a stretched blue fade out. I tried to accomplish this by increasing the outer strength. 

let barContainer = new PIXI.Container();
barContainer.position.set(xPosition, 110);

let bar = new PIXI.Graphics();
bar.beginFill(0xffffff);
bar.tint = 0xbbbbbb;
bar.drawRect(0, 0, chordWidth, 10);

barContainer.addChild(bar);

let glowFilter = new GlowFilter(10, 2, 0, 0x00507c, 0.1);
glowFilter.padding = 100;

barContainer.children[0].filters = [glowFilter];

1104284719_ScreenShot2019-04-10at11_25_58AM.thumb.png.790443b4ac46e6952d024807e39476fc.png

 

//increase outer strength to try and make the filter spread out farther
let glowFilter = new GlowFilter(10, 30, 0, 0x00507c, 0.1);

1844465897_ScreenShot2019-04-10at11_29_42AM.thumb.png.f7d097b235ab590aa41e88144178ce97.png

 

As cool of a border as this is, how can I make a glow filter that fades out? Is it possible with something as easy as GlowFilter or other filters?

Thank you for any help! 😁

 

P.S. I also tried the approach of using a gradient image as suggested in this topic but it didn't work very well with my rectangles that heavily vary in width. 

 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>