Skip to content

animation_frame

Return the sprite id for a named animation at a given time.

Parameters

  • atlas — An atlas.
  • name — An animation name.
  • elapsed_ms — A non-negative time in milliseconds.
  • loop? — true (default) or false to hold the last frame.
local id = animation_frame(atlas, "flash", elapsed, true)
draw_sprite(atlas, id, x, y)

Related: animation_color, animation_repeats.

See the animations guide for more examples and limits.