Pause and Resume timers and transitions

I think this is a must and if you compare with Cocos 2D, this is implemented since day zero: you can have any amount of transitions and timers going on (that are called actions and scheduled actions in Cocos), and you just call pause and resume, pseudocode example:

[Director pause] --> all transitions paused in their actual state, doesn’t matter what kind of transition or what the actual progress. Example: transition.to(img, {alpha = 0, time = 1000}).
It will pause in the middle of the alpha process and keep the time.

[Director resume] --> continue everything.

Actually in Corona you have to keep track of all the timing and transitions, and when un-pausing, you have to calculate and subtract the accumulated timing and create new transitions. That is too time consuming and lead to bugs. [import]uid: 10990 topic_id: 6198 reply_id: 306198[/import]

  • 1 million on this. :slight_smile:

Ansca, as karnakgames implies, in addition to having control over specific timers/transitions (which we can easily assign to local variables, as a reference handle to control them), most of us are craving a “pause all / resume all” functionality. At some points in my game, I might have 10 timers/transitions running, some of them in an easing in/out state. To manually manage all of them, including the “time elapsed” + “time remaining” for each, which easing state they’re in (if any), and then starting them all back up again… it’s nothing short of a complete nightmare.

Others have written external functions/packages to manage timers, and “technically” they work… but this issue is really an internal issue… it’s just too complicated (and potentially buggy) to manually manage every timer and transition in our games. :slight_smile: [import]uid: 9747 topic_id: 6198 reply_id: 21747[/import]

I would love this too. As mentioned, I’ve written workarounds for my projects and horacebury made a useful library available, but these are all hacks:
http://developer.anscamobile.com/forum/2010/07/04/pausing-transitions#comment-16015 [import]uid: 12108 topic_id: 6198 reply_id: 21749[/import]