Rect
an axis-aligned rectangle, from its minimum corner to its maximum corner
Fields
4 members
Constructing 2D Bounding Rectangles
Lifecycle: Shared
A rect stores two corners and derives its width and height from them.
Luau
local minPoint = Vector2.new(10, 20)local maxPoint = Vector2.new(210, 120)local bounds = Rect.new(minPoint, maxPoint)local width = bounds.Widthlocal height = bounds.Heightprint(string.format("Rectangle dimensions: %d x %d", width, height))