pub struct RepeatConfig {
pub repeat: Repeat,
pub yoyo: bool,
pub delay: f32,
}Expand description
Complete repeat configuration for a tween.
Fields§
§repeat: RepeatHow many times to repeat.
yoyo: boolAlternate direction on each repeat (ping-pong effect).
delay: f32Delay in seconds before each repeat.
Implementations§
Source§impl RepeatConfig
impl RepeatConfig
Sourcepub fn none() -> RepeatConfig
pub fn none() -> RepeatConfig
Create a new repeat config with no repeating.
Sourcepub fn count(n: u32) -> RepeatConfig
pub fn count(n: u32) -> RepeatConfig
Create a repeat config that repeats n times.
Sourcepub fn infinite() -> RepeatConfig
pub fn infinite() -> RepeatConfig
Create a repeat config that repeats infinitely.
Sourcepub fn with_yoyo(self, yoyo: bool) -> RepeatConfig
pub fn with_yoyo(self, yoyo: bool) -> RepeatConfig
Enable yoyo mode (alternate direction on each repeat).
Sourcepub fn with_delay(self, delay: f32) -> RepeatConfig
pub fn with_delay(self, delay: f32) -> RepeatConfig
Set delay before each repeat.
Sourcepub fn is_repeating(&self) -> bool
pub fn is_repeating(&self) -> bool
Check if this config has any repeating.
Sourcepub fn should_reverse(&self, iteration: u32) -> bool
pub fn should_reverse(&self, iteration: u32) -> bool
Check if the animation should reverse on the given iteration.
With yoyo enabled, odd iterations play in reverse.
Sourcepub fn total_duration(&self, single_duration: f32) -> Option<f32>
pub fn total_duration(&self, single_duration: f32) -> Option<f32>
Calculate total duration including all repeats.
Returns None for infinite repeats.
Trait Implementations§
Source§impl Clone for RepeatConfig
impl Clone for RepeatConfig
Source§fn clone(&self) -> RepeatConfig
fn clone(&self) -> RepeatConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RepeatConfig
impl Debug for RepeatConfig
Source§impl Default for RepeatConfig
impl Default for RepeatConfig
Source§fn default() -> RepeatConfig
fn default() -> RepeatConfig
Returns the “default value” for a type. Read more
impl Copy for RepeatConfig
Auto Trait Implementations§
impl Freeze for RepeatConfig
impl RefUnwindSafe for RepeatConfig
impl Send for RepeatConfig
impl Sync for RepeatConfig
impl Unpin for RepeatConfig
impl UnwindSafe for RepeatConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more