Struct keyframe::Keyframe [−][src]
pub struct Keyframe<T> { /* fields omitted */ }
Expand description
Intermediate step in an animation sequence
Implementations
Creates a new keyframe from the specified values. If the time value is negative the keyframe will start at 0.0.
Arguments
value
- The value that this keyframe will be tweened to/fromtime
- The start time in seconds of this keyframefunction
- The easing function to use from the start of this keyframe to the start of the next keyframe
pub fn new_dynamic<F: Float>(
value: T,
time: F,
function: Box<dyn EasingFunction + Send + Sync + 'static>
) -> Self
pub fn new_dynamic<F: Float>(
value: T,
time: F,
function: Box<dyn EasingFunction + Send + Sync + 'static>
) -> Self
Same as new
, but allows you to supply an easing function which size is not known at compile time.
Arguments
value
- The value that this keyframe will be tweened to/fromtime
- The start time in seconds of this keyframefunction
- The easing function to use from the start of this keyframe to the start of the next keyframe
The easing function that will be used when tweening to another keyframe
Returns the value between this keyframe and the next keyframe at the specified time
Note
The following applies if:
- The requested time is before the start time of this keyframe: the value of this keyframe is returned
- The requested time is after the start time of next keyframe: the value of the next keyframe is returned
- The start time of the next keyframe is before the start time of this keyframe: the value of the next keyframe is returned