Jump to content

ParticleContainer + filter


Exca
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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 parentContainer

2) 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 :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...