pub struct TileCoord {
pub col: u32,
pub row: u32,
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub index: u32,
}Expand description
Pixel coordinates and dimensions of a single tile within a frame.
Fields§
§col: u32Tile column index (0-based).
row: u32Tile row index (0-based).
x: u32X offset in pixels.
y: u32Y offset in pixels.
width: u32Tile width in pixels.
height: u32Tile height in pixels.
index: u32Linear raster index (row * tile_cols + col).
Implementations§
Source§impl TileCoord
impl TileCoord
Sourcepub const fn new(
col: u32,
row: u32,
x: u32,
y: u32,
width: u32,
height: u32,
tile_cols: u32,
) -> Self
pub const fn new( col: u32, row: u32, x: u32, y: u32, width: u32, height: u32, tile_cols: u32, ) -> Self
Create a new TileCoord.
Sourcepub const fn is_left_edge(&self) -> bool
pub const fn is_left_edge(&self) -> bool
True if this tile is at the left frame boundary.
Sourcepub const fn is_top_edge(&self) -> bool
pub const fn is_top_edge(&self) -> bool
True if this tile is at the top frame boundary.
Trait Implementations§
impl Eq for TileCoord
impl StructuralPartialEq for TileCoord
Auto Trait Implementations§
impl Freeze for TileCoord
impl RefUnwindSafe for TileCoord
impl Send for TileCoord
impl Sync for TileCoord
impl Unpin for TileCoord
impl UnsafeUnpin for TileCoord
impl UnwindSafe for TileCoord
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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