DrawingImmediate. Line Synchronous
Draw a straight segment between two screen points for the current frame. It is useful for a divider, underline, or connector whose endpoints move.
Luau
DrawingImmediate.Line(
from: Vector2,
to: Vector2,
color: Color3,
opacity: number,
thickness: number
) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
from | Vector2 | Starting screen position. |
to | Vector2 | Ending screen position. |
color | Color3 | Color3 of the primitive or text. |
opacity | number | Opacity from 0 (invisible) to 1 (opaque). |
thickness | number | Stroke width in screen 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.Line(Vector2.new(40, 40), Vector2.new(220, 40), Color3.fromRGB(240, 150, 190), 1, 2)
end)
task.delay(3, function() connection:Disconnect() end)