DRAWING FUNCTIONS

PushClipRect

Restricts drawing to the given rectangle until popped.

Syntax

ONYX.PushClipRect(x, y, w, h, intersect)

Parameters

  • x, y (number) — Top-left corner of the clipping rectangle.
  • w, h (number) — Width and height of the clipping rectangle.
  • intersect (boolean (optional)) — When true (default) intersects with the current clip rect.

Return(s)

None

Behavior

  • All subsequent draw commands are clipped to the rectangle until PopClipRect is called.
  • Clip rectangles can be nested and must be paired.

Example(s)

ONYX.PushClipRect(100, 100, 200, 120)
ONYX.DrawRectFilled(50, 50, 400, 400, 0, 0, 0, 0.3)
ONYX.PopClipRect()