Struct rusty_spine::Skeleton
source · pub struct Skeleton { /* private fields */ }
Expand description
A live Skeleton instance created from SkeletonData
.
Implementations
sourceimpl Skeleton
impl Skeleton
sourcepub fn new(skeleton_data: Arc<SkeletonData>) -> Self
pub fn new(skeleton_data: Arc<SkeletonData>) -> Self
Create a new instance of the skeleton loaded in SkeletonData
.
See SkeletonJson
or SkeletonBinary
for a complete example of loading a skeleton.
pub fn update_cache(&mut self)
pub fn update_world_transform(&mut self)
pub unsafe fn update_world_transform_with(&mut self, parent: &Bone)
pub fn set_to_setup_pose(&mut self)
pub fn set_bones_to_setup_pose(&mut self)
pub fn set_slots_to_setup_pose(&mut self)
sourcepub fn set_skin(&mut self, skin: &Skin)
pub fn set_skin(&mut self, skin: &Skin)
Set the skeleton’s skin. If the skin is a user-created one (via Skin::new
), then a
clone is created and used instead, to help ensure memory safety. If this behavior is not
desired then Skeleton::set_skin_unchecked
can be used instead.
sourcepub unsafe fn set_skin_unchecked(&mut self, skin: &Skin)
pub unsafe fn set_skin_unchecked(&mut self, skin: &Skin)
sourcepub unsafe fn set_skin_by_name_unchecked(&mut self, skin_name: &str)
pub unsafe fn set_skin_by_name_unchecked(&mut self, skin_name: &str)
Set the skeleton’s skin by name.
Safety
This function should only be called with valid skin names. It is faster than the safe
alternative, Skeleton::set_skin_by_name
, but will likely segfault if the skin does not
exist.
sourcepub fn set_skin_by_name(&mut self, skin_name: &str) -> Result<(), SpineError>
pub fn set_skin_by_name(&mut self, skin_name: &str) -> Result<(), SpineError>
Set the skeleton’s skin by name.
pub fn bone_root(&self) -> CTmpRef<'_, Skeleton, Bone>
pub fn bone_root_mut(&mut self) -> CTmpMut<'_, Skeleton, Bone>
pub fn find_bone(&self, name: &str) -> Option<CTmpRef<'_, Skeleton, Bone>>
pub fn find_bone_mut(
&mut self,
name: &str
) -> Option<CTmpMut<'_, Skeleton, Bone>>
pub fn find_slot(&self, name: &str) -> Option<CTmpRef<'_, Skeleton, Slot>>
pub fn find_slot_mut(
&mut self,
name: &str
) -> Option<CTmpMut<'_, Skeleton, Slot>>
pub fn set_attachment(
&mut self,
slot_name: &str,
attachment_name: Option<&str>
) -> bool
pub fn get_attachment_for_slot_name(
&mut self,
slot_name: &str,
attachment_name: &str
) -> Option<Attachment>
pub fn get_attachment_for_slot_index(
&mut self,
slot_index: i32,
attachment_name: &str
) -> Option<Attachment>
pub fn data(&self) -> CTmpRef<'_, Self, SkeletonData>
pub fn data_mut(&mut self) -> CTmpMut<'_, Self, SkeletonData>
pub fn color(&self) -> Color
pub fn color_mut(&mut self) -> &mut Color
pub fn bones_count(&self) -> i32
pub fn slots_count(&self) -> i32
pub fn ik_contraints_count(&self) -> i32
pub fn transform_contraints_count(&self) -> i32
pub fn path_contraints_count(&self) -> i32
pub fn scale_x(&self) -> f32
pub fn set_scale_x(&mut self, value: f32)
pub fn scale_y(&self) -> f32
pub fn set_scale_y(&mut self, value: f32)
pub fn x(&self) -> f32
pub fn set_x(&mut self, value: f32)
pub fn y(&self) -> f32
pub fn set_y(&mut self, value: f32)
pub fn bones(&self) -> CTmpPtrIterator<'_, Skeleton, Bone, spBone> ⓘ
pub fn bones_mut(&mut self) -> CTmpMutIterator<'_, Skeleton, Bone, spBone> ⓘ
pub fn bone_at_index(&self, index: i32) -> Option<CTmpRef<'_, Self, Bone>>
pub fn bone_at_index_mut(
&mut self,
index: i32
) -> Option<CTmpMut<'_, Self, Bone>>
pub fn slots(&self) -> CTmpPtrIterator<'_, Skeleton, Slot, spSlot> ⓘ
pub fn slots_mut(&mut self) -> CTmpMutIterator<'_, Skeleton, Slot, spSlot> ⓘ
pub fn slot_at_index(&self, index: i32) -> Option<CTmpRef<'_, Self, Slot>>
pub fn slot_at_index_mut(
&mut self,
index: i32
) -> Option<CTmpMut<'_, Self, Slot>>
pub fn draw_order(&self) -> CTmpPtrIterator<'_, Skeleton, Slot, spSlot> ⓘ
pub fn draw_order_mut(&mut self) -> CTmpMutIterator<'_, Skeleton, Slot, spSlot> ⓘ
pub fn draw_order_at_index(&self, index: i32) -> Option<CTmpRef<'_, Self, Slot>>
pub fn draw_order_at_index_mut(
&mut self,
index: i32
) -> Option<CTmpMut<'_, Self, Slot>>
pub fn skin(&self) -> Option<CTmpRef<'_, Self, Skin>>
pub fn skin_mut(&mut self) -> Option<CTmpMut<'_, Self, Skin>>
pub fn c_ptr(&self) -> *mut spSkeleton
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Skeleton
impl Send for Skeleton
impl Sync for Skeleton
impl Unpin for Skeleton
impl UnwindSafe for Skeleton
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