pub struct MappedTimelineAnimator<State, Timeline, TimelineMap>where
    State: Clone + PartialEq,
    Timeline: Timeline,
    Timeline::Target: Clone,
    TimelineMap: MapLike<State, MergedTimeline<Timeline>>,{ /* private fields */ }
Expand description

Default implementation of a StateAnimator using an EnumMap.

Cannot be created directly; to create an instance, use the StateAnimatorBuilder.

Trait Implementations§

source§

impl<State, Timeline, TimelineMap> StateAnimator for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: Clone + PartialEq, Timeline: Timeline, Timeline::Target: Clone, TimelineMap: MapLike<State, MergedTimeline<Timeline>>,

§

type State = State

State enum that determines which animation to play. Most often this describes the state of user interaction and includes values such as MouseOver, MouseDown, etc.
§

type Values = <Timeline as Timeline>::Target

Target values animated by this type, i.e. the “Style” of the component being animated. Typical fields might include a transform (x, y, scale, etc.), colors or alpha values, or anything else that describes the visual appearance. Read more
source§

fn advance(&mut self, elapsed_seconds: f32)

Advances whichever animation is currently playing by elapsed_seconds (time since the most recent update). Read more
source§

fn current_state(&self) -> &Self::State

Gets the current state of the animator.
source§

fn current_values(&self) -> &Self::Values

Gets a reference to the current values, corresponding to the current State and current position on the timeline for that state.
source§

fn set_state(&mut self, state: &State)

Transitions to a new state. Read more

Auto Trait Implementations§

§

impl<State, Timeline, TimelineMap> RefUnwindSafe for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: RefUnwindSafe, Timeline: RefUnwindSafe, TimelineMap: RefUnwindSafe, <Timeline as Timeline>::Target: RefUnwindSafe,

§

impl<State, Timeline, TimelineMap> Send for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: Send, Timeline: Send, TimelineMap: Send, <Timeline as Timeline>::Target: Send,

§

impl<State, Timeline, TimelineMap> Sync for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: Sync, Timeline: Sync, TimelineMap: Sync, <Timeline as Timeline>::Target: Sync,

§

impl<State, Timeline, TimelineMap> Unpin for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: Unpin, Timeline: Unpin, TimelineMap: Unpin, <Timeline as Timeline>::Target: Unpin,

§

impl<State, Timeline, TimelineMap> UnwindSafe for MappedTimelineAnimator<State, Timeline, TimelineMap>where State: UnwindSafe, Timeline: UnwindSafe, TimelineMap: UnwindSafe, <Timeline as Timeline>::Target: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.