So I’m using Storyboard, but I cant seem to be able to return to main.lua
storyboard.gotoScene("main")
Other scenes do work, just not “main”
[import]uid: 200198 topic_id: 35044 reply_id: 335044[/import]
So I’m using Storyboard, but I cant seem to be able to return to main.lua
storyboard.gotoScene("main")
Other scenes do work, just not “main”
[import]uid: 200198 topic_id: 35044 reply_id: 335044[/import]
I wouldn’t recommend having your main.lua file do anything other than set up your app (load global libraries, variables, functions etc) before moving to the first actual scene. I just switch straight to a scene called start.lua which is generally the main menu after all my setup is done in main.lua.
[import]uid: 93133 topic_id: 35044 reply_id: 139321[/import]
“main” is not a storyboard scene - unless you’ve actually created a scene with the name “main”.
Most developers will create scenes within a single lua file, thus giving that scene the name of the file.
main.lua cannot be a scene because it is the starting point for the entire application and cannot be loaded the same way as other lua scene files.
Try calling your main scene “mainmenu” and putting it in “mainmenu.lua” - then call gotoScene(“mainmenu”) in your main.lua [import]uid: 8271 topic_id: 35044 reply_id: 139322[/import]
That’s how I pretty much set up my main.lua (I just use it as a gateway, so to speak), but I figured it would be a good idea to link through it again.
Thanks! [import]uid: 200198 topic_id: 35044 reply_id: 139324[/import]
I wouldn’t recommend having your main.lua file do anything other than set up your app (load global libraries, variables, functions etc) before moving to the first actual scene. I just switch straight to a scene called start.lua which is generally the main menu after all my setup is done in main.lua.
[import]uid: 93133 topic_id: 35044 reply_id: 139321[/import]
“main” is not a storyboard scene - unless you’ve actually created a scene with the name “main”.
Most developers will create scenes within a single lua file, thus giving that scene the name of the file.
main.lua cannot be a scene because it is the starting point for the entire application and cannot be loaded the same way as other lua scene files.
Try calling your main scene “mainmenu” and putting it in “mainmenu.lua” - then call gotoScene(“mainmenu”) in your main.lua [import]uid: 8271 topic_id: 35044 reply_id: 139322[/import]
That’s how I pretty much set up my main.lua (I just use it as a gateway, so to speak), but I figured it would be a good idea to link through it again.
Thanks! [import]uid: 200198 topic_id: 35044 reply_id: 139324[/import]