Jump to content

Multi Layer graphics


JairoCanales
 Share

Recommended Posts

Hi guys!

I am making a game with a cenital view, which requires drawing objects in different layers.

My choice was to create an array of PIXI.Graphics, and every object in a layer would be a child of the same PIXI.Graphics.

Probably, this approach is abstractly wrong, even though for the simpler use-cases it breaks.

My problem is that I wanted to apply one filter to everything that is in the ground layer (I am testing how nice could be to blur the ground), but the filter makes all that layer to be painted in the same gray colour.

I assume that PIXI.Graphics objects are not well prepared to apply them filters, and taking in consideration that I would like to apply filters to the objects of a layer, what could be the best approach to make this multilayered idea?

Thank you, guys!

Link to comment
Share on other sites

Thank you, xerver.

 

It has worked perfectly has I imagined. Applying a filter to a PIXI.DisplayObjectContainer works in the way I assumed (applying the filter to all of the children).

 

However, the only problem is with the PIXI.Graphics objects, which don't react very well to these filters (or at least not to the GrayFilter).

 

Anyhow, I will post more about this topic when I have more solid findings :)

 

Thanks again

Link to comment
Share on other sites

Thank you, xerver.

 

It has worked perfectly has I imagined. Applying a filter to a PIXI.DisplayObjectContainer works in the way I assumed (applying the filter to all of the children).

 

However, the only problem is with the PIXI.Graphics objects, which don't react very well to these filters (or at least not to the GrayFilter).

 

Anyhow, I will post more about this topic when I have more solid findings :)

 

Thanks again

 

Are you using the build from the latest dev branch? There are bugs related to that fixed there.

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...