Expand description
A 2D rectangle.
Fields
x: f32
y: f32
width: f32
height: f32
Implementations
sourceimpl Rectangle
impl Rectangle
pub fn new(x: f32, y: f32, width: f32, height: f32) -> Self
pub fn set(&mut self, x: f32, y: f32, width: f32, height: f32)
sourcepub fn contains(&self, x: f32, y: f32) -> bool
pub fn contains(&self, x: f32, y: f32) -> bool
Returns true if this rectangle contains the given point.
sourcepub fn intersects(&self, rect: &Rectangle) -> Option<Rectangle>
pub fn intersects(&self, rect: &Rectangle) -> Option<Rectangle>
Returns whether this rectangle intersects another rectangle.
@param rect The other rectangle to check for intersection. @param result If supplied and the rectangles intersect, will be set to the calculated intersection rectangle.
pub fn make(x: f32, y: f32, width: f32, height: f32) -> Rectangle
pub fn zero() -> Rectangle
pub fn rect_equal_to_rect(rect1: &Rectangle, rect2: &Rectangle) -> bool
pub fn max_x(rect: &Rectangle) -> f32
pub fn mid_x(rect: &Rectangle) -> f32
pub fn min_x(rect: &Rectangle) -> f32
pub fn max_y(rect: &Rectangle) -> f32
pub fn mid_y(rect: &Rectangle) -> f32
pub fn min_y(rect: &Rectangle) -> f32
pub fn _rect_equal_to_zero(rect: &Rectangle) -> bool
sourcepub fn rect_union(rect_a: &Rectangle, rect_b: &Rectangle) -> Rectangle
pub fn rect_union(rect_a: &Rectangle, rect_b: &Rectangle) -> Rectangle
Returns the smallest rectangle that contains the two source rectangles. @function @param {cc::Rect} rectA @param {cc::Rect} rectB @return {cc::Rect}
pub fn rect_intersects_rect(rect_a: &Rectangle, rect_b: &Rectangle) -> bool
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.