pub struct Grid {
pub cell_width: Option<u32>,
pub cell_height: Option<u32>,
}Expand description
Grid packing algorithm.
Every sprite occupies an identically sized cell. Sprites are placed
left-to-right then top-to-bottom. Cell dimensions default to the maximum
sprite width and height across all input sprites; they can be overridden via
cell_width / cell_height for fixed-cell sprite sheets.
Sprites that are larger than the cell are sent to overflow without
cropping. The atlas width is determined by the number of columns that fit
within max_width; the height grows with each row added.
Fields§
§cell_width: Option<u32>Fixed cell width in pixels. None → widest sprite.
cell_height: Option<u32>Fixed cell height in pixels. None → tallest sprite.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
impl UnwindSafe for Grid
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more