Struct agb::display::object::SpriteLoader
source · pub struct SpriteLoader { /* private fields */ }
Expand description
This holds loading of static sprites and palettes.
Implementations§
source§impl SpriteLoader
impl SpriteLoader
sourcepub fn try_get_vram_sprite(
&mut self,
sprite: &'static Sprite
) -> Result<SpriteVram, LoaderError>
pub fn try_get_vram_sprite( &mut self, sprite: &'static Sprite ) -> Result<SpriteVram, LoaderError>
Attempts to get a sprite
sourcepub fn try_get_vram_palette(
&mut self,
palette: &'static Palette16
) -> Result<PaletteVram, LoaderError>
pub fn try_get_vram_palette( &mut self, palette: &'static Palette16 ) -> Result<PaletteVram, LoaderError>
Attempts to allocate a static palette
sourcepub fn get_vram_sprite(&mut self, sprite: &'static Sprite) -> SpriteVram
pub fn get_vram_sprite(&mut self, sprite: &'static Sprite) -> SpriteVram
Allocates a sprite to vram, panics if it cannot fit.
sourcepub fn get_vram_palette(&mut self, palette: &'static Palette16) -> PaletteVram
pub fn get_vram_palette(&mut self, palette: &'static Palette16) -> PaletteVram
Allocates a palette to vram, panics if it cannot fit.
sourcepub fn garbage_collect(&mut self)
pub fn garbage_collect(&mut self)
Remove internal references to sprites that no longer exist in vram. If you neglect calling this, memory will leak over time in relation to the total number of different sprites used. It will not leak vram.