Trait mina::Timeline

source ·
pub trait Timeline {
    type Target;

    // Required methods
    fn start_with(&mut self, values: &Self::Target);
    fn update(&self, values: &mut Self::Target, time: f32);
}
Expand description

An animator timeline.

Required Associated Types§

source

type Target

The target type that holds the set of animation properties. This is the original type from which the timeline was derived, not the generated AnimatorValues type.

Required Methods§

source

fn start_with(&mut self, values: &Self::Target)

Changes this timeline to start with a different set of values from the defaults that it was originally configured with.

Does not affect delay, repeat, or other timing properties; only the keyframes at the 0% position are changed. If the timeline repeats or reverses, the new start value will affect only the forward direction of the first cycle, and the timeline will loop or reverse back to the starting value with which it was originally configured.

This is typically used when blending animations; the newly-active timeline begins where the previously-active timeline ended or was interrupted.

Arguments
  • values - New values where the timeline should start, replacing previous defaults.
source

fn update(&self, values: &mut Self::Target, time: f32)

Updates a set of animator values to represent the timeline at a given time.

Properties that are not included in the timeline will not be updated.

Arguments
  • target - Target containing animatable values to update.
  • time - Time in the same unit scale as the timeline’s duration, generally seconds.

Implementors§

source§

impl<T> Timeline for MergedTimeline<T>where T: Timeline,

§

type Target = <T as Timeline>::Target