It looks like you're new here. If you want to get involved, click one of these buttons!
--[[ z-axis manipulations ]]-- function Sprite:bringToFront() local parent = self:getParent() if parent then parent:addChild(self) end return self end function Sprite:sendToBack() local parent = self:getParent() if parent then parent:addChildAt(self, 1) end return self end
Comments
Taken from giderosCodingEasy. https://github.com/ar2rsawseen/GiderosCodingEasy/blob/master/GiderosCodingEasy.lua
I forgot, there is another way:
if you have 2 sprites:
BackGround and ForeGround
and you add them to the same parent (like stage) in their "order"
stage:addChild(background)
stage:addChild(ForeGround)
if you addChild(s) to background, ForeGround should remain on top of them all.