pub struct Rect { /* private fields */ }Expand description
A rectangle object with a left-bottom origin position and a size.
Implementations§
Source§impl Rect
impl Rect
Sourcepub fn set_origin(&mut self, val: &Vec2)
pub fn set_origin(&mut self, val: &Vec2)
Sets the position of the origin of the rectangle.
Sourcepub fn get_origin(&self) -> Vec2
pub fn get_origin(&self) -> Vec2
Gets the position of the origin of the rectangle.
Sourcepub fn set_height(&mut self, val: f32)
pub fn set_height(&mut self, val: f32)
Sets the height of the rectangle.
Sourcepub fn get_height(&self) -> f32
pub fn get_height(&self) -> f32
Gets the height of the rectangle.
Sourcepub fn set_center_x(&mut self, val: f32)
pub fn set_center_x(&mut self, val: f32)
Sets the x-coordinate of the center of the rectangle.
Sourcepub fn get_center_x(&self) -> f32
pub fn get_center_x(&self) -> f32
Gets the x-coordinate of the center of the rectangle.
Sourcepub fn set_center_y(&mut self, val: f32)
pub fn set_center_y(&mut self, val: f32)
Sets the y-coordinate of the center of the rectangle.
Sourcepub fn get_center_y(&self) -> f32
pub fn get_center_y(&self) -> f32
Gets the y-coordinate of the center of the rectangle.
Sourcepub fn set_bottom(&mut self, val: f32)
pub fn set_bottom(&mut self, val: f32)
Sets the bottom edge in y-axis of the rectangle.
Sourcepub fn get_bottom(&self) -> f32
pub fn get_bottom(&self) -> f32
Gets the bottom edge in y-axis of the rectangle.
Sourcepub fn set_lower_bound(&mut self, val: &Vec2)
pub fn set_lower_bound(&mut self, val: &Vec2)
Sets the lower bound (left-bottom) of the rectangle.
Sourcepub fn get_lower_bound(&self) -> Vec2
pub fn get_lower_bound(&self) -> Vec2
Gets the lower bound (left-bottom) of the rectangle.
Sourcepub fn set_upper_bound(&mut self, val: &Vec2)
pub fn set_upper_bound(&mut self, val: &Vec2)
Sets the upper bound (right-top) of the rectangle.
Sourcepub fn get_upper_bound(&self) -> Vec2
pub fn get_upper_bound(&self) -> Vec2
Gets the upper bound (right-top) of the rectangle.
Sourcepub fn set(&mut self, x: f32, y: f32, width: f32, height: f32)
pub fn set(&mut self, x: f32, y: f32, width: f32, height: f32)
Sets the properties of the rectangle.
§Arguments
x- The x-coordinate of the origin of the rectangle.y- The y-coordinate of the origin of the rectangle.width- The width of the rectangle.height- The height of the rectangle.