InsaneHero Posted September 20, 2013 Share Posted September 20, 2013 I would like to pop a sprite to the top of the drawing stack (I'm create a new level but want to hold onto the existing player instance which will eventually animate during the level transition effect, currently the 2nd level is drawing over the player). As far as I can tell renderOrderID dictates the drawing order... but I hacked in something which sets player.renderOrderID to game.world.currentRenderOrderID++ and that's not doing it. Does anyone have a good solution (while I dig through the source some more)? Link to comment Share on other sites More sharing options...
InsaneHero Posted September 20, 2013 Author Share Posted September 20, 2013 Ah found it. It is of course a Pixi wrapper... player.bringToTop()And now I know a whole lot more about the Phaser/Pixi interface EDIT: I want to mark this thread solved but that involves me marking my answer to my own question as the 'best' answer... is that bad etiquette on this forum? Link to comment Share on other sites More sharing options...
Mike Posted September 20, 2013 Share Posted September 20, 2013 Since you've explained the solution I think it is ok. Btw i just want to add that there are 2 examples: input/bring to top.phpinput/bring to top2.php Link to comment Share on other sites More sharing options...
rich Posted September 20, 2013 Share Posted September 20, 2013 Yeah there is bringToTop for a Group specifically or for the World. It's also a function on Sprite. Pixi doesn't support it natively, but it was easy enough to implement. Perhaps counter intuitively there are 2 demos in the input folder as Mike said. Link to comment Share on other sites More sharing options...
InsaneHero Posted September 21, 2013 Author Share Posted September 21, 2013 Ah, thanks for that. I was looking in the games and camera for it - didn't think to look in input.I will sit down and work through all the examples before asking any more questions! Link to comment Share on other sites More sharing options...
Recommended Posts