anim(
spec) ->anim
Create an animated sprite from a frame sequence
spec:
frames (an array of sprites) or {sheet=<sheet>, frames=<array of indices/names>}; durations (a single number of seconds applied to every frame, or an array of per-frame seconds); loop (true = forever, false = stop on the last frame, or a positive integer loop count); on_end (called once when a non-looping/counted animation finishes).The anim is itself a blit source delegating to the current frame: call
:update(dt) each tick, then canvas:blit(anim, x, y) (or anim:current()).