[][src]Struct macroquad::math::Rect

pub struct Rect {
    pub x: f32,
    pub y: f32,
    pub w: f32,
    pub h: f32,
}

Fields

x: f32y: f32w: f32h: f32

Implementations

impl Rect[src]

pub fn new(x: f32, y: f32, w: f32, h: f32) -> Rect[src]

pub fn point(&self) -> Vec2[src]

pub fn left(&self) -> f32[src]

Returns the left edge of the Rect

pub fn right(&self) -> f32[src]

Returns the right edge of the Rect

pub fn top(&self) -> f32[src]

Returns the top edge of the Rect

pub fn bottom(&self) -> f32[src]

Returns the bottom edge of the Rect

pub fn move_to(&mut self, destination: Vec2)[src]

Moves the Rect's origin to (x, y)

pub fn scale(&mut self, sx: f32, sy: f32)[src]

Scales the Rect by a factor of (sx, sy), growing towards the bottom-left

pub fn contains(&self, point: Vec2) -> bool[src]

Checks whether the Rect contains a Point

pub fn overlaps(&self, other: &Rect) -> bool[src]

Checks whether the Rect overlaps another Rect

Trait Implementations

impl Clone for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

impl Default for Rect[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.