Number Drawing - TBTerra/pictor GitHub Wiki
The functions used for drawing numbers as decimal & hexadecimal digits, these functions require a font to be included in order to be used.
void pictorDrawD(const int16_t Number, const point Pos, const uint16_t ForegroundColour, const uint16_t BackgroundColour, const font * Font, uint8_t scale, uint8_t len);
Draws a number in decimal onto the screen at the specified position with a set font, and foreground and background colours. The number is padded to fill the specified length using spaces, use a length of 0 to ignore padding.
Parameters:
-
Number
- Number to be written to the screen. -
Pos
- Point structure to the top-left corner of the first character's intended location. - `ForegroundColour - Colour of the characters as a 656-RGB encoded colour.
- `BackgroundColour - Colour of the background as a 656-RGB encoded colour.
-
Font
- Pointer to the font array to be used for the characters. -
scale
- Integer character size scale (Note: a scale of 1 gives a character 8 pixels tall by 8 pixels wide). -
len
- Output width padded with spaces, the value is not truncated even if the result is larger than the length specified. To remove padding use the value 0.
uint8_t pictorDrawX(const uint8_t Value, const point Pos, const uint16_t ForegroundColour, const uint16_t BackgroundColour, const font * Font, uint8_t scale);
Draws a value in hexadecimal onto the screen at the specified position with a set font, and foreground and background colours.
Parameters:
-
Value
- 8-bit value to be written to the screen. -
Pos
- Point structure to the top-left corner of the first character's intended location. -
ForegroundColour
- Colour of the characters as a 656-RGB encoded colour. -
BackgroundColour
- Colour of the background as a 656-RGB encoded colour. -
Font
- Pointer to the font array to be used for the characters. -
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.