valueerror Posted May 12, 2014 Report Share Posted May 12, 2014 layerforeground.bringToTop();this is the line at the end of my create function to make sure my player walks behind this layer..good.. but i want all my enemies to be in front of the foregroundlayer.. if i bring my enemies to top in a foreach loop they will only be on top of their own group... as the documentation states.. so i tried this:enemies.z = layerforeground.z + 1;and the group "enemies" gets the z-index 33 while layerforeground has 32.. i thought that the group would now be infront of the layer but it isnt Quote Link to comment Share on other sites More sharing options...
ianmcgregor Posted May 12, 2014 Report Share Posted May 12, 2014 If your foreground has the same parent group (the default world group?) as your enemies group then you should be able to move the whole layer to the top:enemies.parent.bringToTop(enemies); Quote Link to comment Share on other sites More sharing options...
valueerror Posted May 12, 2014 Author Report Share Posted May 12, 2014 TypeError: Cannot read property 'parent' of undefined the group is there.. parent is the world.. at least a console.log(enemies.parent) says that at the same place.. thats weird... Quote Link to comment Share on other sites More sharing options...
ianmcgregor Posted May 12, 2014 Report Share Posted May 12, 2014 That is weird! Post more code if you feel like it and I'll have a look. Quote Link to comment Share on other sites More sharing options...
jagged0815 Posted October 10, 2015 Report Share Posted October 10, 2015 try this: game.world.bringToTop( <your Groupe or Graphic> ); adamsko 1 Quote Link to comment Share on other sites More sharing options...
adamsko Posted March 9, 2016 Report Share Posted March 9, 2016 On 10/10/2015 at 10:21 PM, jagged0815 said: try this: game.world.bringToTop( <your Groupe or Graphic> ); Works. Group has a world as its parent, so this is the way, to bring the group to the top. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.