Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI animations glitch when using the Once Backward setting #8854

Open
j-h-a opened this issue Apr 25, 2024 · 1 comment
Open

GUI animations glitch when using the Once Backward setting #8854

j-h-a opened this issue Apr 25, 2024 · 1 comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine gui Issues related to gui components more info The issue is lacking required information

Comments

@j-h-a
Copy link

j-h-a commented Apr 25, 2024

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
@j-h-a j-h-a added the bug Something is not working as expected label Apr 25, 2024
@AGulev
Copy link
Contributor

AGulev commented Apr 25, 2024

Please provide minimal repro project

@britzl britzl added gui Issues related to gui components more info The issue is lacking required information engine Issues related to the Defold engine labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine gui Issues related to gui components more info The issue is lacking required information
Projects
None yet
Development

No branches or pull requests

3 participants