Character Drawing - TBTerra/pictor GitHub Wiki

Draw Character Functions

The functions used for drawing text, these functions require a font to be included in order to be used.


Commands

void pictorDrawC(const unsigned char Char, const point Pos, const uint16_t ForegroundColour, const uint16_t BackgroundColour, const font * Font, uint8_t scale);

Draws a character onto the screen at the specified position with a set font, and foreground and background colours.

Parameters:

  1. Char - Character to be written to the screen.
  2. Pos - Point structure to the top-left corner of the character's intended location.
  3. ForegroundColour - Colour of the character as a 656-RGB encoded colour.
  4. BackgroundColour - Colour of the background as a 656-RGB encoded colour.
  5. Font - Pointer to the font array to be used for the character.
  6. scale - Integer character size scale (Note: a scale of 1 gives a character 8 pixels tall by 8 pixels wide).

uint8_t pictorDrawS(const unsigned char * Buffer, point Pos, const uint16_t ForegroundColour, const uint16_t BackgroundColour, const font * Font, uint8_t scale);

Draws a string onto the screen at the specified position with a set font, and foreground and background colours.

Parameters:

  1. Buffer - String to be written to the screen.
  2. Pos - Point structure to the top-left corner of the characters' intended location.
  3. ForegroundColour - Colour of the characters as a 656-RGB encoded colour.
  4. BackgroundColour - Colour of the background as a 656-RGB encoded colour.
  5. Font - Pointer to the font array to be used for the characters.
  6. scale - Integer character size scale (Note: a scale of 1 gives a character 8 pixels tall by 8 pixels wide).

Return Value:

  • Number of characters written to the screen.

uint8_t pictorDrawSP(const unsigned char * Buffer, point Pos, const uint16_t ForegroundColour, const uint16_t BackgroundColour, const font * Font, uint8_t scale);

Draws a string from program memory onto the screen at the specified position with a set font, and foreground and background colours.

Parameters:

  1. Buffer - String to be written to the screen.
  2. Pos - Point structure to the top-left corner of the characters' intended location.
  3. ForegroundColour - Colour of the characters as a 656-RGB encoded colour.
  4. BackgroundColour - Colour of the background as a 656-RGB encoded colour.
  5. Font - Pointer to the font array to be used for the characters.
  6. scale - Integer character size scale (Note: a scale of 1 gives a character 8 pixels tall by 8 pixels wide).

Return Value:

  • Number of characters written to the screen.
⚠️ **GitHub.com Fallback** ⚠️