Struct wasm4_common::draw::Sprite
source[−]pub struct Sprite<Bytes: ?Sized = [u8]> {
pub indices: DrawIndices,
/* private fields */
}
Fields
indices: DrawIndices
Implementations
pub const fn from_byte_array(
bytes: [u8; N],
shape: [u32; 2],
bpp: BitsPerPixel,
draw_colors: DrawIndices
) -> Option<Self>
pub const unsafe fn from_bytes_unchecked(
bytes: Bytes,
shape: [u32; 2],
bpp: BitsPerPixel,
draw_colors: DrawIndices
) -> Self
pub fn from_bytes(
bytes: Bytes,
shape: [u32; 2],
bpp: BitsPerPixel,
draw_colors: DrawIndices
) -> Option<Self>
Get the sprite’s bpp (bits per pixel).
Create a subview to the sprite. Returns None
if subview is out of bounds of the sprite.
pub const unsafe fn view_unchecked<'a>(
&self,
start: [u32; 2],
shape: [u32; 2]
) -> SpriteView<'_>
pub const unsafe fn view_unchecked<'a>(
&self,
start: [u32; 2],
shape: [u32; 2]
) -> SpriteView<'_>
Create a subview to the sprite. Does not perform in bounds checks.
Safety
Resulting subview should be inside of the bounds of the Sprite
Trait Implementations
Auto Trait Implementations
impl<Bytes: ?Sized> RefUnwindSafe for Sprite<Bytes> where
Bytes: RefUnwindSafe,
impl<Bytes: ?Sized> UnwindSafe for Sprite<Bytes> where
Bytes: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more