pub struct SpriteOps;Expand description
Zero-sized type hosting Sprite factory operations.
Implementations§
Source§impl SpriteOps
impl SpriteOps
Sourcepub fn new_sprite(texture_handle: u64) -> FfiSprite
pub fn new_sprite(texture_handle: u64) -> FfiSprite
Creates a new sprite with a texture handle.
Sourcepub fn new_default() -> FfiSprite
pub fn new_default() -> FfiSprite
Creates a default sprite with an invalid texture handle.
Sourcepub fn with_color(
sprite: FfiSprite,
r: f32,
g: f32,
b: f32,
a: f32,
) -> FfiSprite
pub fn with_color( sprite: FfiSprite, r: f32, g: f32, b: f32, a: f32, ) -> FfiSprite
Creates a new sprite with the specified color tint.
Sourcepub fn with_source_rect(
sprite: FfiSprite,
x: f32,
y: f32,
width: f32,
height: f32,
) -> FfiSprite
pub fn with_source_rect( sprite: FfiSprite, x: f32, y: f32, width: f32, height: f32, ) -> FfiSprite
Creates a new sprite with the specified source rectangle.
Sourcepub fn with_flip_x(sprite: FfiSprite, flip: bool) -> FfiSprite
pub fn with_flip_x(sprite: FfiSprite, flip: bool) -> FfiSprite
Creates a new sprite with the specified horizontal flip.
Sourcepub fn with_flip_y(sprite: FfiSprite, flip: bool) -> FfiSprite
pub fn with_flip_y(sprite: FfiSprite, flip: bool) -> FfiSprite
Creates a new sprite with the specified vertical flip.
Sourcepub fn with_flip(sprite: FfiSprite, flip_x: bool, flip_y: bool) -> FfiSprite
pub fn with_flip(sprite: FfiSprite, flip_x: bool, flip_y: bool) -> FfiSprite
Creates a new sprite with both flip flags set.
Auto Trait Implementations§
impl Freeze for SpriteOps
impl RefUnwindSafe for SpriteOps
impl Send for SpriteOps
impl Sync for SpriteOps
impl Unpin for SpriteOps
impl UnsafeUnpin for SpriteOps
impl UnwindSafe for SpriteOps
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