DrawingImmediate. Quad Synchronous
Draw the border of a four-corner shape, joining a, b, c, and d in order. It is useful when a box is skewed or its edges are not axis aligned.
Luau
DrawingImmediate.Quad(
a: Vector2,
b: Vector2,
c: Vector2,
d: Vector2,
color: Color3,
opacity: number,
thickness: number
) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
a | Vector2 | First perimeter vertex. |
b | Vector2 | Second perimeter vertex. |
c | Vector2 | Third perimeter vertex. |
d | Vector2 | Fourth perimeter vertex. |
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.
Supply the vertices around the perimeter so the edges do not cross.
Example
Luau
local paint = DrawingImmediate.GetPaint()
local connection = paint:Connect(function()
DrawingImmediate.Quad(Vector2.new(60, 40), Vector2.new(200, 60), Vector2.new(180, 140), Vector2.new(40, 120), Color3.fromRGB(240, 150, 190), 1, 2)
end)
task.delay(3, function() connection:Disconnect() end)