Skip to content
CShift0.32

Rect

Struct · namespace System.Ui · Since 0.32

struct Rect : IEquatable<Rect>

A rectangle in pixels: X and Y are its top left corner.

Name Description
X The left edge.
Y The top edge.
Width The width in pixels.
Height The height in pixels.
int X

The left edge.

int Y

The top edge.

int Width

The width in pixels.

int Height

The height in pixels.

Name Description
Create A rectangle with its top left corner at (x, y).
static Rect Create(int x, int y, int width, int height)

A rectangle with its top left corner at (x, y).

Name Description
Right The first column to the right of the rectangle.
Bottom The first row below the rectangle.
Contains True if the point lies inside (the right and bottom edges are outside).
Shrink The rectangle made smaller by amount on every side (larger for a negative amount).
Intersect The part that both rectangles cover (empty if they do not overlap).
IsEmpty True if it covers no pixel.
Equals True if both have the same position and size.
ToString “(x, y, width x height)”.
int Right()

The first column to the right of the rectangle.

int Bottom()

The first row below the rectangle.

bool Contains(int x, int y)

True if the point lies inside (the right and bottom edges are outside).

Rect Shrink(int amount)

The rectangle made smaller by amount on every side (larger for a negative amount).

Rect Intersect(Rect other)

The part that both rectangles cover (empty if they do not overlap).

bool IsEmpty()

True if it covers no pixel.

bool Equals(Rect other)

True if both have the same position and size.

string ToString()

“(x, y, width x height)”.