Meowts Posted April 8, 2014 Share Posted April 8, 2014 Hi, A little layering problem I'm not quite sure how to solve. Here's what I'm working with: http://i.imgur.com/VOV9jpX.png What I want to happen is that when the man is sent into his doom (into the water), he will go in front of the first two water layers and behind the third water layer. The sprites are layered as such:- Water1- Water2- Water3- Land- Man The trouble is that the Man needs to be placed after the Land, so that he's standing on it. But the water needs to be placed before the land, since there are tween animations that make the water move back and forth. I have a feeling that sprite groups will be used here, but I'm not sure how to make it work for this purpose. Any suggestions? Link to comment Share on other sites More sharing options...
Heppell08 Posted April 8, 2014 Share Posted April 8, 2014 Try using a bringToTop function and then reset it.water3.bringToTop();Then reset the layer or put it to the bottom etc. Link to comment Share on other sites More sharing options...
Videlais Posted April 8, 2014 Share Posted April 8, 2014 bringToTop would work, so would checking the original draw ordering. If certain things need to be 'behind' of other objects, create (game.add) them first. The drawing order, unless changed by bringToTop, works from the order they were created. Often, it can be enough to make the player-controlled object to be the last game.add in order and 'on top' of the other drawn items. Link to comment Share on other sites More sharing options...
Recommended Posts