[−][src]Struct keyframe::Keyframe
Intermediate step in an animation sequence
Methods
impl<T: CanTween + Copy> Keyframe<T>
[src]
pub fn new<F: Float>(
value: T,
time: F,
function: impl EasingFunction + 'static + Send + Sync
) -> Self
[src]
value: T,
time: F,
function: impl EasingFunction + 'static + Send + Sync
) -> Self
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 value(&self) -> T
[src]
The value of this keyframe
pub fn time(&self) -> f64
[src]
The time in seconds at which this keyframe starts in a sequence
pub fn function(&self) -> &dyn EasingFunction
[src]
The easing function that will be used when tweening to another keyframe
pub fn tween_to(&self, next: &Keyframe<T>, time: impl Float) -> T
[src]
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
Trait Implementations
impl<T: CanTween + Copy + Debug> Debug for Keyframe<T>
[src]
impl Default for Keyframe<f32>
[src]
impl Default for Keyframe<Vector2<f32>>
[src]
impl Default for Keyframe<Point2<f64>>
[src]
impl Default for Keyframe<Point3<f64>>
[src]
impl Default for Keyframe<Vector3<f32>>
[src]
impl Default for Keyframe<Vector4<f32>>
[src]
impl Default for Keyframe<Point2<f32>>
[src]
impl Default for Keyframe<Point3<f32>>
[src]
impl Default for Keyframe<f64>
[src]
impl Default for Keyframe<Vector2<f64>>
[src]
impl Default for Keyframe<Vector3<f64>>
[src]
impl Default for Keyframe<Vector4<f64>>
[src]
impl<T: CanTween + Copy + Display> Display for Keyframe<T>
[src]
impl<V: CanTween + Copy, T: Float, F: EasingFunction + 'static + Send + Sync> From<(V, T, F)> for Keyframe<V>
[src]
fn from(tuple: (V, T, F)) -> Self
[src]
Creates a new keyframe from a tuple of (value, time, function). If the time value is negative the keyframe will start at 0.0.
impl<V: CanTween + Copy, T: Float> From<(V, T)> for Keyframe<V>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Keyframe<T>
impl<T> Send for Keyframe<T> where
T: Send,
T: Send,
impl<T> Sync for Keyframe<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Keyframe<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Keyframe<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,