Solo Controller Documentation 1.0
Documentation for the Solo Controller
 
Loading...
Searching...
No Matches
DynamicText Class Reference

#include <TextBox.h>

Public Types

enum  TextAlign { LEFT , CENTER , RIGHT }
 Enumeration used to specify text alignment within the DynamicText. More...
 

Public Member Functions

 DynamicText (Canvas &DestCanvas, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t baseline, GrFont *Font, TextAlign align=CENTER)
 DynamicText Constructor.
 
virtual void begin (void)
 Initializes the DynamicText. This method must be called before using calling DynamicText::update()
 
virtual void align (TextAlign align)
 Changes the text alignment. Takes effect after next call to DynamicText::update()
 
void update (const char *text, uint16_t textBuffSize)
 Updates the text inside a DynamicText.
 
void update (int value)
 Updates the numerical value (int) inside a DynamicText.
 

Static Public Member Functions

static void initializeFonts (void)
 

Public Attributes

const uint16_t X
 UL x position of the text box within _DestCanvas.
 
const uint16_t Y
 UL y position of the text box within _DestCanvas.
 
const uint16_t WIDTH
 Width of the text box within _DestCanvas.
 
const uint16_t HEIGHT
 Height of the text box within _DestCanvas.
 

Member Enumeration Documentation

◆ TextAlign

Enumeration used to specify text alignment within the DynamicText.

Enumerator
LEFT 
CENTER 
RIGHT 

Constructor & Destructor Documentation

◆ DynamicText()

DynamicText::DynamicText ( Canvas & DestCanvas,
uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
uint16_t baseline,
GrFont * Font,
TextAlign align = CENTER )
inline

DynamicText Constructor.

Parameters
[in]DestCanvasCanvas that will 'display' the DynamicText
[in]xUL x-position of the DynamicText within Canvas
[in]yUL y-position of the DynamicText within Canvas
[in]widthWidth of the DynamicText in pixels
[in]heightHeight of the DynamicText in pixels
[in]baselinePosition of the font's baseline within the DynamicText
[in]FontGrFont object to be used
[in]alignAlignment of the text within the box. Defaults to DynamicText::CENTER.

Member Function Documentation

◆ align()

virtual void DynamicText::align ( TextAlign align)
inlinevirtual

Changes the text alignment. Takes effect after next call to DynamicText::update()

Parameters
[in]alignText alignment

◆ begin()

void DynamicText::begin ( void )
virtual

Initializes the DynamicText. This method must be called before using calling DynamicText::update()

Parameters
None.

◆ initializeFonts()

static void DynamicText::initializeFonts ( void )
static

◆ update() [1/2]

void DynamicText::update ( const char * text,
uint16_t textBuffSize )

Updates the text inside a DynamicText.

Parameters
[in]textNull-terminated character array containing the text
[in]textBuffSizeNumber of characters in text

◆ update() [2/2]

void DynamicText::update ( int value)

Updates the numerical value (int) inside a DynamicText.

Parameters
[in]valueValue to be written to DynamicText

Member Data Documentation

◆ HEIGHT

const uint16_t DynamicText::HEIGHT

Height of the text box within _DestCanvas.

◆ WIDTH

const uint16_t DynamicText::WIDTH

Width of the text box within _DestCanvas.

◆ X

const uint16_t DynamicText::X

UL x position of the text box within _DestCanvas.

◆ Y

const uint16_t DynamicText::Y

UL y position of the text box within _DestCanvas.


The documentation for this class was generated from the following files: