actuate icon indicating copy to clipboard operation
actuate copied to clipboard

I started a bunch of tweens in the same "for" and they are not synchronized

Open guifes opened this issue 4 years ago • 1 comments

I would expect that any quantity of tweens started from the same "frame" would be always syncronized. But since SimpleActuator set the "startTime" var with:

Lib.getTimer()

every time a new tween is instantiated, each instance gets a slightly different time and thus get desynchronized from the others.

As a fix suggestion, maybe instead of lazily listening to Event.ENTER_FRAME, listen to it before any tweens are instantiated and keep a single value from Lib.getTimer() as startTime.

guifes avatar Dec 06 '21 15:12 guifes

#117 I've created a PR to fix this. Hope it helps. I think the PR version is better since, it guarantees that for all actuators instantiated in the same frame, they all get the same startTime, as already happens with "stage_onEnterFrame" that is called only once per frame and calls update on every actuators with the same "currentTime" instead of fetching a new Lib.getTimer() for each one.

guifes avatar Dec 13 '21 00:12 guifes