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() { while(!gb.update()); gb.display.clear(); gb.lights.clear();

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

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