Struct bevy::animation::prelude::AnimationPlayer
pub struct AnimationPlayer { /* private fields */ }
Expand description
Animation controls
Implementations§
§impl AnimationPlayer
impl AnimationPlayer
pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut AnimationPlayer
pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut AnimationPlayer
Start playing an animation, resetting state of the player This will use a linear blending between the previous and the new animation to make a smooth transition
pub fn start_with_transition(
&mut self,
handle: Handle<AnimationClip>,
transition_duration: Duration
) -> &mut AnimationPlayer
pub fn start_with_transition( &mut self, handle: Handle<AnimationClip>, transition_duration: Duration ) -> &mut AnimationPlayer
Start playing an animation, resetting state of the player This will use a linear blending between the previous and the new animation to make a smooth transition
pub fn play(&mut self, handle: Handle<AnimationClip>) -> &mut AnimationPlayer
pub fn play(&mut self, handle: Handle<AnimationClip>) -> &mut AnimationPlayer
Start playing an animation, resetting state of the player, unless the requested animation is already playing.
If transition_duration
is set, this will use a linear blending
between the previous and the new animation to make a smooth transition
pub fn play_with_transition(
&mut self,
handle: Handle<AnimationClip>,
transition_duration: Duration
) -> &mut AnimationPlayer
pub fn play_with_transition( &mut self, handle: Handle<AnimationClip>, transition_duration: Duration ) -> &mut AnimationPlayer
Start playing an animation, resetting state of the player, unless the requested animation is already playing. This will use a linear blending between the previous and the new animation to make a smooth transition
pub fn repeat(&mut self) -> &mut AnimationPlayer
pub fn repeat(&mut self) -> &mut AnimationPlayer
Set the animation to repeat
pub fn stop_repeating(&mut self) -> &mut AnimationPlayer
pub fn stop_repeating(&mut self) -> &mut AnimationPlayer
Stop the animation from repeating
pub fn pause(&mut self)
pub fn pause(&mut self)
Pause the animation
pub fn resume(&mut self)
pub fn resume(&mut self)
Unpause the animation
pub fn set_speed(&mut self, speed: f32) -> &mut AnimationPlayer
pub fn set_speed(&mut self, speed: f32) -> &mut AnimationPlayer
Set the speed of the animation playback
pub fn set_elapsed(&mut self, elapsed: f32) -> &mut AnimationPlayer
pub fn set_elapsed(&mut self, elapsed: f32) -> &mut AnimationPlayer
Seek to a specific time in the animation
Trait Implementations§
§impl Component for AnimationPlayerwhere
AnimationPlayer: Send + Sync + 'static,
impl Component for AnimationPlayerwhere AnimationPlayer: Send + Sync + 'static,
type Storage = TableStorage
§impl Default for AnimationPlayer
impl Default for AnimationPlayer
§fn default() -> AnimationPlayer
fn default() -> AnimationPlayer
§impl GetTypeRegistration for AnimationPlayerwhere
bool: Reflect,
PlayingAnimation: Reflect,
Vec<AnimationTransition, Global>: Any + Send + Sync,
impl GetTypeRegistration for AnimationPlayerwhere bool: Reflect, PlayingAnimation: Reflect, Vec<AnimationTransition, Global>: Any + Send + Sync,
§impl Reflect for AnimationPlayerwhere
bool: Reflect,
PlayingAnimation: Reflect,
Vec<AnimationTransition, Global>: Any + Send + Sync,
impl Reflect for AnimationPlayerwhere bool: Reflect, PlayingAnimation: Reflect, Vec<AnimationTransition, Global>: Any + Send + Sync,
§fn get_type_info(&self) -> &'static TypeInfo
fn get_type_info(&self) -> &'static TypeInfo
§fn into_any(
self: Box<AnimationPlayer, Global>
) -> Box<dyn Any + 'static, Global>
fn into_any( self: Box<AnimationPlayer, Global> ) -> Box<dyn Any + 'static, Global>
Box<dyn Any>
.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
.§fn into_reflect(
self: Box<AnimationPlayer, Global>
) -> Box<dyn Reflect + 'static, Global>
fn into_reflect( self: Box<AnimationPlayer, Global> ) -> Box<dyn Reflect + 'static, Global>
§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
§fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
Reflect
trait object. Read more§fn set(
&mut self,
value: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
fn set( &mut self, value: Box<dyn Reflect + 'static, Global> ) -> Result<(), Box<dyn Reflect + 'static, Global>>
§fn apply(&mut self, value: &(dyn Reflect + 'static))
fn apply(&mut self, value: &(dyn Reflect + 'static))
§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
§fn reflect_owned(self: Box<AnimationPlayer, Global>) -> ReflectOwned
fn reflect_owned(self: Box<AnimationPlayer, Global>) -> ReflectOwned
§fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
§impl Struct for AnimationPlayerwhere
bool: Reflect,
PlayingAnimation: Reflect,
Vec<AnimationTransition, Global>: Any + Send + Sync,
impl Struct for AnimationPlayerwhere bool: Reflect, PlayingAnimation: Reflect, Vec<AnimationTransition, Global>: Any + Send + Sync,
§fn field(&self, name: &str) -> Option<&(dyn Reflect + 'static)>
fn field(&self, name: &str) -> Option<&(dyn Reflect + 'static)>
name
as a &dyn Reflect
.§fn field_mut(&mut self, name: &str) -> Option<&mut (dyn Reflect + 'static)>
fn field_mut(&mut self, name: &str) -> Option<&mut (dyn Reflect + 'static)>
name
as a
&mut dyn Reflect
.§fn field_at(&self, index: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn Reflect + 'static)>
index
as a
&dyn Reflect
.§fn field_at_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>
fn field_at_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>
index
as a &mut dyn Reflect
.§fn iter_fields(&self) -> FieldIter<'_> ⓘ
fn iter_fields(&self) -> FieldIter<'_> ⓘ
§fn clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct
.Auto Trait Implementations§
impl RefUnwindSafe for AnimationPlayer
impl Send for AnimationPlayer
impl Sync for AnimationPlayer
impl Unpin for AnimationPlayer
impl UnwindSafe for AnimationPlayer
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> Cwhere F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a, Aligned>,
fn get_components( self, func: &mut impl FnMut(StorageType, OwningPtr<'_, Aligned>) )
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World§impl<T> GetPath for Twhere
T: Reflect,
impl<T> GetPath for Twhere T: Reflect,
§fn reflect_path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'r, 'p>( &'r self, path: &'p str ) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read more§fn reflect_path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'r, 'p>( &'r mut self, path: &'p str ) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read more