DrawingImmediate. FilledRectangle Synchronous
Draw a filled rectangle for one frame. It can provide a panel background, progress segment, or other solid area behind changing content.
Luau
DrawingImmediate.FilledRectangle(
position: Vector2,
size: Vector2,
color: Color3,
opacity: number,
rounding: number
) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
position | Vector2 | Upper-left screen position. |
size | Vector2 | Width and height as Vector2. |
color | Color3 | Color3 of the primitive or text. |
opacity | number | Opacity from 0 (invisible) to 1 (opaque). |
rounding | number | Corner radius in pixels. |
Returns
()No values.
Usage notes
Immediate primitives last for one paint cycle. Submit the call again from a GetPaint listener to keep it visible; there is no object handle to update or remove.
Example
Luau
local paint = DrawingImmediate.GetPaint()
local connection = paint:Connect(function()
DrawingImmediate.FilledRectangle(Vector2.new(40, 40), Vector2.new(180, 80), Color3.fromRGB(60, 90, 140), 0.8, 8)
end)
task.delay(3, function() connection:Disconnect() end)