Stop / Resume animation by code

What do you want to achieve?

I created animation with SquareLine Studio; how to stop it in the code and how to resume animation?

What have you tried so far?

Screenshot or video


  • SquareLine Studio version: 1.4.1
  • Operating system: ESP-IDF and LVGL 8.3
  • Target hardware: ESP32-S3

You can delete the animation to stop it by lv_anim_del, checking this topic might give you more details: Temporary Screen with an infinite loop animation crashes when deleted - #4 by Hermit
Restarting it would take the same code as running it in the first place.

It works but… how to stop a specific animation?
I have 2 animations running.
I want to stop only one of them.
The suggested solution stops all: lv_anim_del( NULL, …callback… );

If they have the same callback this doesn’t work to stop them individually. You would need the first argument, but it’s hidden inside the function. This export-related functionality needs to be improved in the next SquareLine Studio version.