pub struct AtlasFrame { /* private fields */ }Expand description
Where a frame is on its page, trimmed to its pixels, and where it was in its untrimmed cell.
Implementations§
Source§impl AtlasFrame
impl AtlasFrame
Sourcepub fn page(&self) -> usize
pub fn page(&self) -> usize
Its page, an index into Atlas::pages.
Sourcepub fn uv(&self) -> Rect
pub fn uv(&self) -> Rect
Its region of its page, normalized: (0, 0) to (1, 1) is all of it. For an empty frame, an empty region.
Sourcepub fn source_size(&self) -> UVec2
pub fn source_size(&self) -> UVec2
Its untrimmed cell’s size, in pixels.
Sourcepub fn pivot_in(&self, pivot: Vec2) -> Vec2
pub fn pivot_in(&self, pivot: Vec2) -> Vec2
pivot, in the untrimmed cell’s pixels, as a point of this frame’s
trimmed quad, normalized: (0, 0) its top-left corner, (1, 1) its
bottom-right. A quad of AtlasFrame::size with that pivot at an
entity’s position covers the pixels the untrimmed cell would. For an
empty frame, pivot over the cell’s size.
Trait Implementations§
Source§impl Clone for AtlasFrame
impl Clone for AtlasFrame
impl Copy for AtlasFrame
Source§impl Debug for AtlasFrame
impl Debug for AtlasFrame
Source§impl PartialEq for AtlasFrame
impl PartialEq for AtlasFrame
impl StructuralPartialEq for AtlasFrame
Auto Trait Implementations§
impl Forget for AtlasFrame
impl Freeze for AtlasFrame
impl Move for AtlasFrame
impl RefUnwindSafe for AtlasFrame
impl Send for AtlasFrame
impl Sync for AtlasFrame
impl Unpin for AtlasFrame
impl UnsafeUnpin for AtlasFrame
impl UnwindSafe for AtlasFrame
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