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 origin of the rectangle is at the top-left, with x increasing to the right and y increasing down.

Fields

X coordinate of the left edge of the rect.

Y coordinate of the top edge of the rect.

Total width of the rect

Total height of the rect.

Methods

impl Rect
[src]

[src]

Create a new rect.

[src]

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

[src]

Create a new rect from i32 coordinates.

[src]

Create a new Rect with all values zero.

[src]

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

[src]

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

[src]

Returns the left edge of the Rect

[src]

Returns the right edge of the Rect

[src]

Returns the top edge of the Rect

[src]

Returns the bottom edge of the Rect

[src]

Checks whether the Rect contains a Point

[src]

Checks whether the Rect overlaps another Rect

[src]

Translates the Rect by an offset of (x, y)

[src]

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

[src]

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

Trait Implementations

impl Copy for Rect
[src]

impl Clone for Rect
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Rect
[src]

[src]

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

[src]

This method tests for !=.

impl Debug for Rect
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for Rect
[src]

[src]

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

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Rect

impl Sync for Rect