pub struct AnimChannel {
pub from: f32,
pub to: f32,
pub current: f32,
pub velocity: f32,
pub elapsed_secs: f32,
pub mode: InterpolationMode,
/* private fields */
}Expand description
A single animated value over time (e.g., an x-coordinate or opacity).
Complex animations are created by combining multiple channels. For example, moving an element in 2D requires four channels: x and y translation, and x and y scale.
Fields§
§from: f32Where the value started. Re-seeded on every retarget.
to: f32Where it is heading.
current: f32The current value to write into the cascade.
velocity: f32Units per second. Carried across retargets.
elapsed_secs: f32Seconds since the animation began (curve mode only).
mode: InterpolationModeHow it is driven.
Implementations§
Source§impl AnimChannel
impl AnimChannel
Sourcepub const fn curve(
from: f32,
to: f32,
function: AnimationInterpolationFunction,
duration_secs: f32,
) -> Self
pub const fn curve( from: f32, to: f32, function: AnimationInterpolationFunction, duration_secs: f32, ) -> Self
A channel that eases from → to over duration_secs.
Sourcepub const fn spring(from: f32, to: f32, spring: Spring) -> Self
pub const fn spring(from: f32, to: f32, spring: Spring) -> Self
A channel that springs from → to.
Sourcepub const fn is_finished(&self) -> bool
pub const fn is_finished(&self) -> bool
Whether this channel has arrived at the target value and can be dropped (animation finished)
Trait Implementations§
Source§impl Clone for AnimChannel
impl Clone for AnimChannel
Source§fn clone(&self) -> AnimChannel
fn clone(&self) -> AnimChannel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AnimChannel
Source§impl Debug for AnimChannel
impl Debug for AnimChannel
Source§impl PartialEq for AnimChannel
impl PartialEq for AnimChannel
impl StructuralPartialEq for AnimChannel
Auto Trait Implementations§
impl Freeze for AnimChannel
impl RefUnwindSafe for AnimChannel
impl Send for AnimChannel
impl Sync for AnimChannel
impl Unpin for AnimChannel
impl UnsafeUnpin for AnimChannel
impl UnwindSafe for AnimChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more