Skip to content
Immediate drawingOverview

DrawingImmediate.FilledRectangle

Represents a filled rectangle drawing command.

Details#

Draws a filled rectangle using position and size Vector2, optional Color3 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.FilledRectangle(Vector2.new(20, 20), Vector2.new(100, 50), Color3.new(0, 1, 0), 0)
end)
task.delay(1, function() paint:Disconnect(id) end)