Yuari
Documentation
Docs/DrawingImmediate/DrawingImmediate.Rectangle

DrawingImmediate.Rectangle

Draws rectangles.

Syntax

DrawingImmediate.Rectangle(pos: Vector2, size: any, color: Color3, filled?: any, thickness?: number, rounding?: any) -> nil

Parameters

ParameterTypeDescription
posVector2The pos value used by the call.
sizeanyThe size of the object or buffer.
colorColor3The color value used by the call.
filled?anyThe filled value used by the call.
thickness?numberThe thickness value used by the call.
rounding?anyThe rounding value used by the call.

Returns

TypeDescription
nilThis function does not return a value.

Description

DrawingImmediate.Rectangle is part of the DrawingImmediate library. Immediate drawing runs inside a paint callback registered with DrawingImmediate.GetPaint(); primitives are emitted for the current frame only.

The operation is performed immediately using the arguments supplied at the call site.

The aliases FilledRectangle(pos, size, color, rounding?) resolve to the same implementation.

Example

-- inside a DrawingImmediate.GetPaint():Connect callback
DrawingImmediate.Rectangle(Vector2.new(20, 20), Vector2.new(120, 60), Color3.new(1, 1, 0), false, 2, 6)
DrawingImmediate.FilledRectangle(Vector2.new(160, 20), Vector2.new(120, 60), Color3.new(0, 1, 1), 6)

Notes

  • Aliases: FilledRectangle(pos, size, color, rounding?).
  • Draw calls must run inside a callback registered with DrawingImmediate.GetPaint().