Skip to main content

animato_tween/
loop_mode.rs

1//! Loop mode for [`Tween`](crate::Tween).
2
3/// Controls how a tween behaves when it reaches the end of its duration.
4///
5/// # Example
6///
7/// ```rust
8/// use animato_tween::Loop;
9///
10/// let mode = Loop::PingPong;
11/// ```
12#[derive(Clone, Debug, PartialEq)]
13#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
14pub enum Loop {
15    /// Play once and stop. Default.
16    Once,
17    /// Play exactly `n` times, then stop.
18    Times(u32),
19    /// Play forward repeatedly, forever.
20    Forever,
21    /// Play forward, then backward, then forward — forever.
22    PingPong,
23}