Struct rusty_spine::AttachmentLoader
source · pub struct AttachmentLoader { /* private fields */ }
Expand description
A loader for creating custom attachments.
Currently only supports Atlas
based attachments.
Implementations§
source§impl AttachmentLoader
impl AttachmentLoader
sourcepub fn new_atlas_loader(atlas: &Atlas) -> Self
pub fn new_atlas_loader(atlas: &Atlas) -> Self
The spine runtime offers a default AttachmentLoader
that
loads attachments from an Atlas
.
sourcepub fn create_attachment(
&self,
skin: Option<Skin>,
attachment_type: AttachmentType,
name: &str,
path: &str
) -> Result<Attachment, SpineError>
pub fn create_attachment( &self, skin: Option<Skin>, attachment_type: AttachmentType, name: &str, path: &str ) -> Result<Attachment, SpineError>
Creates an Attachment
of a specified type.
§Errors
Returns SpineError::CreationFailed
if creating the attachment failed.
Check error1
and error2
for more information.
Returns SpineError::NulError
if name
or path
contain a null byte.
sourcepub fn create_region_attachment(
&self,
skin: Option<Skin>,
name: &str,
path: &str,
props: &RegionProps
) -> Result<Attachment, SpineError>
pub fn create_region_attachment( &self, skin: Option<Skin>, name: &str, path: &str, props: &RegionProps ) -> Result<Attachment, SpineError>
Convenience function for creating a RegionAttachment
.
§Errors
Returns SpineError::CreationFailed
if creating the attachment failed.
Check error1
and error2
for more information.
Returns SpineError::NulError
if name
or path
contain a null byte.
pub fn error1(&self) -> &str
pub fn error2(&self) -> &str
sourcepub const fn c_ptr(&self) -> *mut spAttachmentLoader
pub const fn c_ptr(&self) -> *mut spAttachmentLoader
Get a pointer to the underlying spine-c
type.
Trait Implementations§
source§impl Debug for AttachmentLoader
impl Debug for AttachmentLoader
source§impl Drop for AttachmentLoader
impl Drop for AttachmentLoader
source§impl NewFromPtr<spAttachmentLoader> for AttachmentLoader
impl NewFromPtr<spAttachmentLoader> for AttachmentLoader
unsafe fn new_from_ptr(c_attachment_loader: *mut spAttachmentLoader) -> Self
Auto Trait Implementations§
impl Freeze for AttachmentLoader
impl RefUnwindSafe for AttachmentLoader
impl Send for AttachmentLoader
impl Sync for AttachmentLoader
impl Unpin for AttachmentLoader
impl UnwindSafe for AttachmentLoader
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