Is there anyway to meddle with timer.performWithDelay?

Hi,

In my game I have two countdown timers and player has to see their current value as they decrease. So I wanted to use timer.performWithDelay and just pass my desired amount but apparently that function doesn’t give me a handle or anything that I can see how much time is left before it firing off.

So is there anyway to do so with timer.performWithDelay?

If not, I think I have to do it manually, adding amount of time that I want to “count” to current time, then in each frame (or perhaps a better way as it’s not trivial and can be off a few ms) check if current time is bigger or equal that time and if so, I fire it off. But I prefer to use Corona’s functionalists if possible because my manual way is kinda ugly and implementing it with Lua is not as tidy as I would like and besides I don’t know how to check for that value in every few seconds, perhaps with timer.performWithDelay itself.

Thanks. [import]uid: 206803 topic_id: 35114 reply_id: 335114[/import]

Did you ever figure this out? If not, I’d suggest checking out the code exchange. There are several timer modules that would achieve your desired result. [import]uid: 135394 topic_id: 35114 reply_id: 142098[/import]

Thanks for the interest. I ended up coding my own timer and manually counting miliseconds. Would you give me some links of what you are referring to? [import]uid: 206803 topic_id: 35114 reply_id: 142191[/import]

Here are a few after a cursory search through the Code Exchange:

http://developer.coronalabs.com/code/timer-functions
http://developer.coronalabs.com/code/pauseable-transitions-unified-timer-and-transition-module-can-replace-built
http://developer.coronalabs.com/code/running-clock
http://developer.coronalabs.com/code/timer-utilities
http://developer.coronalabs.com/code/stopwatch-timing-class

There are definitely more, but those should fit what you were looking for. Maybe they will be helpful in the future! [import]uid: 135394 topic_id: 35114 reply_id: 142192[/import]

Did you ever figure this out? If not, I’d suggest checking out the code exchange. There are several timer modules that would achieve your desired result. [import]uid: 135394 topic_id: 35114 reply_id: 142098[/import]

Thanks for the interest. I ended up coding my own timer and manually counting miliseconds. Would you give me some links of what you are referring to? [import]uid: 206803 topic_id: 35114 reply_id: 142191[/import]

Here are a few after a cursory search through the Code Exchange:

http://developer.coronalabs.com/code/timer-functions
http://developer.coronalabs.com/code/pauseable-transitions-unified-timer-and-transition-module-can-replace-built
http://developer.coronalabs.com/code/running-clock
http://developer.coronalabs.com/code/timer-utilities
http://developer.coronalabs.com/code/stopwatch-timing-class

There are definitely more, but those should fit what you were looking for. Maybe they will be helpful in the future! [import]uid: 135394 topic_id: 35114 reply_id: 142192[/import]