Skip to main content

ActiveAnim

Struct ActiveAnim 

Source
pub struct ActiveAnim {
    pub class: AnimClass,
    pub translate_x: AnimChannel,
    pub translate_y: AnimChannel,
    pub scale_x: AnimChannel,
    pub scale_y: AnimChannel,
    pub opacity: AnimChannel,
}
Expand description

One in-flight animation: the FLIP channels plus opacity.

Fields§

§class: AnimClass

What kind of presence change started this.

§translate_x: AnimChannel

Horizontal offset channel.

§translate_y: AnimChannel

Vertical offset channel.

§scale_x: AnimChannel

Horizontal scale channel.

§scale_y: AnimChannel

Vertical scale channel.

§opacity: AnimChannel

Opacity channel.

Implementations§

Source§

impl ActiveAnim

Source

pub const fn move_from_flip( flip: FlipTransform, mode: InterpolationMode, ) -> Self

A move: start at the FLIP inversion, animate to identity.

Source

pub const fn enter_slide( from_x: f32, from_y: f32, mode: InterpolationMode, ) -> Self

An enter: slide in from (from_x, from_y) to identity, full opacity and size.

Source

pub fn retarget_presence(&mut self, class: AnimClass, to_x: f32, to_y: f32)

An exit: slide out from identity to (to_x, to_y), full opacity and size. Only visible with exit-retention.

Reversing a presence animation in flight will retarget from the current values with velocity preserved.

Source

pub const fn exit_slide(to_x: f32, to_y: f32, mode: InterpolationMode) -> Self

Source

pub fn tick(&mut self, dt: f32)

Advance every channel by dt seconds.

Source

pub const fn is_finished(&self) -> bool

True once every channel has arrived.

Source

pub const fn current_transform(&self) -> FlipTransform

The transform to write this frame.

Source

pub const fn current_opacity(&self) -> f32

The opacity to write this frame.

Source

pub fn retarget_move(&mut self, flip: FlipTransform)

Re-aim at a new FLIP target, preserving position and velocity.

Trait Implementations§

Source§

impl Clone for ActiveAnim

Source§

fn clone(&self) -> ActiveAnim

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ActiveAnim

Source§

impl Debug for ActiveAnim

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ActiveAnim

Source§

fn eq(&self, other: &ActiveAnim) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ActiveAnim

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.