pub struct AtlasRegions { /* private fields */ }Expand description
The name-to-rectangle index of a sprite atlas, without the image handle.
Separating the index from the image keeps the lookup half of an atlas
free of any DOM dependency, so region bookkeeping can be exercised
without a live HtmlImageElement.
Implementations§
Source§impl AtlasRegions
Implements the pure name-to-rectangle index for AtlasRegions.
impl AtlasRegions
Implements the pure name-to-rectangle index for AtlasRegions.
Sourcepub fn insert(&mut self, name: &str, region: Rect)
pub fn insert(&mut self, name: &str, region: Rect)
Inserts or replaces the source rectangle stored under a name.
§Arguments
&str- The sprite name.Rect- The source rectangle in atlas pixels.
Source§impl AtlasRegions
impl AtlasRegions
pub fn get_regions(&self) -> &HashMap<String, Rect>
pub fn set_regions(&mut self, val: HashMap<String, Rect>) -> &mut Self
Trait Implementations§
Source§impl Clone for AtlasRegions
impl Clone for AtlasRegions
Source§impl Debug for AtlasRegions
impl Debug for AtlasRegions
Source§impl Default for AtlasRegions
impl Default for AtlasRegions
Source§impl PartialEq for AtlasRegions
impl PartialEq for AtlasRegions
impl StructuralPartialEq for AtlasRegions
Auto Trait Implementations§
impl Freeze for AtlasRegions
impl RefUnwindSafe for AtlasRegions
impl Send for AtlasRegions
impl Sync for AtlasRegions
impl Unpin for AtlasRegions
impl UnsafeUnpin for AtlasRegions
impl UnwindSafe for AtlasRegions
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