pub struct Atlas<C> {
pub layout: Layout,
pub texture: Texture<Buf2<C>>,
}Fields§
§layout: Layout§texture: Texture<Buf2<C>>Implementations§
Source§impl<C> Atlas<C>
impl<C> Atlas<C>
Sourcepub fn new(layout: Layout, texture: Texture<Buf2<C>>) -> Self
pub fn new(layout: Layout, texture: Texture<Buf2<C>>) -> Self
Creates a new texture atlas from a texture.
Sourcepub fn coords(&self, i: u32) -> [TexCoord; 4]
pub fn coords(&self, i: u32) -> [TexCoord; 4]
Returns the texture coordinates of the sub-texture with index i.
The coordinates are the top-left, top-right, bottom-left, and bottom-right corners of the texture, in that order.
Note that currently this method does not check i is actually a valid
index and may return coordinates with values greater than one.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Atlas<C>
impl<C> RefUnwindSafe for Atlas<C>where
C: RefUnwindSafe,
impl<C> Send for Atlas<C>where
C: Send,
impl<C> Sync for Atlas<C>where
C: Sync,
impl<C> Unpin for Atlas<C>where
C: Unpin,
impl<C> UnwindSafe for Atlas<C>where
C: UnwindSafe,
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