Skip to content
GitLab
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • Solarus Games Solarus Games
  • Solarus Solarus
  • Issues
  • #1273

Animations with 1 frame do not work

In this scenario:

Screenshot_from_2018-09-23_21.50.17

Is does not seem that Solarus recognizes this as an actual animation. When there is only 1 frame, it doesn't matter if "Loop on frame" is ticked.

I think if "Loop on frame" is ticked, it should work like a normal animation, even when it's only 1 frame. In this case, it's an animation that loops forever over a single frame.

Changing this would also fix #1235.

To give an example of why this is important, hero:set_animation() says:

A function to call when the animation ends (on the tunic sprite). If the animation loops, or is replaced by another animation before it ends, then the function will never be called.

The animation in the screenshot should loop on frame 0, and therefore the callback will never be called. Instead, calling set_animation() does not work at all, because Solarus doesn't see this as an animation.

Likewise, in this scenario:

Screenshot_from_2018-09-23_22.00.53

the callback should be called after 100ms

This also affects stuff like sword animations, swim animations, etc as described in #1235

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking