DRAWING FUNCTIONS

DrawLine

Draws a line between two points.

Syntax

ONYX.DrawLine(x1, y1, x2, y2, r, g, b, a, thickness)

Parameters

  • x1, y1 (number) — Start position in pixels.
  • x2, y2 (number) — End position in pixels.
  • r, g, b (number) — Colour in [0, 1].
  • a (number (optional)) — Alpha; default 1.
  • thickness (number) — Line thickness in pixels.

Return(s)

None

Behavior

  • Appends a line command to the build buffer.
  • Not rendered until SubmitFrame is called.

Example(s)

ONYX.BeginFrame()
ONYX.DrawLine(100, 100, 300, 200, 1, 1, 1, 1, 2)
ONYX.SubmitFrame()