pub struct Zone64 {
pub p: Position64,
pub s: Size64,
}Expand description
A 2D zone combines a Position64 with a Size64.
Fields§
§p: Position64§s: Size64Implementations§
source§impl Zone64
impl Zone64
sourcepub const fn new(position: Position64, size: Size64) -> Self
pub const fn new(position: Position64, size: Size64) -> Self
Returns a new zone from the provided position and size.
sourcepub const fn new_raw(x: i64, y: i64, width: i64, height: i64) -> Self
pub const fn new_raw(x: i64, y: i64, width: i64, height: i64) -> Self
Returns a new zone from the provided position and size raw components.
sourcepub const fn position_size(&self) -> (Position64, Size64)
pub const fn position_size(&self) -> (Position64, Size64)
Gets a tuple with the position and size.
sourcepub const fn position(&self) -> Position64
pub const fn position(&self) -> Position64
Get the position.
sourcepub fn set_position(self, position: impl Into<Position64>)
pub fn set_position(self, position: impl Into<Position64>)
Chain-set the position.
source§impl Zone64
impl Zone64
sourcepub const fn as_tuple(&self) -> (i64, i64, i64, i64)
pub const fn as_tuple(&self) -> (i64, i64, i64, i64)
Returns a tuple with the (x, y, width, height) components.
sourcepub const fn from_tuple(tup: (i64, i64, i64, i64)) -> Zone64
pub const fn from_tuple(tup: (i64, i64, i64, i64)) -> Zone64
Creates a zone from a tuple with (x, y, width, height) components.