ID:1228565
 
(See the best response by Ter13.)
I couldn't find anything that explicitly addresses this, but do animated icons have their frames synchronized, i.e. all animations are drawn as if they started at the exact same time?

The reason I ask is that I'm going to be dynamically rendering multi-frame icons, and some of these icons may have more animation frames than others

For example, one icon might have 5 frames and another have 15 frames. Can I assume that these icon animations will be in sync, and that every time the 15-frame animation loops around to frame 0 that the 5-frame animation will have looped around to frame 0 as well, assuming that every frame uses an identical delay value, and regardless of when those icons first appeared on the client?

tl;dr are all icons drawn using a common time base, or could an icon that instantiates later than another, on the client, render completely out of sync with another icon?
That would be most unfortunate. Is, then, there no way to synchronize icon animations short of re-assigning [i]every[/i] icon to be synchronized when one needs to change?
Best response
Actually, there was a significant update to how icon animation works in byond while I was absent, so it may be a little different.

I think any icon state that is set to loop forever will sync with all other variations of that state.

However, if it is set to loop a finite number of times, you will see the animation play from frame 1 until the last frame after that number of repeats.

I'm pretty sure that's how it works now... sorry about being wrong the first time.
So any atoms with icon_state = "SomeState" will always appear identical, but their timing base won't necessarily be the same as another atom with icon_state = "OtherState"?

For a better wording:

CreateAtomWithIconState("SomeState")
sleep(4)
CreateAtomWithIconState("SomeState")
CreateAtomWithIconState("SomeOtherState")


According to this, the two "SomeState" icons would be animated in sync with each other, but "SomeOtherState" would not necessarily reach frame 0 at the same time as "SomeState" even if it has the same number of frames and frame delays?
No. They will be in sync. Unless the state has a limited number of loops.
In response to Topkasa
Since you are sleeping 4 ticks, they would only remain in sync if the first icon only had 4 frames. If it had something like say... 5-6 frames, it would be ahead by the 4 frames compared to the following 2 icons. As far as I am aware, sleeping the verb/proc these statements belong to, does not delay the animated icons you produced already.
In response to Spunky_Girl
Spunky_Girl wrote:
Since you are sleeping 4 ticks, they would only remain in sync if the first icon only had 4 frames. If it had something like say... 5-6 frames, it would be ahead by the 4 frames compared to the following 2 icons. As far as I am aware, sleeping the verb/proc these statements belong to, does not delay the animated icons you produced already.

You would be wrong here. This would only be the case if the state was changed to a limited-repeat state.
In response to Ter13
Ter13 wrote:
No. They will be in sync. Unless the state has a limited number of loops.

Okay, this is good to hear. Can I assume then that if 'SomeOtherState' were to have 8 frames, and 'SomeState' only 4, that they would remain in sync, and would both hit frame 0 at the same time, with 'SomeState' hitting frame 0 when 'SomeOtherState' hits frame 4 as well?
Frame animation is always based on a global counter. As such, an animation with 8 frames set to repeat infinite will always in in sync with 2 passes of an animation with 4 frames.
Ah, thanks. I'll have to work on my wording; that was the original question. Many thanks!