Skip to content

struct

Animation

pub struct Animation {
    /* private fields */
}

A running (or paused) tween or timeline.

Methods

play

pub fn play(&self) -> Animation

Play it from where it is.

pause

pub fn pause(&self) -> Animation

Pause it where it is.

reverse

pub fn reverse(&self) -> Animation

Play it backwards from where it is.

restart

pub fn restart(&self) -> Animation

Play it again from the start.

seek

pub fn seek(&self, seconds: f64) -> Animation

Jump to a time (seconds) and render it.

progress

pub fn progress(&self, p: f64) -> Animation

Jump to a fraction (0..=1) of the first cycle.

time_scale

pub fn time_scale(&self, scale: f64) -> Animation

Play it faster or slower: 1 is normal speed.

duration

pub fn duration(&self) -> f64

One cycle's length (seconds).

time

pub fn time(&self) -> f64

Where it is, in seconds.

is_active

pub fn is_active(&self) -> bool

Whether it's playing.

kill

pub fn kill(&self)

Stop and forget it (values stay as they are).

Trait implementations