Jump to content

Bring sprite to top, permanently.


christian.tucker
 Share

Recommended Posts

I know that we have the world#bringToTop(object) function already, however I'm trying to find a way to keep the sprite always ontop of everything else. 

 

My problem is that when multiple people log into my server, their sprites start to draw on-top of mine. Who's drawn ontop of who isn't really a problem until I can't see myself. 

 

Like I said I know I can use:

 

game.world.bringToTop(getPlayer().getSprite());

 

However, is there a way to keep it at the top without calling the above method in Update()?

 

It seems like it'd be more efficient if there was a way to call bringToTop everytime a new component was added, instead of constantly. 

Link to comment
Share on other sites

If it's just your sprite you want to keep on the top, then why not create a Group to insert all the other sprites in to? As long as your sprite is above the Group on the display list it will always be on top, no matter how the contents of that Group changes over time.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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