I’ve been working out how to implement pause/resume in my code. I’ve seen the beebeclass approach, which users onEnterFrame, but I think an approach using timers themselves would be cleaner.
I’ve tried directly changing the internal _time variable within the timer, which seems to be the system time at which the timer will be triggered.
[lua] Key: _time Value: 1021 Key: _count Value: 1
Key: _listener Value: function: 0x1ced3920
Key: _delay Value: 1000
Key: _iterations Value: 3[/lua]
If so, then all timers can be simply paused by making this a huge number, and saving the remaining time in another field, _remaining.
Resuming could be accomplished by resetting _time to system.getTimer() + _remaining.
Could somebody from Ansca please explain if this should work?
[import]uid: 36578 topic_id: 11288 reply_id: 311288[/import]