Skip to content
Immediate drawingOverview

DrawingImmediate.Rectangle

Represents an outlined rectangle drawing command.

Details#

Draws a rectangle using position Vector2 and size Vector2 (not opposite corners), then Color3, filled boolean, thickness (1) and rounding (0). Call inside a Paint callback; commands outside painting do not create retained objects. Returns no values.

Examples#

Example

Luau
local paint = DrawingImmediate.GetPaint()
local id = paint:Connect(function()
    DrawingImmediate.Rectangle(Vector2.new(20, 20), Vector2.new(100, 50), Color3.new(1, 1, 1), false, 2, 0)
end)
task.delay(1, function() paint:Disconnect(id) end)