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.

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

Parameters

Function parameters
ParameterTypeDescription
aVector2First perimeter vertex.
bVector2Second perimeter vertex.
cVector2Third perimeter vertex.
dVector2Fourth perimeter 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.

Supply the vertices around the perimeter so the edges do not cross.

Example

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)
Kawaii documentation