/// \file PinballGame/MatrixGraphics.cpp

/// \brief Real-time graphics functions for a HT1632 monochrome LED matrix.

/// \copyright No copyright, 2016-2017, Garth Zeglin.  This file is explicitly placed in the public domain.

/// \details This is a collection of functions compiled with the main pinball
/// game code.  Since only one LED matrix is supported, these are all global
/// functions with global state.

#include "Arduino.h"
#include "Adafruit_GFX.h"
#include "Adafruit_HT1632.h"
#include "MatrixGraphics.h"

// The 'matrix' object is declared in the main file.
extern Adafruit_HT1632LEDMatrix matrix;
  
void matrix_show_score(unsigned long points)
{
  matrix.clearScreen();
  // draw some text!
  matrix.setTextSize(1 * .5);  // size 1 == 8 pixels high
  matrix.setTextColor(1);   // 'lit' LEDs
  matrix.setTextWrap(false);
  matrix.setCursor(5, 4);// start at top left, with one pixel of spacing
  matrix.print(points);
  matrix.writeScreen();
}
