Struct agb::display::object::DynamicSprite
source · pub struct DynamicSprite { /* private fields */ }
Expand description
Sprite data that can be used to create sprites in vram.
Implementations§
source§impl DynamicSprite
impl DynamicSprite
sourcepub fn try_new(size: Size) -> Result<Self, LoaderError>
pub fn try_new(size: Size) -> Result<Self, LoaderError>
Creates a new dynamic sprite of a given size
sourcepub fn set_pixel(&mut self, x: usize, y: usize, paletted_pixel: usize)
pub fn set_pixel(&mut self, x: usize, y: usize, paletted_pixel: usize)
Set the pixel of a sprite to a given paletted pixel. Panics if the coordinate is out of range of the sprite or if the paletted pixel is greater than 4 bits.
sourcepub fn to_vram(self, palette: PaletteVram) -> SpriteVram
pub fn to_vram(self, palette: PaletteVram) -> SpriteVram
Tries to copy the sprite to vram to be used to set object sprites. Panics if it cannot be allocated.
Trait Implementations§
source§impl Clone for DynamicSprite
impl Clone for DynamicSprite
Auto Trait Implementations§
impl RefUnwindSafe for DynamicSprite
impl Send for DynamicSprite
impl Sync for DynamicSprite
impl Unpin for DynamicSprite
impl UnwindSafe for DynamicSprite
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more