Exca Posted December 9, 2015 Share Posted December 9, 2015 Hi, Is it possible to use filters with particlecontainers. I tried applying the filter and it seems to do nothing. If filters dont work, I was thinking of rendering the particlecontainer to offscreen-canvas and then drawing that canvas to game as normal Sprite. Is that the recommended approach or is there another solution? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 9, 2015 Share Posted December 9, 2015 Its restriction of particlecontainer: filters wont work on it anyway, because it cant calculate its bounds. Solution:1) put particleContainer inside regular PIXI.container, lets call it parentContainer2) parentContainer.filterArea = new Rectangle(specify bounds here)3) parentContainer.filters = [whatever filters you want there] dont forget that filterArea has to be small , not (0, 0, 100000, 100000) . Filters are working by rendering in offscreen buffer exactly how you said that Quote Link to comment Share on other sites More sharing options...
Exca Posted December 9, 2015 Author Share Posted December 9, 2015 Thanks, that works. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 9, 2015 Share Posted December 9, 2015 Now mark my answer as correct. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.