pub fn load(sprite: BlitBuffer) -> Result<SpriteRef>Expand description
Load a sprite buffer and place it onto the heap.
Returns an index that can be used in sprite components.
use blit::{BlitBuffer, Color};
use specs_blit::load;
const MASK_COLOR: u32 = 0xFF00FF;
// Create a sprite of 4 pixels
let sprite = BlitBuffer::from_buffer(&[0, MASK_COLOR, 0, 0], 2, MASK_COLOR);
// Load the sprite and get a reference
let sprite_ref = load(sprite)?;