DrawingImmediate.GetPaint
Creates a paint handle with Connect(callback), Disconnect(id) and Clear(). Use the DrawingImmediate draw functions inside a connected callback.
Syntax
DrawingImmediate.GetPaint(zIndex?: number) -> table
Parameters
| Parameter | Type | Description |
|---|---|---|
zIndex? | number | The paint layer to target. |
Returns
| Type | Description |
|---|---|
table | The returned collection or table. |
Description
DrawingImmediate.GetPaint is part of the DrawingImmediate library. Immediate drawing runs inside a paint callback registered with DrawingImmediate.GetPaint(); primitives are emitted for the current frame only.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
local paint = DrawingImmediate.GetPaint()
local id = paint:Connect(function()
DrawingImmediate.Text(Vector2.new(20, 20), "Yuari", Color3.new(1, 1, 1), 16)
end)
paint:Disconnect(id)
Notes
- Draw calls must run inside a callback registered with DrawingImmediate.GetPaint().