Collapse Sidebar


Not to be confused with datatype/UDim2, which is used to describe rectangular areas on-screen.

Rect describes a rectangle on a 2D plane. It is constructed using two of its corners, either using two datatype/Vector2 form or as four articles/Numbers|numbers:

Rect.new(Vector2.new(1, 2), Vector2.new(3, 4))
Rect.new(1, 2, 3, 4)

The Rect data type is used in the ImageLabel/SliceCenter property, which determines the center area of a scaled image.


Rect.new ( Vector2 min, Vector2 max )

Constructs a new Rect given two datatype/Vector2: min as top left corner and max as bottom right corner.

Rect.new ( number minX, number minY, number maxX, number maxY )

Constructs a new Rect using minX and minY as coordinates for the top left corner, and maxX and maxY as coordinates for the bottom right corner.


number Rect.Width

The width of the Rect in pixels.

number Rect.Height

The height of the Rect in pixels.

Vector2 Rect.Min

The top-left corner.

Vector2 Rect.Max

The bottom-right corner.