Home  Contents

gcx:box

Graphics Core4 Lua Commands

SYNOPSIS

  1. gcx:box(x, y, w, h [, rgb])
  2. gcx:box(rect [, rgb])
  3. gcx:fill(x, y, w, h [, rgb])
  4. gcx:fill(rect [, rgb])

DESCRIPTION

Draws a rectangle at x, y of size w, h using the specified color rgb. If color is not given, uses the stored foreground color.

The function gcx:box draws an outline of one pixel, while gcx:fill fills the whole rectangle.

ERRORS

Raises an error if gcx is not a graphics context.

EXAMPLE

Fills a yellow box:
gcx:fill(gcx:width()/3, gcx:height()/3, gcx:width()/2, gcx:height()/2, 0xFFFF00)

SEE ALSO