pub struct TextureAtlas {
pub width: u32,
pub height: u32,
pub pixels: Vec<u8>,
pub regions: HashMap<String, AtlasRegion>,
}Expand description
A built texture atlas.
Fields§
§width: u32Width of the atlas in pixels.
height: u32Height of the atlas in pixels.
pixels: Vec<u8>RGBA pixel data.
regions: HashMap<String, AtlasRegion>Mapping from texture path to atlas region.
Implementations§
Source§impl TextureAtlas
impl TextureAtlas
Sourcepub fn get_region(&self, texture_path: &str) -> Option<&AtlasRegion>
pub fn get_region(&self, texture_path: &str) -> Option<&AtlasRegion>
Get the region for a texture.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextureAtlas
impl RefUnwindSafe for TextureAtlas
impl Send for TextureAtlas
impl Sync for TextureAtlas
impl Unpin for TextureAtlas
impl UnwindSafe for TextureAtlas
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