pranadevil Posted May 25, 2016 Share Posted May 25, 2016 Hi 2 all Is there a way in phaser to retrieve chlid information from its parent? Which method should i use to get information about the childs? Link to comment Share on other sites More sharing options...
drhayes Posted May 25, 2016 Share Posted May 25, 2016 Every DisplayObjectContainer has a "children" property, an array of its children. You can loop through that to find what you're looking for. Link to comment Share on other sites More sharing options...
pranadevil Posted May 25, 2016 Author Share Posted May 25, 2016 1 hour ago, drhayes said: Every DisplayObjectContainer has a "children" property, an array of its children. You can loop through that to find what you're looking for. excuse me sr where did u read that? could you please share the link with me? Link to comment Share on other sites More sharing options...
drhayes Posted May 25, 2016 Share Posted May 25, 2016 Sure. Here's the link to Sprite's documentation for the children property: http://phaser.io/docs/2.4.8/Phaser.Sprite.html#children At the end, it says something about Pixi.DisplayObjectContainer. The Phaser (and PIXI) display tree is an example of the composite design pattern. Each display object is, itself, a container for other display objects. Thus it makes a tree, if you can see it in your head. spinnerbox 1 Link to comment Share on other sites More sharing options...
Recommended Posts