Storyboard

No longer needed… Delete me! :stuck_out_tongue: [import]uid: 54776 topic_id: 24283 reply_id: 109237[/import]

Hey Folks, I’m having some problems with passing parameters using gotoScene. I have a scene that I use as a menu and then a scene that I use as a game- it’s a math game. The game scene is capable of offering several exercises including multiply, add, subtract or divide. The desired exercise is dictated by which button the user presses from the menu. If “Multiplication” is pressed, then operation = “Multiplication” is passed as a parameter to the game scene.

It works fine the first time you choose a particular operation from the menu scene. However, if I go back to the menu (from the game scene) and then click to try a different operation, when I get back to the game scene, the previous operation is still in effect.

It seems like I cannot override the initial parameter when I go to the game scene a second time. If anyone has any suggestions, I would really appreciate reading them. [import]uid: 104085 topic_id: 24283 reply_id: 109308[/import]

Answered my own question. I was using:

storyboard.purgeScene( "scene1" )  

to try to purge the game scene (scene1), but I put it in createScene of my menu page. So, I moved this line to enterScene and everything is working perfectly now. Yay! [import]uid: 104085 topic_id: 24283 reply_id: 109318[/import]

Hi,

I have a question related with storyboard and memory management:
-When application exits “applicationExit”, do I have to purge/remove the secenes in order to free the memory? Or does the system release the memory itself we needed?

-And if the application is suspended “applicationSuspend”. Should I expect the system to kill the process if the memory is needed?

Thanks! [import]uid: 76413 topic_id: 24283 reply_id: 110501[/import]

@angelpou, applicationExit will purge/remove all memory usage for your app. You need to save any program state that you would need to restore when you application restarts.

You should always assume that the OS will kill your program to get back memory after an applicationSuspend event. Most of the time you will get a applicationResume event, but there may be times when it’s killed instead. [import]uid: 7559 topic_id: 24283 reply_id: 110503[/import]

Is there a way to insert storyboard’s view into another display group? For instance I have a navigation similar to the FaceBook app (left side scrolling nav and right side view overlays the nav), and I want the right side view to contain storyboard so I can load other views into it. I have the slide and dragging of the right view in place and am loading a couple views statically and everything works fine but I would love to use storyboard to control the right side displaygroups views/scenes. Is this at all possible or am I trying to do something impossible? [import]uid: 58885 topic_id: 24283 reply_id: 115958[/import]

If you put a menu (or something else) out of the storyboard scenes (in the main for example) and above these, this will always be visible while the storyboard scenes are changing. [import]uid: 141611 topic_id: 24283 reply_id: 115988[/import]

jbverschoor_bloomsix, I’m having the same issue – did you ever resolve it?

I get this weird error when trying to return to the menu scene:

Runtime error
bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
?: in function ‘gotoScene’
/Users/XXXXXXXXX.lua:32: in function ‘_listener’
?: in function <?:514>
?: in function <?:215>

Latest daily build. I’ve been looking for 2 days now :S
[import]uid: 87249 topic_id: 24283 reply_id: 131085[/import]

Yeah emm… I have to think real hard, but I think it was something stupid like filenaming, or something

Maybe it was even something like using a solon instead of a dot [import]uid: 5942 topic_id: 24283 reply_id: 131112[/import]

jbverschoor_bloomsix, I’m having the same issue – did you ever resolve it?

I get this weird error when trying to return to the menu scene:

Runtime error
bad argument #-2 to ‘insert’ (Proxy expected, got nil)
stack traceback:
[C]: ?
[C]: in function ‘insert’
?: in function ‘gotoScene’
/Users/XXXXXXXXX.lua:32: in function ‘_listener’
?: in function <?:514>
?: in function <?:215>

Latest daily build. I’ve been looking for 2 days now :S
[import]uid: 87249 topic_id: 24283 reply_id: 131085[/import]

Yeah emm… I have to think real hard, but I think it was something stupid like filenaming, or something

Maybe it was even something like using a solon instead of a dot [import]uid: 5942 topic_id: 24283 reply_id: 131112[/import]

@sjerrett are you inserting anything into “group” during the createScene() event? [import]uid: 199310 topic_id: 24283 reply_id: 134816[/import]

@sjerrett are you inserting anything into “group” during the createScene() event? [import]uid: 199310 topic_id: 24283 reply_id: 134816[/import]

Is there a way to properly goto a scene from an overlay scene?

For example:

menu.lua -> game.lua -> pausemenu.lua (this is an overlay on top of game.lua)

When I try to go back to menu.lua from pausemenu.lua using gotoScene(), the overlay instantly disappears…then the transition begins and menu.lua is loaded. How can I stop the overlay from disappearing when I call gotoScene()? [import]uid: 159810 topic_id: 24283 reply_id: 135372[/import]

I don’t think you can. Overlay’s sit on top of other scenes. To go to another scene implies that the overlay needs to disappear.

[import]uid: 199310 topic_id: 24283 reply_id: 135373[/import]

Ah, okay. I have settled with simply fading the overlay before calling gotoScene().

I suppose one could “fake it” however, by fading in a black rectangle over the whole scene (including the overlay) then calling gotoScene() from there.

In any case, thanks for the help! [import]uid: 159810 topic_id: 24283 reply_id: 135374[/import]

Actually, I’ve got another question.

Is there a way to entirely “nuke” a scene? In switching between scenes, I would like to completely nuke and unload the previous scene (all objects, listeners, timers, etc.) without having to manually do so in the scene’s “exitScene” event.

I have tried removeScene() with no luck (listeners are still active)
[import]uid: 159810 topic_id: 24283 reply_id: 135376[/import]

I’ve found it best to not use overlay when I have to go to other places. Overlays are great if you’re returning to your scene.
[import]uid: 199310 topic_id: 24283 reply_id: 135377[/import]

I just mean from “normal” scene-to-scene exchanges. Just looking for a way to “nuke” the previous scene so I don’t have to manually remove all of the listeners/timers and things from the exitScene listener. [import]uid: 159810 topic_id: 24283 reply_id: 135379[/import]

removeScene() dumps the whole scene (removes any display objects that it’s managing and calls the destroyScene() event handler.

You are still responsible for stopping timers, audio that’s playing that may have a call back, transitions that have onComplete handlers, etc. You probably should be making a habit of doing that in your exitScene() handler because if one of those call backs fires while your in another scene there is a good chance that you will crash with a segment violation crash.
[import]uid: 199310 topic_id: 24283 reply_id: 135382[/import]