bacterozoid Posted March 24, 2016 Share Posted March 24, 2016 I'm just starting to pick up Pixi and was working on extending the Sprite class for a tree. I've added some functionality to my tree class to allow for variations in the way the tree looks like tint, size, shape, etc. Now I added a shadow to my tree by adding a shadow sprite onto the tree sprite (since a PIXI.Sprite is a PIXI.container) but I don't want the shadow to be tinted when I tint the tree. That's easy enough to do, but now my tree which extends PIXI.sprite feels more like it should extend PIXI.container. Any feedback on this? Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 24, 2016 Share Posted March 24, 2016 Yes, it is better to extend PIXI.Container and put the tree sprite and shadow in it. However, shadows are tricky - sometimes its better to separate ALL shadows into different container. In that case, your tree object cant have shadow as a child, but it needs to update shadow position every time tree position is changed. BTW, there will be plugin for z-indeces for pixiv4. bacterozoid 1 Quote Link to comment Share on other sites More sharing options...
bacterozoid Posted March 25, 2016 Author Share Posted March 25, 2016 Thanks! When would it be better to put all shadows in a separate container? 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.