pub struct AnimatorStates(pub HashMap<String, AnimatorState>);
Expand description
The current state of animations in a component
The AnimatorStates
can be accessed from the WidgetContext
to get information about the
current state of all component animations.
§Animations & Values
A component may have any number of different animations identified by a string anim_id
.
Additionally each animation can have more than one value that is animated and each of these
values has a value_name
that can be used to get the animated value.
Tuple Fields§
§0: HashMap<String, AnimatorState>
Implementations§
Source§impl AnimatorStates
impl AnimatorStates
Sourcepub fn in_progress(&self) -> bool
pub fn in_progress(&self) -> bool
Returns whether or not any of the animations for this component are in-progress
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Returns true
if none of this component’s animations are currently running
Sourcepub fn has(&self, anim_id: &str) -> bool
pub fn has(&self, anim_id: &str) -> bool
Returns true if the widget has an animation with the given anim_id
Sourcepub fn value_progress(
&self,
anim_id: &str,
value_name: &str,
) -> Option<AnimatedValueProgress>
pub fn value_progress( &self, anim_id: &str, value_name: &str, ) -> Option<AnimatedValueProgress>
Get the current progress of the animation of a given value
This will return None
if the value is not currently being animated.
Sourcepub fn value_progress_factor_or(
&self,
anim_id: &str,
value_name: &str,
default: Scalar,
) -> Scalar
pub fn value_progress_factor_or( &self, anim_id: &str, value_name: &str, default: Scalar, ) -> Scalar
Same as value_progress_factor
but returning default
instead of None
Sourcepub fn value_progress_factor_or_zero(
&self,
anim_id: &str,
value_name: &str,
) -> Scalar
pub fn value_progress_factor_or_zero( &self, anim_id: &str, value_name: &str, ) -> Scalar
Same as value_progress_factor
but returning 0
instead of None
Trait Implementations§
Source§impl Clone for AnimatorStates
impl Clone for AnimatorStates
Source§fn clone(&self) -> AnimatorStates
fn clone(&self) -> AnimatorStates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more