Jump to content

How do you bring sprites/groups to front with Phaser 3?


Sammdahamm
 Share

Recommended Posts

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

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

  • 8 months later...
  • 2 years later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...