Graphics::drawRect

Description

void Graphics::drawRect( int16_t x , int16_t y , int16_t w , int16_t h )

Graphics::drawRect draws a rectangle (outline only!) from (x, y) with a certain width and height.

Parameters

  • int16_t x: x-coordinate of the rectangle
  • int16_t y: y-coordinate of the rectangle
  • int16_t w: width of the rectangle
  • int16_t h: height of the rectangle

Returns

none

Example

#include <Gamebuino-Meta.h>

void setup() {
  gb.begin();
}

void loop() {
  if (gb.update()) {
    gb.display.clear();

    // draw a yellow frame around the entire screen
    gb.display.setColor(YELLOW);
    gb.display.drawRect(0, 0, gb.display.width(), gb.display.height());
  }
}