We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
repeat
repeat_forever
auto_reverse
Animation
1 parent 23d42d2 commit ae35992Copy full SHA for ae35992
core/src/animation.rs
@@ -67,6 +67,26 @@ where
67
self
68
}
69
70
+ /// Makes the [`Animation`] repeat a given amount of times.
71
+ ///
72
+ /// Providing 1 repetition plays the animation twice in total.
73
+ pub fn repeat(mut self, repetitions: u32) -> Self {
74
+ self.raw = self.raw.repeat(repetitions);
75
+ self
76
+ }
77
+
78
+ /// Makes the [`Animation`] repeat forever.
79
+ pub fn repeat_forever(mut self) -> Self {
80
+ self.raw = self.raw.repeat_forever();
81
82
83
84
+ /// Makes the [`Animation`] automatically reverse when repeating.
85
+ pub fn auto_reverse(mut self) -> Self {
86
+ self.raw = self.raw.auto_reverse();
87
88
89
90
/// Transitions the [`Animation`] from its current state to the given new state.
91
pub fn go(mut self, new_state: T) -> Self {
92
self.go_mut(new_state);
0 commit comments