Struct AtlasRegion
#[non_exhaustive]pub struct AtlasRegion {
pub uv: [f32; 4],
pub size: [u32; 2],
}Expand description
Where a sprite lies in the GUI atlas, as gui_sprite answers it: plain data, a snapshot of the
atlas built last. It stays right until the next texture_atlas_stitched for
TextureAtlas::Gui, when a mod reads it again.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.uv: [f32; 4][u0, v0, u1, v1]: the sprite’s corners, from 0 to 1 across the atlas.
size: [u32; 2]The sprite’s size in its own pixels: the default resources’ texture’s size whatever the resolution of a pack that replaced it (the units vanilla’s GUI code draws it in), the texture’s own size for one the default resources lack.
Implementations§
§impl AtlasRegion
impl AtlasRegion
Trait Implementations§
§impl Clone for AtlasRegion
impl Clone for AtlasRegion
§fn clone(&self) -> AtlasRegion
fn clone(&self) -> AtlasRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AtlasRegion
§impl Debug for AtlasRegion
impl Debug for AtlasRegion
§impl PartialEq for AtlasRegion
impl PartialEq for AtlasRegion
impl StructuralPartialEq for AtlasRegion
Auto Trait Implementations§
impl Freeze for AtlasRegion
impl RefUnwindSafe for AtlasRegion
impl Send for AtlasRegion
impl Sync for AtlasRegion
impl Unpin for AtlasRegion
impl UnsafeUnpin for AtlasRegion
impl UnwindSafe for AtlasRegion
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