A sprite-animation playhead bound to one sprite by SpriteClips:bind. Drives the sprite's atlas cell over time; play/queue/stop/pause/resume/seek control it, on_finish/on_marker observe it, and clip/frame/playing/speed/looping read or set its state.
Append clip name to play once the current non-looping clip (and any already queued) finishes. Raises if the clip is unknown, or if the chain already ends in a forever-looping clip.
Example
anim:play("count", { looping = false })
-- Then count back down, once the first play ends.
anim:queue("count", { speed = -1 })
Playback rate multiplier; negative plays the clip in reverse.
looping
boolean
the clip's own looping
Override the clip's loop policy for this play.
Animator:stop
method
Animator:stop()
Stop playback and clear the queue, leaving the current frame shown.
Animator:pause
method
Animator:pause()
Freeze the playhead; resume continues from here.
Animator:resume
method
Animator:resume()
Resume a paused animator without resetting the playhead.
Animator:seek
method
Animator:seek(frame: number)
Jump to a 1-based frame position within the current clip (clamped). Position 1 is the clip's first frame — a position in the clip's frames list, not an atlas-cell value.
Example
anim:play("count")
anim:pause()
-- Positions count from 1 along the clip's frames.
anim:seek(3)
print(anim.frame) --> 3
Set, replace, or clear (pass nil) the callback fired once when a non-looping clip reaches its terminal end. Receives the animator and the finished clip name.