Struct rusty_spine::AnimationStateData

source ·
pub struct AnimationStateData { /* private fields */ }
Expand description

Animation settings used to instantiate AnimationState.

Spine API Reference

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

source

pub fn new(skeleton_data: Arc<SkeletonData>) -> Self

source

pub fn set_mix_by_name(&mut self, from_name: &str, to_name: &str, duration: f32)

source

pub fn set_mix(&mut self, from: &Animation, to: &Animation, duration: f32)

source

pub fn get_mix(&mut self, from: &Animation, to: &Animation) -> f32

source

pub fn skeleton_data(&self) -> CTmpRef<'_, Self, SkeletonData>

source

pub fn skeleton_data_mut(&mut self) -> CTmpMut<'_, Self, SkeletonData>

source

pub fn default_mix(&self) -> f32

source

pub fn set_default_mix(&mut self, value: f32)

source

pub fn entries(&self) -> *const c_void

source

pub const fn c_ptr(&self) -> *mut spAnimationStateData

Get a pointer to the underlying spine-c type.

Trait Implementations§

source§

impl Debug for AnimationStateData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for AnimationStateData

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl NewFromPtr<spAnimationStateData> for AnimationStateData

source§

unsafe fn new_from_ptr( c_animation_state_data: *mut spAnimationStateData ) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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.