DrawingImmediate. Triangle Synchronous
Draw the outline joining three screen-space vertices, closing the last vertex back to the first. Use it for a triangular outline or a directional indicator with an empty center.
Luau
DrawingImmediate.Triangle(
a: Vector2,
b: Vector2,
c: Vector2,
color: Color3,
opacity: number,
thickness: number
) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
a | Vector2 | First vertex. |
b | Vector2 | Second vertex. |
c | Vector2 | Third vertex. |
color | Color3 | Color3 used for the primitive or text. |
opacity | number | Opacity from 0 (invisible) to 1 (opaque). |
thickness | number | Stroke thickness for an unfilled primitive. |
Returns
()This function returns no values.
Usage notes
Immediate drawings last for one paint cycle. Call this function again from a GetPaint listener to keep the drawing visible; there is no object handle to update or remove.
Example
Luau
local color = Color3.fromRGB(240, 150, 190)
local paint = DrawingImmediate.GetPaint()
local connection = paint:Connect(function()
DrawingImmediate.Triangle(Vector2.new(100, 40), Vector2.new(40, 140), Vector2.new(160, 140), color, 1, 2)
end)
task.wait(3)
connection:Disconnect() -- stop drawing this example