pub struct Sprite { /* private fields */ }
Expand description
Sprite is used for drawing images to batch It does not contain any heavy image data. if you check size of sprite its not horribly big and copying it is only right approach its a trade of - copying is slower in order to make drawing faster
Implementations§
Source§impl Sprite
impl Sprite
pub const PATTERN: [u32; 6]
pub const VERTEX_COUNT: usize = 4usize
pub const VERTEX_SIZE: usize = 8usize
pub const COLOR_OFFSET: usize = 4usize
Sourcepub fn new(region: Rect) -> Sprite
pub fn new(region: Rect) -> Sprite
new returns new sprite. rect is a texture region of texture in sprite-sheet so if you are not using sprite-sheet just pass a bounding rectangle of whole texture
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sprite
impl RefUnwindSafe for Sprite
impl Send for Sprite
impl Sync for Sprite
impl Unpin for Sprite
impl UnwindSafe for Sprite
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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