draw.drawBox

Section: Draw (immediate mode)

What it does

draw.drawBox draws Box on a draw object. It takes x, y, x2, y2, r, g, b, r2, g2, b2 and filled. r2, g2, b2 and filled are optional.

Signature

draw.drawBox(x, y, x2, y2, r, g, b, r2?, g2?, b2?, filled?)

Arguments

  • x
  • y
  • x2
  • y2
  • r
  • g
  • b
  • r2optional
  • g2optional
  • b2optional
  • filledoptional

Example · generated

function start() {  draw.drawBox(100, 120, 100, 120, 1, 0.8, 0.4);}

draw.drawBox is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.

8 members in draw