Skip to content

GUI animations glitch when using the Once Backward setting #8854

Closed as not planned
@j-h-a

Description

@j-h-a

Describe the bug (REQUIRED)

When playing a flipbook animation in the GUI with the playback mode set to once backward, the animation glitches on the first frame. That is for one game-frame it incorrectly shows frame zero of the flipbook, then correctly jumps to the last frame and plays them backwards back to the first.

To Reproduce (REQUIRED)

  1. Set up a simple GUI with an atlas containing two short (6-frames) flipbook animations. One is fwd with playback mode once forward, and the second is back with the playback mode once backward, using the same 6 images as frames at 12fps.
  2. Add a node to the GUI with the forwards animation.
  3. From code, play the fwd flipbook so the cursor is at the end: gui.play_flipbook(node, "fwd")
  4. After the animation is finished, from code, play the back flipbook: gui.play_flipbook(node, "back")
  5. Watch closely.

Expected behavior (REQUIRED)

The back flipbook should play from the end to the beginning, as if the cursor starts at 1 and interpolates to 0.

Actual behavior

The back flipbook briefly shows the first frame before playing correctly, as if the cursor starts at 0 for one game-frame, then jumps to 1 and interpolates back to 0.

Defold version (REQUIRED):

  • 1.7.0

Platforms (REQUIRED):

  • Platforms: macOS
  • OS: 14.4.1 Sonoma
  • Device: Mac

Workaround (OPTIONAL):

Instead of the back flipbook being once backward, make it once forward with the frames themselves in reverse order. However, for longer animations this is cumbersome because the editor does not support re-ordering the frames and so you need to add them one at a time in reverse order without making any mistakes (or edit the .atlas file by hand).

Additional context (OPTIONAL):

  • Hopefully this is a quick and easy fix. I suspect the cursor is always initialised to zero when playback starts, but in the case of once backward it should be initialised to 1.
  • Possibly related to Issues with cursor/offset across GUI/GO #8718

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working as expectedengineIssues related to the Defold engineguiIssues related to gui componentsmore infoThe issue is lacking required information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions