christian.tucker Posted December 15, 2014 Share Posted December 15, 2014 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. scofield 1 Link to comment Share on other sites More sharing options...
rich Posted December 15, 2014 Share Posted December 15, 2014 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 More sharing options...
XekeDeath Posted December 15, 2014 Share Posted December 15, 2014 Rich ninja'd me...Perhaps, Rich, the Group As Layer example needs to be renamed to "Group as Render/Draw Layer"...?I seem to answer this style of question a lot... Link to comment Share on other sites More sharing options...
rich Posted December 15, 2014 Share Posted December 15, 2014 Maybe, I'm not sure that'd help massively if the concept of display lists and Groups are new to devs anyway. Link to comment Share on other sites More sharing options...
Recommended Posts