Rect
Overview
Rect is a data type used to express a rectangular area with two Vector2 values, representing a single rectangle through the top-left point Min and the bottom-right point Max.
Constructors
new
Creates and returns a new Rect whose Min and Max are both (0, 0).
Parameters
Return
Rect
The created Rect.
Code Samples
local NewRect = Rect.new()new
Creates and returns a new Rect using the two passed Vector2 values as the top-left and bottom-right points.
Parameters
Vector2 min
The top-left point.
Vector2 max
The bottom-right point.
Return
Rect
The created Rect.
Code Samples
new
Creates and returns a new Rect based on the four passed coordinate values.
Parameters
number minX
The X coordinate value of the top-left point.
number minY
The Y coordinate value of the top-left point.
number maxX
The X coordinate value of the bottom-right point.
number maxY
The Y coordinate value of the bottom-right point.
Return
Rect
The created Rect.
Code Samples
Properties
Height
number
The height of the Rect in pixels, calculated from the difference between the Y coordinates of Max and Min. This is a read-only value, and attempting to modify it directly results in an error.
Max
Vector2
The bottom-right point of the Rect. This is a read-only value, and attempting to modify it directly results in an error.
Min
Vector2
The top-left point of the Rect. This is a read-only value, and attempting to modify it directly results in an error.
Width
number
The width of the Rect in pixels, calculated from the difference between the X coordinates of Max and Min. This is a read-only value, and attempting to modify it directly results in an error.
Methods
Events
See also
ImageLabelImageButtonLast updated