San4er Posted September 8, 2014 Share Posted September 8, 2014 I wanna make group1 images be over group2 images. How can I do that? I tried to set group1.z=group2.z-1; or group2.z=group1.z+1; but that doesn't help. Link to comment Share on other sites More sharing options...
lewster32 Posted September 8, 2014 Share Posted September 8, 2014 Changing the z property will have no effect, this is for internally storing the order of the children of an object. The actual order is determined by an object's children property, which is an array. The objects in this array are rendered in order from first to last (back to front) - luckily there are some handy methods in the Group object such as swap which will swap two children around. The key is to know what the parent of the two groups is - I suspect if they've both just been added as is, it will be game.world, so the following should work:game.world.swap(group1, group2);There are other methods like bringToFront, sendToBack, moveUp and moveDown which will all let you control the order of an object's children. Link to comment Share on other sites More sharing options...
San4er Posted September 8, 2014 Author Share Posted September 8, 2014 Thanx Link to comment Share on other sites More sharing options...
Recommended Posts