drawRect method

void drawRect(
  1. int x,
  2. int y,
  3. int w,
  4. int h,
  5. bool color,
)

Draw an outlined rectangle

Implementation

void drawRect(int x, int y, int w, int h, bool color) {
  // top
  drawLine(x, y, x + w, y, color);

  // left
  drawLine(x, y + 1, x, y + h - 1, color);

  // right
  drawLine(x + w, y + 1, x + w, y + h - 1, color);

  // bottom
  drawLine(x, y + h - 1, x + w, y + h - 1, color);
}