Struct rusty_spine::AnimationStateData
source · pub struct AnimationStateData { /* private fields */ }
Expand description
Animation settings used to instantiate AnimationState
.
Mix durations can be applied to automatically blend between animations. For example, to
smoothly mix between a walk
and run
animation for 0.2
seconds:
animation_state_data.set_mix_by_name("walk", "run", 0.2);
This operation is one way, so to blend back and forth between the two animations, two mix durations must be specified:
animation_state_data.set_mix_by_name("walk", "run", 0.2);
animation_state_data.set_mix_by_name("run", "walk", 0.2);
Implementations§
source§impl AnimationStateData
impl AnimationStateData
pub fn new(skeleton_data: Arc<SkeletonData>) -> Self
pub fn set_mix_by_name(&mut self, from_name: &str, to_name: &str, duration: f32)
pub fn set_mix(&mut self, from: &Animation, to: &Animation, duration: f32)
pub fn get_mix(&mut self, from: &Animation, to: &Animation) -> f32
pub fn skeleton_data(&self) -> CTmpRef<'_, Self, SkeletonData>
pub fn skeleton_data_mut(&mut self) -> CTmpMut<'_, Self, SkeletonData>
pub fn default_mix(&self) -> f32
pub fn set_default_mix(&mut self, value: f32)
pub fn entries(&self) -> *const c_void
sourcepub const fn c_ptr(&self) -> *mut spAnimationStateData
pub const fn c_ptr(&self) -> *mut spAnimationStateData
Get a pointer to the underlying spine-c
type.
Trait Implementations§
source§impl Debug for AnimationStateData
impl Debug for AnimationStateData
source§impl Drop for AnimationStateData
impl Drop for AnimationStateData
source§impl NewFromPtr<spAnimationStateData> for AnimationStateData
impl NewFromPtr<spAnimationStateData> for AnimationStateData
unsafe fn new_from_ptr( c_animation_state_data: *mut spAnimationStateData ) -> Self
Auto Trait Implementations§
impl Freeze for AnimationStateData
impl RefUnwindSafe for AnimationStateData
impl Send for AnimationStateData
impl Sync for AnimationStateData
impl Unpin for AnimationStateData
impl UnwindSafe for AnimationStateData
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