Transitioning screens - noob question

Hello all - this is my first post. I have been really enjoying the various documentation, examples, etc. However, I can’t really find much on the best way to manage multiple screens. I have seen the Director Class and am wondering if that is the best practice?

My specific issue is that I created a game loop that runs off of the “enterframe” runtime listener. I am using timers to manage various facets of the action (i.e. player loses life - pause enemy timers, clear screen, then resume).

I now want to add an option screen before the loop starts and invoke it at will from within the loop. To that end, I did manage to create a display.group() that gets called when I push a button. However, I have to pause all the timers and physics manually when I press it. Sometimes it does not behave properly (i.e. actors will appear on the new screen if it is pushed to quickly with consecutive clicks).

I was hoping for an best approach to stopping the action and then resuming it and navigating between multiple screens. Any help would be greatly appreciated. Thank you very much.

JFish [import]uid: 81347 topic_id: 15387 reply_id: 315387[/import]

I love Director class and have used it in many, many apps and I’d say it is one of two gentle, efficient ways to go.

The other is this http://developer.anscamobile.com/forum/2011/08/27/release-scenemanager-v10-try-it-now-alternative-director-class#new

Which is very similar to Director - it’s really a matter of personal preference.

Peach :slight_smile: [import]uid: 52491 topic_id: 15387 reply_id: 56886[/import]

That’s not the latest version Peach :stuck_out_tongue: [import]uid: 84637 topic_id: 15387 reply_id: 56974[/import]

Peach/Danny -

Thanks for your responses. Please forgive the noob-nature of these next two questions:

  1. I assume that I need to add all my images to a group (or groups) in order to make either class work. If so, would this require me to go back and find all the images and manually add them to whatever group I create? Is this an accurate understanding of these work?

  2. Once I start using the classes will I still need to manage the action (i.e. pause timers etc) when I switch from one screen to another or can any of that happen auto-magically through the classes?

JFish [import]uid: 81347 topic_id: 15387 reply_id: 56985[/import]

@Danny - sorry about that!

@Jay -

  1. When I add an image I add it to the group at the time, eg;
    [lua]local apple = display.newImage(“apple.png”)
    localGroup:insert(apple)[/lua]
    That makes it easy and I’ve never had trouble keeping track.

  2. No, you will still need to make your timers and Runtime listeners.

Peach :slight_smile:
[import]uid: 52491 topic_id: 15387 reply_id: 57075[/import]