DrawingImmediate.Triangle Synchronous

Draw the three edges joining screen points a, b, and c. Use an outline when the interior should remain visible beneath a pointer or marker.

Syntax
Luau
DrawingImmediate.Triangle(
    a: Vector2,
    b: Vector2,
    c: Vector2,
    color: Color3,
    opacity: number,
    thickness: number
) -> ()

Parameters

Function parameters
ParameterTypeDescription
aVector2First vertex.
bVector2Second vertex.
cVector2Third vertex.
colorColor3Color3 of the primitive or text.
opacitynumberOpacity from 0 (invisible) to 1 (opaque).
thicknessnumberStroke 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

Example
Luau
local paint = DrawingImmediate.GetPaint()
local connection = paint:Connect(function()
    DrawingImmediate.Triangle(Vector2.new(100, 40), Vector2.new(40, 140), Vector2.new(160, 140), Color3.fromRGB(240, 150, 190), 1, 2)
end)
task.delay(3, function() connection:Disconnect() end)
Kawaii documentation