Discord
Login
Community
DARK THEME

Animations Not Looping

How to make animations not loop?

I'm trying to make a splash screen.

By default, animations will loop automatically, using their FPS setting.

If you want to control the animation, you can use drawSprite with "mysprite.0", "mysprite.1"... to render the first frame, second frame...

Here is a simple example which will play the animation of sprite "mysprite" backwards:

update = function()
  tick += 1
  if tick%10 == 0 then
    frame -= 1
    if frame <0 then frame = 5 end
  end
end

draw = function()
  screen.drawSprite("mysprite."+frame,0,0,50)
end

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community