struct
Timeline
pub struct Timeline {
pub entries: Vec<Entry>,
pub labels: HashMap<String, f64>,
pub repeat: i32,
pub yoyo: bool,
pub repeat_delay: f64,
}A sequence of tweens with labels, repeat and yoyo.
Fields
Methods
add
pub fn add(&mut self, tween: Tween, position: &str) -> f64Add a tween at a position (see [Position::parse]); returns its start time.
total_duration
pub fn total_duration(&self) -> f64Length including repeats (infinite when repeating forever).
local_time
pub fn local_time(&self, t: f64) -> f64Map a playhead time to a time within one cycle (handling repeat and yoyo).
sample
pub fn sample(&self, t: f64) -> Vec<Sample>Every value at playhead time t. Targets of tweens that haven't started yet are left alone, except from values which apply immediately (as in GSAP, so content doesn't flash before it animates).
sample_entry
pub fn sample_entry(&self, k: usize, t: f64) -> Vec<Sample>The values of one child at playhead time t (see [Timeline::sample]). Runtimes render children in order, resolving each one's start values just before, so a tween picks up where the previous one left off.