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