DrawingImmediate.Rectangle
Draws rectangles.
Syntax
DrawingImmediate.Rectangle(pos: Vector2, size: any, color: Color3, filled?: any, thickness?: number, rounding?: any) -> nil
Parameters
| Parameter | Type | Description |
|---|---|---|
pos | Vector2 | The pos value used by the call. |
size | any | The size of the object or buffer. |
color | Color3 | The color value used by the call. |
filled? | any | The filled value used by the call. |
thickness? | number | The thickness value used by the call. |
rounding? | any | The rounding value used by the call. |
Returns
| Type | Description |
|---|---|
nil | This 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().