Struct mina_core::animator::MappedTimelineAnimator
source · 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>>,
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
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
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 moresource§fn advance(&mut self, elapsed_seconds: f32)
fn advance(&mut self, elapsed_seconds: f32)
Advances whichever animation is currently playing by
elapsed_seconds
(time since the most
recent update). Read moresource§fn current_state(&self) -> &Self::State
fn current_state(&self) -> &Self::State
Gets the current state of the animator.
source§fn current_values(&self) -> &Self::Values
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.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> 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