Talos docs

SpriteAnimation

Since 0.6Changed in next
Plain text

Fields

FieldTypeRequiredDefaultAllowed valuesDescription
namestringyesWhat animation and ctx.sprite.play call it. Unique within the sprite.
framesstring[]yesFrame names, in the order they play; a name may repeat. At least one, and each a frame of this sprite (sprite-frame-missing).
fpsnumberyesFrames per second, above zero.
loopbooleannotrueDefault true. A non-looping animation stops on its last frame and raises the animation-end event (or the event a ctx.sprite.play names).
durationsnumber[]noSeconds each entry of frames shows for, one per entry, each above zero: for frames that hold for different times. Absent: every frame shows for 1 / fps.
modeSpriteAnimationModenoloop, once, pingpong, reverse"loop" repeats, "once" stops on the last frame, "pingpong" plays forward then back without repeating the end frames, "reverse" plays last to first. Absent: loop decides. loop is read with "pingpong" and "reverse": false plays them through once.
eventsSpriteAnimationEvent[]noBus events raised as the animation reaches its frames, in any mode. Absent: none.

See also