DRAWING FUNCTIONS

DrawRect

Draws the outline of a rectangle.

Syntax

ONYX.DrawRect(x, y, w, h, r, g, b, a, thickness, rounding)

Parameters

  • x, y (number) — Top-left corner in pixels.
  • w, h (number) — Width and height in pixels.
  • r, g, b (number) — Colour; floats in [0,1] or integers in [0,255].
  • a (number (optional)) — Alpha; default 1.
  • thickness (number (optional)) — Border thickness; default 1.
  • rounding (number (optional)) — Corner rounding; default 0.

Return(s)

None

Behavior

  • Appends a rectangle outline to the build buffer.
  • Persists until the next SubmitFrame when auto-frame is enabled.

Example(s)

ONYX.BeginFrame()
ONYX.DrawRect(100, 100, 200, 60, 1, 1, 1, 1, 1, 8)
ONYX.SubmitFrame()