[][src]Struct quicksilver::geom::Rectangle

pub struct Rectangle {
    pub pos: Vector,
    pub size: Vector,
}

A rectangle with a top-left position and a size

Fields

pos: Vector

The top-left coordinate of the rectangle

size: Vector

The width and height of the rectangle

Implementations

impl Rectangle[src]

pub fn new(pos: Vector, size: Vector) -> Rectangle[src]

Create a rectangle from a top-left vector and a size vector

pub fn new_sized(size: Vector) -> Rectangle[src]

Create a rectangle at the origin with the given size

pub fn top_left(&self) -> Vector[src]

Get the top left coordinate of the Rectangle

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

Get the x-coordinate of the Rectangle (The origin of a Rectangle is at the top left)

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

Get the y-coordinate of the Rectangle (The origin of a Rectangle is at the top left)

pub fn size(&self) -> Vector[src]

Get the size of the Rectangle

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

Get the height of the Rectangle

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

Get the width of the Rectangle

Trait Implementations

impl Clone for Rectangle[src]

impl Copy for Rectangle[src]

impl Debug for Rectangle[src]

impl Default for Rectangle[src]

impl Eq for Rectangle[src]

impl PartialEq<Rectangle> for Rectangle[src]

impl Shape for Rectangle[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.