Skip to content

Rect

Type

Rect is an immutable 2D rectangle (minX, minY, maxX, maxY) in pixels, created with Rect.new.

Min

Field
Min: vector

Min is the (minX, minY, 0) vector.

Max

Field
Max: vector

Max is the (maxX, maxY, 0) vector.

Width

Field
Width: number

Width is Max.x - Min.x.

Height

Field
Height: number

Height is Max.y - Min.y.

__tostring

Function
__tostring(self: Rect) -> string

__tostring returns "Rect(minX, minY, maxX, maxY)".

__eq

Function
__eq(self: Rect, other: Rect) -> boolean

__eq returns true when all four coordinates match.