Trait anim::Animation[][src]

pub trait Animation: BaseAnimation {
Show 20 methods fn delay(self, delay: Duration) -> Delay<Self>
    where
        Self: Sized
, { ... }
fn delay_ms(self, millis: u64) -> Delay<Self>
    where
        Self: Sized
, { ... }
fn skip(self, progress: Duration) -> Seek<Self>
    where
        Self: Sized
, { ... }
fn seek(self, seek: SeekFrom) -> Seek<Self>
    where
        Self: Sized
, { ... }
fn seek_by(self, percent: f32) -> Seek<Self>
    where
        Self: Sized
, { ... }
fn map<F, T>(self, f: F) -> Map<Self, F, T>
    where
        Self: Sized,
        F: Fn(Self::Item) -> T
, { ... }
fn chain<Other>(self, other: Other) -> Chain<Self, Other>
    where
        Self: Sized,
        Other: Animation<Item = Self::Item>
, { ... }
fn take(self, duration: Duration) -> Take<Self>
    where
        Self: Sized
, { ... }
fn scale(self, scale: f32) -> Scale<Self>
    where
        Self: Sized
, { ... }
fn speed_up(self, ratio: f32) -> Scale<Self>
    where
        Self: Sized
, { ... }
fn repeat(self, repeat: RepeatBehavior) -> Repeat<Self>
    where
        Self: Sized
, { ... }
fn times(self, count: f32) -> Repeat<Self>
    where
        Self: Sized
, { ... }
fn forever(self) -> Repeat<Self>
    where
        Self: Sized
, { ... }
fn cycle(self) -> Repeat<Self>
    where
        Self: Sized
, { ... }
fn parallel<Other>(self, other: Other) -> Parallel<Self, Other>
    where
        Self: Sized,
        Other: Animation
, { ... }
fn zip<Other>(self, other: Other) -> Parallel<Self, Other>
    where
        Self: Sized,
        Other: Animation
, { ... }
fn cached(self) -> Cache<Self>
    where
        Self: Sized,
        Self::Item: Clone
, { ... }
fn boxed(self) -> Boxed<Self::Item>
    where
        Self: Sized + 'static
, { ... }
fn to_timeline(self) -> Timeline<Self::Item>
    where
        Self: Sized + 'static,
        Self::Item: 'static
, { ... }
fn begin_animation(self) -> Timeline<Self::Item>
    where
        Self: Sized + 'static,
        Self::Item: 'static
, { ... }
}
Expand description

your animation, which outputs animated value based on the progressing time.

Simply, you can think it as an Iterator. The difference is that an Animation always output some values.

Provided methods

always delay for specified time when play current animation; negative delay has no effect

always delay for specified time when play current animation

always move forward for specified time when play current animation

just a simple wrap on Animation::seek

always move forward for specified time when play current animation

panic
  • panics if percent < -1.0 or percent > 1.0
  • panics if current animation lasts indefinitely while seeking from end or by percent

always move forward for specified time when play current animation

just a simple wrap on Animation::seek

panic
  • panics if percent < -1.0 or percent > 1.0
  • panics if current animation lasts indefinitely

map from one type to another

chain two animations, play in the chained order

take specified duration

speed up or slow down you animation

scaleeffect
=0.0your animation’s duration becomes zero
<1.0speed up your animation
>1.0slow down your animation
<0.0panics

see Animation::speed_up

speed up or slow down you animation

ratioeffect
>1.0speed up your animation
<1.0slow down your animation
<=0.0panics

see Animation::scale

repeat animations with specified strategies

panics if count<0

repeat your animation for specified times

see Animation::repeat

panic

panics if count<0

parallel animations, play at the same time until the longest one finishes

parallel animations, play at the same time until the longest one finishes.

alias for Animation::parallel()

caches animated value, reducing computing while not animating. you might want to use it at the end of the animation chains

into boxed animation

build Timeline

build Timeline and start to play the animation

Implementors