Struct ggez::graphics::Rect [] [src]

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

A simple 2D rectangle.

The ggez convention is that x and y are the center of the rectangle, with width and height being the total width and height, because this is generally also how OpenGL tends to think about the world.

Fields

Methods

impl Rect
[src]

Ceates a new rect a la Love2D's love.graphics.newQuad, as a fraction of the reference rect's size.

Create a new Rect with all values zero.

Creates a new Rect at 0,0 with width and height 1.

Gets the Rect's x and y coordinates as a Point.

Returns the left edge of the Rect

Returns the right edge of the Rect

Returns the top edge of the Rect

Returns the bottom edge of the Rect

Trait Implementations

impl Copy for Rect
[src]

impl Clone for Rect
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Rect
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Rect
[src]

Formats the value using the given formatter.

impl Default for Rect
[src]

Returns the "default value" for a type. Read more

impl From<[f32; 4]> for Rect
[src]

Performs the conversion.