Struct rusty_spine::Slot
source · pub struct Slot { /* private fields */ }
Expand description
A slot for an attachment.
Implementations§
source§impl Slot
impl Slot
sourcepub unsafe fn set_attachment(&mut self, attachment: Option<Attachment>)
pub unsafe fn set_attachment(&mut self, attachment: Option<Attachment>)
Sets the attachment for this slot.
§Safety
The attachment must be compatible with this slot, usually by originating from it.
sourcepub fn set_to_setup_pose(&mut self)
pub fn set_to_setup_pose(&mut self)
Sets this slot to the setup pose.
sourcepub fn handle(&self) -> SlotHandle
pub fn handle(&self) -> SlotHandle
Create a persistent SlotHandle
to this Slot
.
sourcepub fn region_attachment(&self) -> Option<CTmpRef<'_, Self, RegionAttachment>>
pub fn region_attachment(&self) -> Option<CTmpRef<'_, Self, RegionAttachment>>
The RegionAttachment
attached to this slot, or None
if the attachment is a
different type.
sourcepub fn bounding_box_attachment(
&self
) -> Option<CTmpRef<'_, Self, BoundingBoxAttachment>>
pub fn bounding_box_attachment( &self ) -> Option<CTmpRef<'_, Self, BoundingBoxAttachment>>
The BoundingBoxAttachment
attached to this slot, or None
if the attachment is a
different type.
sourcepub fn mesh_attachment(&self) -> Option<CTmpRef<'_, Self, MeshAttachment>>
pub fn mesh_attachment(&self) -> Option<CTmpRef<'_, Self, MeshAttachment>>
The MeshAttachment
attached to this slot, or None
if the attachment is a
different type.
sourcepub fn point_attachment(&self) -> Option<CTmpRef<'_, Self, PointAttachment>>
pub fn point_attachment(&self) -> Option<CTmpRef<'_, Self, PointAttachment>>
The PointAttachment
attached to this slot, or None
if the attachment is a
different type.
sourcepub fn clipping_attachment(
&self
) -> Option<CTmpRef<'_, Self, ClippingAttachment>>
pub fn clipping_attachment( &self ) -> Option<CTmpRef<'_, Self, ClippingAttachment>>
The ClippingAttachment
attached to this slot, or None
if the attachment is a
different type.
sourcepub fn color(&self) -> Color
pub fn color(&self) -> Color
The color used to tint the slot’s attachment. If dark_color
is
set, this is used as the light color for two color tinting.
sourcepub fn color_mut(&mut self) -> &mut Color
pub fn color_mut(&mut self) -> &mut Color
Set the color used to tint the slot’s attachment. If dark_color
is set, this is used as the light color for two color tinting.
sourcepub fn dark_color(&self) -> Option<Color>
pub fn dark_color(&self) -> Option<Color>
The dark color used to tint the slot’s attachment for two color tinting, or None
if
two color tinting is not used. The dark color’s alpha is not used.
sourcepub fn attachment(&self) -> Option<CTmpRef<'_, Self, Attachment>>
pub fn attachment(&self) -> Option<CTmpRef<'_, Self, Attachment>>
The current attachment for the slot, or None
if the slot has no attachment.
sourcepub fn attachment_mut(&mut self) -> Option<CTmpMut<'_, Self, Attachment>>
pub fn attachment_mut(&mut self) -> Option<CTmpMut<'_, Self, Attachment>>
The current mutable attachment for the slot, or None
if the slot has no attachment.