pub struct TileRegion {
pub col: u32,
pub row: u32,
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub index: u32,
}Expand description
Describes a rectangular tile region within a frame.
Fields§
§col: u32Tile column index.
row: u32Tile row index.
x: u32X offset in pixels.
y: u32Y offset in pixels.
width: u32Width in pixels.
height: u32Height in pixels.
index: u32Tile index in raster order.
Implementations§
Source§impl TileRegion
impl TileRegion
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 tile region.
Sourcepub const fn is_left_edge(&self) -> bool
pub const fn is_left_edge(&self) -> bool
Check if this tile is at the left edge.
Sourcepub const fn is_top_edge(&self) -> bool
pub const fn is_top_edge(&self) -> bool
Check if this tile is at the top edge.
Trait Implementations§
Source§impl Clone for TileRegion
impl Clone for TileRegion
Source§fn clone(&self) -> TileRegion
fn clone(&self) -> TileRegion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TileRegion
impl RefUnwindSafe for TileRegion
impl Send for TileRegion
impl Sync for TileRegion
impl Unpin for TileRegion
impl UnsafeUnpin for TileRegion
impl UnwindSafe for TileRegion
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