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