Graphics::drawPixel

Description

void Graphics::drawPixel( int16_t x , int16_t y [, Color | ColorIndex color ] )

Graphics::drawPixel will draw a pixel to the display/light/image, at x/y coordinates and with a certain color. If no color specified whatever is set via Graphics::setColor is used.

Parameters

  • int16_t x: x-coordinate of the pixel to set
  • int16_t y: y-coordinate of the pixel to set
  • Color | ColorIndex color (optional): color of the pixel to set

Returns

none

Example

#include <Gamebuino-Meta.h>

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

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

    // turn only the top-left pixel of the lights read
    gb.light.drawPixel(0, 0, RED);

    // set a pixel of the display green
    gb.display.setColor(GREEN);
    gb.display.drawPixel(42, 42);
  }
}