richard, thanks for your support, but you’re kind of off topic with your explanations.
Timers are simple objects which hold [apart from other things]:
- reference to a function to call
- time when this function should be called [this is your delay you stated when creating timer + os.time() when the timer was created]
There is an order of execution of events and timers [I’m not exactly sure how it’s maintained, but from what I can see it’s divided into event types and then within same type it’s based on order of creation - I might be wrong here, I didn’t investigate it deep enough to be sure, but it doesn’t matter in this case].
Although it doesn’t matter, let’s assume it works like this (os.time of execution)
enter frame1 (100)
codeA
enter frame listeners1 (150)
sprite1 (200)
sprite listeners1 (250)
timers1 (300)
enter frame2 (400)
enter frame listeners2 (450)
sprite2 (500)
sprite listeners2 (550)
timers2 (600)
timerA
Let’s assume, in codeA block I’m creating a timer:
timer.performWithDelay(1, function() print("foobar") end)
I would assume this timer to be executed within timers1 block, but it’s executed within timers2.
Is this correct?
Is there something wrong with my assumption on how the timers work?
I would like to get an answer, and not a guess.
We could guess all night long if not the fact that every hour with me messing with the crap that I get because of broken setSequence/setFrame handling means financial losses I can barely take right now.
[sorry for the rant, but each error I get because of this is bringing me closer to the edge…]
Oh…
The setSequence/setFrame issue:
http://developer.coronalabs.com/forum/2012/10/11/sprite-new-animation-setsequencesetframe-function-strange-behavior [import]uid: 109453 topic_id: 33389 reply_id: 132623[/import]