Sign in to follow this  
Sammdahamm

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

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.