Skip to content
Immediate drawingOverview

Paint.Connect

Connects a paint object to its drawing callback.

Details#

Registers a function on a paint handle and returns a numeric connection ID. DrawingImmediate commands belong inside this callback; keep the ID for paint:Disconnect.

Examples#

Example

Luau
local paint = DrawingImmediate.GetPaint()
local id = paint:Connect(function()
    DrawingImmediate.Text(Vector2.new(20, 20), "frame")
end)
task.delay(1, function() paint:Disconnect(id) end)