Transition and Timer Pause/Resume

Hello,

I’m thinking ( or wanting, hehe ) both the transitions and the timers to have pause/resume capability. Much like the TweenLite class for Actionscript.

With this, we could have tables of transitions and timers that we could loop through and pause or resume at once.

This seems like a no-brainer to me. And I don’t really want to do programmatic animation, since tweening engines have been around so long, and us seasoned old Flash developers have become so accustomed to the convenience of tween chaining, grouping, easing, reversing, sequencing, etc.

Makes me want to rewrite TweenLite in Lua, but that would take forever. All I’d like is pause/resume. :slight_smile:

Please? :slight_smile: [import]uid: 4454 topic_id: 2972 reply_id: 302972[/import]

+1 [import]uid: 5712 topic_id: 2972 reply_id: 8540[/import]

+1
I am even writing my Controller code in such a way that it is ready to accomodate PAUSE functionality for timers, listeners and especially transitions. This is essential for games…

Extending transitions to support repeat, sequence, reverse and other candies would also be very helpful. [import]uid: 7356 topic_id: 2972 reply_id: 8548[/import]

Actually, I just wrote my own transition library module that does mostly what TweenLite is capable of. DelayedCallTo, as well. Figured I gotta have it, so…

Corona guys, it’s easy. just add a “paused” boolean property to your class. Bypass the value-transforming portion of your code if it’s true. :slight_smile: [import]uid: 4454 topic_id: 2972 reply_id: 8806[/import]

Currently, is there any way, or even a workaround, to pause/resume a timer ?

My game is going to be very timers-depended and I realize that I will not be able to implement a pause functionality. Gosh! [import]uid: 7356 topic_id: 2972 reply_id: 8860[/import]

If you want a work around, canceling a timer and recreating it works just fine. This also works with transitions if you use math to set all of your settings. [import]uid: 8702 topic_id: 2972 reply_id: 9637[/import]

+1 for this. Hope it makes it in the next release. [import]uid: 8192 topic_id: 2972 reply_id: 10313[/import]

DR: any tips on implementing that?

I have a number of repeating transitions, all with different lengths. If the system’s paused I start a time accumulator. When resumed I want to subtract this value from the time parameter in the easing callback. When the animation is finished and re-triggers I want to reset this accumulator.

In other words I need each transition to keep track of its time offset.

But I’m not sure how to get this info from within the callback so that it matches to the exact object that contains the transition that the easing function is called by. It’s customary in C, for example to provide a userdata, field to a callback so it knows its context. I wonder what the Lua solution would be? [import]uid: 3953 topic_id: 2972 reply_id: 10462[/import]

+1

The inability to pause/resume transitions and timers is really frustrating for many types of games.

This is basically at the very to of my Corona wishlist. [import]uid: 7473 topic_id: 2972 reply_id: 11828[/import]

+1 [import]uid: 28895 topic_id: 2972 reply_id: 25375[/import]

I just made a class for this purpose, “Transition Manager”, check: http://karnakgames.com/wp/2011/03/transition-manager-for-corona-sdk-pause-resume-and-manage-all-transitions-in-a-scene/ [import]uid: 10990 topic_id: 2972 reply_id: 26285[/import]

Nice work Karnak! I’ve got one question though, does the new-function of transitionManager conflict with Director’s Class’ new-function? Referring to the tm.new() line used in your tutorial [import]uid: 14018 topic_id: 2972 reply_id: 26303[/import]

No, doesn’t conflict at all :slight_smile:

That’s because you are already calling from another object, example:
local director = require(“director”)
local tm = require(“transitionManager”)

director and tm are different objects, they may have same method names, but will still be different objects.

If you want to simplify the code you can do:

local tm = require("transitionManager").new()

That’s great :slight_smile: This solved many annoying issues I was struggling with! Thanks! [import]uid: 14018 topic_id: 2972 reply_id: 26461[/import]

Transition Manager is cool !

but how can I Pause/Resume Timer ? [import]uid: 21680 topic_id: 2972 reply_id: 26559[/import]

Tried Beebe’s class? :slight_smile: [import]uid: 14018 topic_id: 2972 reply_id: 26618[/import]

@karnakgames: Thanks for sharing your module. I was already planning to look into a module for this purpose from horacebury, so I’ll look at yours too. I was initially planning to write my own module for this purpose, but once I started seeing how many other people have already done this I figured I’ll find my favorite and use that. [import]uid: 12108 topic_id: 2972 reply_id: 26910[/import]

Transition Manager is great, but anyway to pause one transition instance rather than pause all? [import]uid: 74676 topic_id: 2972 reply_id: 55461[/import]