It looks like you're new here. If you want to get involved, click one of these buttons!
stage:setOrientation(Stage.LANDSCAPE_LEFT) local sceneManager = SceneManager.new({ ["menu"] = menu, ["pvp_level_select"] = pvp_level_select }) sceneManager:addEventListener("transitionBegin", function() print("manager - transition begin") end) sceneManager:addEventListener("transitionEnd", function() print("manager - transition end") end) local transition = { SceneManager.moveFromLeft, SceneManager.moveFromRight, SceneManager.moveFromBottom, SceneManager.moveFromTop, SceneManager.moveFromLeftWithFade, SceneManager.moveFromRightWithFade, SceneManager.moveFromBottomWithFade, SceneManager.moveFromTopWithFade, SceneManager.overFromLeft, SceneManager.overFromRight, SceneManager.overFromBottom, SceneManager.overFromTop, SceneManager.overFromLeftWithFade, SceneManager.overFromRightWithFade, SceneManager.overFromBottomWithFade, SceneManager.overFromTopWithFade, SceneManager.fade, SceneManager.crossFade, SceneManager.flip, SceneManager.flipWithFade, SceneManager.flipWithShade, } local scenes = {"menu","pvp_level_select"} --adding the manager to the stage stage:addChild(sceneManager) --start the menu scene sceneManager:changeScene("menu", 1, transition) |
Comments
cheers
evs
so what exactly is menu and pvp_level_select.
They should usually be sprite inherited objects:
Likes: QuasarCreator
Now, when I press the pvp button on my menu which is suppose to transition to pvp_level_select the items for the pvp_level_select file show up, however, the items from the menu are still showing. So I am wondering what I am missing?
Here is my menu file
<<pre escaped='true' lang='lua'>
pvp_level_select = gideros.class(Sprite)
function pvp_level_select:init()
local scrollButton1 = Button.new(Bitmap.new(Texture.new("Images/scroll10-15.png")),
Bitmap.new(Texture.new("Images/scroll10-15.png")))
scrollButton1:setPosition(100, 100)
stage:addChild(scrollButton1)
end
Thankyou!
Instead of adding your images to stage you should add them to self, otherwise sceneManager will not clear them as it only removes menu (or whatever class you added) and its children from the stage.
I also keep my event listener functions separate with a name for easy removal or they'll carry on listening in the next scene
cheers
evs
Likes: QuasarCreator
Thank you very much my app works perfectly now!