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
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
speed up or slow down you animation
scale | effect |
---|---|
=0.0 | your animation’s duration becomes zero |
<1.0 | speed up your animation |
>1.0 | slow down your animation |
<0.0 | panics |
speed up or slow down you animation
ratio | effect |
---|---|
>1.0 | speed up your animation |
<1.0 | slow down your animation |
<=0.0 | panics |
see Animation::scale
fn repeat(self, repeat: RepeatBehavior) -> Repeat<Self> where
Self: Sized,
fn repeat(self, repeat: RepeatBehavior) -> Repeat<Self> where
Self: Sized,
repeat animations with specified strategies
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
fn to_timeline(self) -> Timeline<Self::Item> where
Self: Sized + 'static,
Self::Item: 'static,
fn to_timeline(self) -> Timeline<Self::Item> where
Self: Sized + 'static,
Self::Item: 'static,
build Timeline
fn begin_animation(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,
build Timeline
and start to play the animation