# lv_anim_timeline.h (/api/misc/lv_anim_timeline_h)



<RelatedHeaders name="lv_anim_timeline_private.h" isPrivate="false" />

<ApiSummary functions="19" structs="1" typedefs="1" macros="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (6)&#x22;,&#x22;Getters (7)&#x22;,&#x22;Other (6)&#x22;]">
  <ApiTab value="Setters (6)">
    <ApiMember kind="function" name="lv_anim_timeline_set_reverse" file="misc/lv_anim_timeline.h" line="79" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L79">
      lv_anim_timeline_set_reverse [#lv_anim_timeline_set_reverse]

      Set the playback direction of the animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_reverse(lv_anim_timeline_t *at, bool reverse)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                                 | Description                        |
      | --------- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at`      | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
      | `reverse` | <ApiLink name="bool" />                                              | whether to play in reverse.        |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_set_delay" file="misc/lv_anim_timeline.h" line="87" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L87">
      lv_anim_timeline_set_delay [#lv_anim_timeline_set_delay]

      Set the time to wait before starting the animation. Applies only when playing from the very start, or reverse from the very end.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_delay(lv_anim_timeline_t *at, uint32_t delay)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                                 | Description                      |
      | ------- | -------------------------------------------------------------------- | -------------------------------- |
      | `at`    | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to an animation timeline |
      | `delay` | <ApiLink name="uint32_t" />                                          | the delay time in milliseconds   |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_set_repeat_count" file="misc/lv_anim_timeline.h" line="94" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L94">
      lv_anim_timeline_set_repeat_count [#lv_anim_timeline_set_repeat_count]

      Make the animation timeline repeat itself.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_repeat_count(lv_anim_timeline_t *at, uint32_t cnt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                                 | Description                                                                                  |
      | ----- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
      | `at`  | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline.                                                           |
      | `cnt` | <ApiLink name="uint32_t" />                                          | repeat count or `LV_ANIM_REPEAT_INFINITE` for infinite repetition. 0: to disable repetition. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_set_repeat_delay" file="misc/lv_anim_timeline.h" line="101" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L101">
      lv_anim_timeline_set_repeat_delay [#lv_anim_timeline_set_repeat_delay]

      Set a delay before repeating the animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_repeat_delay(lv_anim_timeline_t *at, uint32_t delay)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                                 | Description                                                    |
      | ------- | -------------------------------------------------------------------- | -------------------------------------------------------------- |
      | `at`    | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline.                             |
      | `delay` | <ApiLink name="uint32_t" />                                          | delay in milliseconds before repeating the animation timeline. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_set_progress" file="misc/lv_anim_timeline.h" line="108" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L108">
      lv_anim_timeline_set_progress [#lv_anim_timeline_set_progress]

      Set the progress of the animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_progress(lv_anim_timeline_t *at, uint16_t progress)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                                                 | Description                                           |
      | ---------- | -------------------------------------------------------------------- | ----------------------------------------------------- |
      | `at`       | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline.                    |
      | `progress` | <ApiLink name="uint16_t" />                                          | set value 0~~65535 to map 0~~100% animation progress. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_set_user_data" file="misc/lv_anim_timeline.h" line="115" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L115">
      lv_anim_timeline_set_user_data [#lv_anim_timeline_set_user_data]

      Set the user\_data of a an animation timeline

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_set_user_data(lv_anim_timeline_t *at, void *user_data)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                                                 | Description                                          |
      | ----------- | -------------------------------------------------------------------- | ---------------------------------------------------- |
      | `at`        | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline.                   |
      | `user_data` | `void *`                                                             | pointer to any data. Only the pointer will be saved. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (7)">
    <ApiMember kind="function" name="lv_anim_timeline_get_playtime" file="misc/lv_anim_timeline.h" line="122" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L122">
      lv_anim_timeline_get_playtime [#lv_anim_timeline_get_playtime]

      Get the time used to play the animation timeline.

      ```c title=" " lineNumbers=1
      uint32_t lv_anim_timeline_get_playtime(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |

      **Returns:** <ApiLink name="uint32_t" /> — total time spent in animation timeline.
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_reverse" file="misc/lv_anim_timeline.h" line="129" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L129">
      lv_anim_timeline_get_reverse [#lv_anim_timeline_get_reverse]

      Get whether the animation timeline is played in reverse.

      ```c title=" " lineNumbers=1
      bool lv_anim_timeline_get_reverse(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |

      **Returns:** <ApiLink name="bool" /> — return true if it is reverse playback.
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_delay" file="misc/lv_anim_timeline.h" line="136" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L136">
      lv_anim_timeline_get_delay [#lv_anim_timeline_get_delay]

      Get the wait time when playing from the very start, or reverse from the very end.

      ```c title=" " lineNumbers=1
      uint32_t lv_anim_timeline_get_delay(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                      |
      | ---- | -------------------------------------------------------------------- | -------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to an animation timeline |

      **Returns:** <ApiLink name="uint32_t" /> — the remaining time in milliseconds
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_progress" file="misc/lv_anim_timeline.h" line="143" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L143">
      lv_anim_timeline_get_progress [#lv_anim_timeline_get_progress]

      Get the progress of the animation timeline.

      ```c title=" " lineNumbers=1
      uint16_t lv_anim_timeline_get_progress(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |

      **Returns:** <ApiLink name="uint16_t" /> — return value 0~~65535 to map 0~~100% animation progress.
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_repeat_count" file="misc/lv_anim_timeline.h" line="149" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L149">
      lv_anim_timeline_get_repeat_count [#lv_anim_timeline_get_repeat_count]

      Get repeat count of the animation timeline.

      ```c title=" " lineNumbers=1
      uint32_t lv_anim_timeline_get_repeat_count(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_repeat_delay" file="misc/lv_anim_timeline.h" line="155" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L155">
      lv_anim_timeline_get_repeat_delay [#lv_anim_timeline_get_repeat_delay]

      Get repeat delay of the animation timeline.

      ```c title=" " lineNumbers=1
      uint32_t lv_anim_timeline_get_repeat_delay(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_get_user_data" file="misc/lv_anim_timeline.h" line="161" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L161">
      lv_anim_timeline_get_user_data [#lv_anim_timeline_get_user_data]

      Get the user\_data of a an animation timeline

      ```c title=" " lineNumbers=1
      void * lv_anim_timeline_get_user_data(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (6)">
    <ApiMember kind="function" name="lv_anim_timeline_create" file="misc/lv_anim_timeline.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L45">
      lv_anim_timeline_create [#lv_anim_timeline_create]

      Create an animation timeline.

      ```c title=" " lineNumbers=1
      lv_anim_timeline_t * lv_anim_timeline_create(void)
      ```

      **Returns:** <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> — pointer to the animation timeline.
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_delete" file="misc/lv_anim_timeline.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L51">
      lv_anim_timeline_delete [#lv_anim_timeline_delete]

      Delete animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_delete(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_add" file="misc/lv_anim_timeline.h" line="59" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L59">
      lv_anim_timeline_add [#lv_anim_timeline_add]

      Add animation to the animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_add(lv_anim_timeline_t *at, uint32_t start_time, const lv_anim_t *a)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                 | Description                                                                                             |
      | ------------ | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
      | `at`         | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline.                                                                      |
      | `start_time` | <ApiLink name="uint32_t" />                                          | the time the animation started on the timeline, note that start\_time will override the value of delay. |
      | `a`          | <ApiLink name="lv_anim_t" display="const lv_anim_t *" />             | pointer to an animation.                                                                                |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_start" file="misc/lv_anim_timeline.h" line="66" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L66">
      lv_anim_timeline_start [#lv_anim_timeline_start]

      Start the animation timeline.

      ```c title=" " lineNumbers=1
      uint32_t lv_anim_timeline_start(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |

      **Returns:** <ApiLink name="uint32_t" /> — total time spent in animation timeline.
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_pause" file="misc/lv_anim_timeline.h" line="72" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L72">
      lv_anim_timeline_pause [#lv_anim_timeline_pause]

      Pause the animation timeline.

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_pause(lv_anim_timeline_t *at)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name | Type                                                                 | Description                        |
      | ---- | -------------------------------------------------------------------- | ---------------------------------- |
      | `at` | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" /> | pointer to the animation timeline. |
    </ApiMember>

    <ApiMember kind="function" name="lv_anim_timeline_merge" file="misc/lv_anim_timeline.h" line="169" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L169">
      lv_anim_timeline_merge [#lv_anim_timeline_merge]

      Merge (add) all animations of a timeline to another

      ```c title=" " lineNumbers=1
      void lv_anim_timeline_merge(lv_anim_timeline_t *dest, const lv_anim_timeline_t *src, int32_t delay)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                                       | Description                              |
      | ------- | -------------------------------------------------------------------------- | ---------------------------------------- |
      | `dest`  | <ApiLink name="lv_anim_timeline_t" display="lv_anim_timeline_t *" />       | merge animation into this timeline       |
      | `src`   | <ApiLink name="lv_anim_timeline_t" display="const lv_anim_timeline_t *" /> | merge the animations of this timeline    |
      | `delay` | <ApiLink name="int32_t" />                                                 | add the animations with this extra delay |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="_lv_anim_timeline_dsc_t">
  \_lv_anim_timeline_dsc_t [#_lv_anim_timeline_dsc_t]

  | Member         | Type                         | Description |
  | -------------- | ---------------------------- | ----------- |
  | `anim`         | <ApiLink name="lv_anim_t" /> |             |
  | `start_time`   | <ApiLink name="uint32_t" />  |             |
  | `is_started`   | <ApiLink name="uint8_t" />   |             |
  | `is_completed` | <ApiLink name="uint8_t" />   |             |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_anim_timeline_dsc_t" file="misc/lv_anim_timeline.h" line="34" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L34">
  lv_anim_timeline_dsc_t [#lv_anim_timeline_dsc_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_anim_timeline_dsc_t lv_anim_timeline_dsc_t
  ```
</ApiMember>

Macros [#macros]

<ApiMember kind="macro" name="LV_ANIM_TIMELINE_PROGRESS_MAX" file="misc/lv_anim_timeline.h" line="22" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_anim_timeline.h#L22">
  LV_ANIM_TIMELINE_PROGRESS_MAX [#lv_anim_timeline_progress_max]

  ```c title=" " lineNumbers=1
  #define LV_ANIM_TIMELINE_PROGRESS_MAX 0xFFFF
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_anim.h&#x22;]" includedBy="[&#x22;lv_anim_timeline_private.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
