Sammdahamm Posted March 2, 2018 Share Posted March 2, 2018 Hey guys, So I've just started refactoring my codebase to Phaser 3 today and I've hit a few bumps. Nothing too bad so far, but one I can't get my head around is how to bring sprites/sprite groups to the front of the display in Phaser 3. In Phaser 2 we had game.world.bringToTop(group), but I'm struggling to find the equivalent in Phaser 3. Any help appreciated, nice one thanks. Sam Link to comment Share on other sites More sharing options...
Sammdahamm Posted March 2, 2018 Author Share Posted March 2, 2018 I've been looking through the Phaser 3 repo and found that SceneManager has a "bringToTop" method, but this only takes a Scene as a parameter. Has "bringToTop" in a sprite/group context been removed in Phaser 3? if so I'd like to request that it is reimplemented as I found this to be really useful in Phaser 2. If it has been removed, can anyone suggest a temporary workaround to bring a sprite group to the top of a view? I'm assuming it'll involve manipulating the group's children's z-indexes but I'm not sure how this would be done relative to other groups in the Scene Nice one thanks, Sam Link to comment Share on other sites More sharing options...
samme Posted March 2, 2018 Share Posted March 2, 2018 http://labs.phaser.io/index.html?dir=depth sorting/ lpbr, Sammdahamm and mhcdotcom 3 Link to comment Share on other sites More sharing options...
Sammdahamm Posted March 2, 2018 Author Share Posted March 2, 2018 Nice one thanks Link to comment Share on other sites More sharing options...
eddieone Posted November 28, 2018 Share Posted November 28, 2018 Yeah Thanks, always checking the examples... Link to comment Share on other sites More sharing options...
lpbr Posted May 21, 2021 Share Posted May 21, 2021 On 3/2/2018 at 1:25 PM, samme said: http://labs.phaser.io/index.html?dir=depth sorting/ Those examples are simply great! I didn't know this page. Thanks Samme! ? Link to comment Share on other sites More sharing options...
Recommended Posts