Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Clearing stage on scene change using SceneManager.lua - Gideros Forum

Clearing stage on scene change using SceneManager.lua

Is there an option to set that will clear the stage upon scene change? Right now my main menu buttons stay on the screen when I change to level one. Do I have to clear them manually or is there an option to clear using 'changeScene'. I see there's an options parameter but I'm not sure what goes there.


  • In the options parameter of sceneManager you put parameters like easing, delay, custom parameters etc. Take a look to appcodingeasy website for the documentation.
    You should remove everything on stage by hand: it is easier if you put your buttons on a sprite, and then add this one to stage.

    Likes: antix

    +1 -1 (+1 / -0 ) Share on Facebook
  • piepie Member
    Accepted Answer
    Or you could add your buttons directly to the first scene, and let scenemanager take care of them :)
  • Apollo14Apollo14 Member
    edited December 2018
    function clear(scene)
    	for i = scene:getNumChildren(), 1, -1 do
    p. s. very helpful info on scenes:
    1) http://appcodingeasy.com/Gideros-Mobile/Manage-Scenes-in-Gideros-Mobile

    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
  • Thank you all. I didn't realize I could add children to the scene which would make them handled by the scene manager. Seems like I would have figured that out since the scene is just a sprite class. Thanks!
  • yes, if you use scenemanager then it is best if all sprites are children/grandchildren etc. of one of the scenes and then scene transitions work as expected.

    Likes: Apollo14

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    hello there, I am back at geeking with gideros. I have some experience with java but I am new to lua. So I am learning from the resources available on the gideros website. I was having trouble clearing the buttons when changing scenes so I went through the forum and found this awesome solution, thank you for that.

    I think that this information should be available straight into the scenemanager example at this page http://wiki.giderosmobile.com/index.php/Special:MyLanguage/Scene_Management explaining a little bit more the concept.

    Have fun gideros people!
    +1 -1 (+3 / -0 ) Share on Facebook
Sign In or Register to comment.