pub struct SpritePtrOps;Expand description
Zero-sized type for Sprite pointer operations.
Implementations§
Source§impl SpritePtrOps
impl SpritePtrOps
Sourcepub fn set_color(sprite: *mut FfiSprite, r: f32, g: f32, b: f32, a: f32)
pub fn set_color(sprite: *mut FfiSprite, r: f32, g: f32, b: f32, a: f32)
Sets the color tint for the sprite.
Sourcepub fn set_source_rect(
sprite: *mut FfiSprite,
x: f32,
y: f32,
width: f32,
height: f32,
)
pub fn set_source_rect( sprite: *mut FfiSprite, x: f32, y: f32, width: f32, height: f32, )
Sets the source rectangle for sprite sheet rendering.
Sourcepub fn clear_source_rect(sprite: *mut FfiSprite)
pub fn clear_source_rect(sprite: *mut FfiSprite)
Removes the source rectangle.
Sourcepub fn get_source_rect(sprite: *const FfiSprite, out_rect: *mut FfiRect) -> bool
pub fn get_source_rect(sprite: *const FfiSprite, out_rect: *mut FfiRect) -> bool
Gets the source rectangle. Returns true if set.
Sourcepub fn has_source_rect(sprite: *const FfiSprite) -> bool
pub fn has_source_rect(sprite: *const FfiSprite) -> bool
Returns whether the sprite has a source rectangle set.
Sourcepub fn set_flip_x(sprite: *mut FfiSprite, flip: bool)
pub fn set_flip_x(sprite: *mut FfiSprite, flip: bool)
Sets the horizontal flip flag.
Sourcepub fn get_flip_x(sprite: *const FfiSprite) -> bool
pub fn get_flip_x(sprite: *const FfiSprite) -> bool
Gets the horizontal flip flag.
Sourcepub fn set_flip_y(sprite: *mut FfiSprite, flip: bool)
pub fn set_flip_y(sprite: *mut FfiSprite, flip: bool)
Sets the vertical flip flag.
Sourcepub fn get_flip_y(sprite: *const FfiSprite) -> bool
pub fn get_flip_y(sprite: *const FfiSprite) -> bool
Gets the vertical flip flag.
Sourcepub fn set_flip(sprite: *mut FfiSprite, flip_x: bool, flip_y: bool)
pub fn set_flip(sprite: *mut FfiSprite, flip_x: bool, flip_y: bool)
Sets both flip flags at once.
Sourcepub fn is_flipped(sprite: *const FfiSprite) -> bool
pub fn is_flipped(sprite: *const FfiSprite) -> bool
Returns true if the sprite is flipped on either axis.
Sourcepub fn get_anchor(sprite: *const FfiSprite) -> FfiVec2
pub fn get_anchor(sprite: *const FfiSprite) -> FfiVec2
Gets the anchor point.
Sourcepub fn set_custom_size(sprite: *mut FfiSprite, width: f32, height: f32)
pub fn set_custom_size(sprite: *mut FfiSprite, width: f32, height: f32)
Sets a custom size for the sprite.
Sourcepub fn clear_custom_size(sprite: *mut FfiSprite)
pub fn clear_custom_size(sprite: *mut FfiSprite)
Removes the custom size.
Sourcepub fn get_custom_size(sprite: *const FfiSprite, out_size: *mut FfiVec2) -> bool
pub fn get_custom_size(sprite: *const FfiSprite, out_size: *mut FfiVec2) -> bool
Gets the custom size. Returns true if set.
Sourcepub fn has_custom_size(sprite: *const FfiSprite) -> bool
pub fn has_custom_size(sprite: *const FfiSprite) -> bool
Returns whether the sprite has a custom size set.
Sourcepub fn set_texture(sprite: *mut FfiSprite, handle: u64)
pub fn set_texture(sprite: *mut FfiSprite, handle: u64)
Sets the texture handle.
Sourcepub fn get_texture(sprite: *const FfiSprite) -> u64
pub fn get_texture(sprite: *const FfiSprite) -> u64
Gets the texture handle.
Sourcepub fn size_or_rect(sprite: *const FfiSprite) -> FfiVec2
pub fn size_or_rect(sprite: *const FfiSprite) -> FfiVec2
Gets the effective size (custom > source_rect > zero).
Auto Trait Implementations§
impl Freeze for SpritePtrOps
impl RefUnwindSafe for SpritePtrOps
impl Send for SpritePtrOps
impl Sync for SpritePtrOps
impl Unpin for SpritePtrOps
impl UnsafeUnpin for SpritePtrOps
impl UnwindSafe for SpritePtrOps
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more