Struct rusty_spine::SkeletonBinary
source · [−]pub struct SkeletonBinary { /* private fields */ }
Expand description
A loader for Spine binary files.
Implementations
sourceimpl SkeletonBinary
impl SkeletonBinary
sourcepub fn new(atlas: Arc<Atlas>) -> Self
pub fn new(atlas: Arc<Atlas>) -> Self
Create a new Binary loader using the default atlas attachment loader.
use std::sync::Arc;
use rusty_spine::{AnimationState, AnimationStateData, Atlas, Error, Skeleton, SkeletonBinary};
fn load_skeleton() -> Result<(Skeleton, AnimationState), Error> {
let atlas = Arc::new(Atlas::new_from_file("spineboy.atlas")?);
let skeleton_binary = SkeletonBinary::new(atlas);
let skeleton_data = Arc::new(skeleton_binary.read_skeleton_data_file("spineboy.skel")?);
let animation_state_data = AnimationStateData::new(skeleton_data.clone());
// ... prepare animation state (see AnimationStateData docs) ...
let skeleton = Skeleton::new(skeleton_data);
let animation_state = AnimationState::new(Arc::new(animation_state_data));
Ok((skeleton, animation_state))
}
pub fn read_skeleton_data(&self, data: &[u8]) -> Result<SkeletonData, Error>
pub fn read_skeleton_data_file<P: AsRef<Path>>(
&self,
path: P
) -> Result<SkeletonData, Error>
pub fn scale(&self) -> f32
pub fn set_scale(&mut self, value: f32)
pub fn c_ptr(&self) -> *mut spSkeletonBinary
Trait Implementations
sourceimpl Debug for SkeletonBinary
impl Debug for SkeletonBinary
Auto Trait Implementations
impl RefUnwindSafe for SkeletonBinary
impl Send for SkeletonBinary
impl Sync for SkeletonBinary
impl Unpin for SkeletonBinary
impl UnwindSafe for SkeletonBinary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more