pub struct RegionAttachment { /* private fields */ }
Expand description

An attachment which draws a texture.

Spine API Reference

Implementations§

source§

impl RegionAttachment

source

pub const fn new_from_ptr(c_region_attachment: *mut spRegionAttachment) -> Self

source

pub unsafe fn compute_world_vertices( &self, slot: &Slot, vertices: &mut [f32], offset: i32, stride: i32 )

§Safety

The slot passed in must be the same slot this attachment originated from.

source

pub fn update_region(&mut self)

source

pub fn update_from_props(&mut self, props: &RegionProps)

source

pub fn name(&self) -> &str

source

pub fn attachment_type(&self) -> AttachmentType

source

pub fn path(&self) -> &str

source

pub fn set_path(&mut self, value: String) -> Result<(), NulError>

§Errors

Returns std::ffi::NulError if an interior nul byte is found.

source

pub fn x(&self) -> f32

The local x translation.

source

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

source

pub fn y(&self) -> f32

The local y translation.

source

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

source

pub fn scale_x(&self) -> f32

The local scaleX.

source

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

source

pub fn scale_y(&self) -> f32

The local scaleY.

source

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

source

pub fn rotation(&self) -> f32

The local rotation.

source

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

source

pub fn width(&self) -> f32

The width of the region attachment in Spine.

source

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

source

pub fn height(&self) -> f32

The height of the region attachment in Spine.

source

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

source

pub fn color(&self) -> Color

source

pub fn color_mut(&mut self) -> &mut Color

source

pub fn uvs(&self) -> [c_float; 8]

source

pub fn offset(&self) -> [c_float; 8]

source

pub fn renderer_object(&self) -> RendererObject<'_>

source

pub fn region(&self) -> Option<CTmpRef<'_, Self, TextureRegion>>

source

pub fn region_mut(&mut self) -> Option<CTmpMut<'_, Self, TextureRegion>>

source

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

Get a pointer to the underlying spine-c type.

source§

impl RegionAttachment

Functions available if using the mint feature.

source

pub fn position(&self) -> Vector2<f32>

source

pub fn scale(&self) -> Vector2<f32>

source

pub fn size(&self) -> Vector2<f32>

Trait Implementations§

source§

impl Debug for RegionAttachment

source§

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

Formats the value using the given formatter. Read more

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.