Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Why does scene stay after I change to a new scene? — Gideros Forum

Why does scene stay after I change to a new scene?

ZizanymanZizanyman Member
edited June 2015 in General questions
I am using scene manager, and for some reason, when I try to change to a new scene, It adds the stuff in the new scene to the screen (pictures, etc.), but the stuff from the old scene also stays there. For example, if in one scene, I have a picture at the bottom of the screen, and in another scene, I have one at the top, both would appear at the same time. What am I forgetting to do?

Comments

  • Here is my code.
    zip
    zip
    Flappy.zip
    5K
  • piepie Member
    @Zizanyman when I define a scene I use:
    game = Core.class(Sprite)
    instead of
    game = gideros.class(Sprite)
  • keszeghkeszegh Member
    Accepted Answer
    you should always add sprites to the scene not to the stage if you use scenemanager, e.g.:
    self:addChild(spud)

    Likes: Zizanyman

    +1 -1 (+1 / -0 )Share on Facebook
  • Thanks @keszegh! This worked!
  • SinisterSoftSinisterSoft Maintainer
    But, if you want it to look like a classic arcade system, you add a layer before the scene is added to stage then sprites added to that layer will be under the stage - you can then use the stage for frontend, hiscores, settings, etc whilst having the game playing in attract mode in the background.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.