Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
I can't get scene manager to work — Gideros Forum

I can't get scene manager to work

This is all i have in my entire project:


    sceneManager = SceneManager.new({
    ["scene1"] = scene1,
    ["scene2"] = scene2,
    })



    stage:addChild(sceneManager)


i keep getting

"main.lua:1: attempt to index global 'SceneManager' (a nil value)
stack traceback:
main.lua:1: in main chunk"


how can i get my scene manager to work?

Comments

  • Apollo14Apollo14 Member
    Accepted Answer
    Did you include 'scenemanager.lua' to your Gideros project?
    image

    also right after adding sceneManager to the stage, you should choose desired scene to load (in case you didn't do it already)
    stage:addChild(sceneManager)
    sceneManager:changeScene("scene1")
    scenemanager.png
    324 x 460 - 22K
    > 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)
  • Apollo14 said:

    Did you include 'scenemanager.lua' to your Gideros project?
    image

    also right after adding sceneManager to the stage, you should choose desired scene to load (in case you didn't do it already)

    stage:addChild(sceneManager)
    sceneManager:changeScene("scene1")

    So in "scenemanager.lua" i have to add:
    SceneManager = Core.class(Sprite)

    It is working now, thanks a lot! :)
Sign In or Register to comment.