Description
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)
- 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 isback
with the playback mode once backward, using the same 6 images as frames at 12fps. - Add a node to the GUI with the forwards animation.
- From code, play the
fwd
flipbook so the cursor is at the end:gui.play_flipbook(node, "fwd")
- After the animation is finished, from code, play the
back
flipbook:gui.play_flipbook(node, "back")
- 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