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

Hello,
I answered you on my post where you try to help me .
After reading this post.

I am using a panel (which has a blinking animation), which i change parent on multipule screens . every time i move to next screen i change parent of my panel conating animation to next screen and when i come back i change again parent again.

May be you can find some advices for me.

for each screen i am doing this simply

lv_obj_set_parent(ui_Paneltemperature, ui_Screen1);

Replied in the other post. I more-and-more believe your solution will be using LVGL top layer in code for that animated object, and you’ll be able to forget the lv_obj_set_parent trickery alltogether.