Trouble with anim

What do you want to achieve?

Onload screen start infinite animation. Works only first time. After change to other screen and back animation is corrupted by twice init …
Optimal is achieve onunload screen stop and delete anim.
Alternate solution is not call second start when anim already run!

What have you tried so far?

Nothing Squareline dont export anim then i cant stop or delete it in code.

Screenshot or video

image

Others

  • SquareLine Studio version: 1.3.4
  • Operating system:
  • Target hardware:

You’re right, if you load a screen the animation is called again and might clash with the previous animation. If you need an infinite animation you should set it in the ‘Initial actions’ of the ‘Screens’ panel. Regarding deletion of animation when the screen is unloaded you can follow my workaround mentioned in this topic: Temporary Screen with an infinite loop animation crashes when deleted - #6 by Hermit

Yes i place it now into initial, but with animation is more troubles. For example how we can add callback to do somethink after animation end etc.

I think the problem with starting it in initial actions (with a temporary screen) is the animated TargetObject doesn’t exist at that time. It only exists in the LOADSTART event. Again, there is no way to decouple the animation from the TargetObject in the UNLOADED event (as far as I can tell) since the animation can’t be referenced.

My workaround currently is to not have the screen as Temporary because various combinations of these techniques all cause a crash.

It’s too bad lv_anim_del() didn’t provide a way to delete based on the TargetObject.

For the animation deletion based on the externally available associated callback function for the target object, I already proposed a solution in this topic (last post): Temporary Screen with an infinite loop animation crashes when deleted - #5 by CodeGrue