feat(anim): clarify reverse play in animation API (#7338)

This commit is contained in:
Victor Wheeler
2024-12-17 23:43:00 -07:00
committed by GitHub
parent e1f2b2e451
commit 64e01e5248
22 changed files with 110 additions and 103 deletions

View File

@@ -115,10 +115,10 @@ To create an Animation, start by creating an Animation *template* in an
lv_anim_set_start_cb(&anim_template, start_cb);
/* When ready, play the Animation backward with this duration. Default is 0 (disabled) [ms] */
lv_anim_set_playback_duration(&anim_template, time);
lv_anim_set_reverse_duration(&anim_template, time);
/* Delay before playback. Default is 0 (disabled) [ms] */
lv_anim_set_playback_delay(&anim_template, delay);
/* Delay before reverse play. Default is 0 (disabled) [ms] */
lv_anim_set_reverse_delay(&anim_template, delay);
/* Number of repetitions. Default is 1. LV_ANIM_REPEAT_INFINITE for infinite repetition */
lv_anim_set_repeat_count(&anim_template, cnt);
@@ -201,10 +201,10 @@ Sometimes an Animation needs to play forward, and then play backwards, effective
reversing course, animating from the ``end`` value back to the ``start`` value again.
To do this, pass a non-zero value to this function to set the duration for the
reverse portion of the Animation:
:cpp:expr:`lv_anim_set_playback_duration(&anim_template, duration_in_ms)`.
:cpp:expr:`lv_anim_set_reverse_duration(&anim_template, duration_in_ms)`.
Optionally, you can also introduce a delay between the forward and backward
directions using :cpp:expr:`lv_anim_set_playback_delay(&anim_template, delay_in_ms)`
directions using :cpp:expr:`lv_anim_set_reverse_delay(&anim_template, delay_in_ms)`
@@ -321,7 +321,7 @@ easy to create complex composite Animations. To create and use an Animation Tim
own copy of the contents of the Animation template, so if you do not need it
later, its contents do not need to be preserved after this call.
It supports forward and backward playback of the entire Animation group, using
It supports forward and reverse play of the entire Animation group, using
:cpp:expr:`lv_anim_timeline_set_reverse(timeline, reverse)`. Note that if you want to
play in reverse from the end of the Timeline, you need to call
:cpp:expr:`lv_anim_timeline_set_progress(timeline, LV_ANIM_TIMELINE_PROGRESS_MAX)`
@@ -337,7 +337,7 @@ Call :cpp:expr:`lv_anim_timeline_set_progress(timeline, progress)` function to s
state of the Animation Timeline according to the ``progress`` value. ``progress`` is
a value between ``0`` and ``32767`` (:c:macro:`LV_ANIM_TIMELINE_PROGRESS_MAX`) to indicate the
proportion of the Timeline that has "played". Example: a ``progress`` value of
:cpp:expr:`LV_ANIM_TIMELINE_PROGRESS_MAX / 2` would set the Timeline playback to its
:cpp:expr:`LV_ANIM_TIMELINE_PROGRESS_MAX / 2` would set the Timeline play to its
half-way point.
Call :cpp:expr:`lv_anim_timeline_get_playtime(timeline)` function to get the total