Rect

Utility class for manipulating 2D axis aligned rectangles.

Constructors

this
this(T rectLeft, T rectTop, T rectWidth, T rectHeight)

Construct the rectangle from its coordinates

this
this(Vector2!(T) position, Vector2!(T) size)

Construct the rectangle from position and size

Members

Functions

contains
bool contains(E X, E Y)

Check if a point is inside the rectangle's area.

contains
bool contains(Vector2!(E) point)

Check if a point is inside the rectangle's area.

intersects
bool intersects(Rect!(E) rectangle)

Check the intersection between two rectangles.

intersects
bool intersects(Rect!(E) rectangle, out Rect!(O) intersection)

Check the intersection between two rectangles.

opEquals
bool opEquals(const Rect!(E) otherRect)

Compare two rectangles for equality.

toString
string toString()

Output the string representation of the Rect.

Variables

height
T height;

Height of the rectangle.

left
T left;

Left coordinate of the rectangle.

top
T top;

Top coordinate of the rectangle.

width
T width;

Width of the rectangle.

Meta