JairoCanales Posted February 7, 2014 Share Posted February 7, 2014 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! Quote Link to comment Share on other sites More sharing options...
xerver Posted February 7, 2014 Share Posted February 7, 2014 Graphics objects are for drawing primitive shapes, if you just want a container (of sprites, other containers, etc) you are looking for PIXI.DisplayObjectContainer. After making that change, do you have any code to share? It is difficult to debug without code. Quote Link to comment Share on other sites More sharing options...
JairoCanales Posted February 8, 2014 Author Share Posted February 8, 2014 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 Quote Link to comment Share on other sites More sharing options...
xerver Posted February 8, 2014 Share Posted February 8, 2014 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. Quote Link to comment Share on other sites More sharing options...
JairoCanales Posted February 10, 2014 Author Share Posted February 10, 2014 I was using the master branch, then changed to dev, but no changes Quote Link to comment Share on other sites More sharing options...
xerver Posted February 10, 2014 Share Posted February 10, 2014 Interesting, I would appreciate you putting a bug in on the GitHub page so we can put it on our backlog of things to look at for v1.6 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.