This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
addlabel()
Mammad900 edited this page Aug 28, 2020
·
1 revision
Adds a label to the application user interface.
- Page (
int
) : The number of the page which contains the new label - X (
unsigned int
) : The X coordinate of the new label in pixels. You can useCENTER
orRIGHT
too. - Y (
unsigned int
) : The Y coordinate of the new label in pixels. You can useCENTER
orRIGHT
too. - text (
String
) : The new label's content - textcolor (
unsigned int
) : A 16-bit number representing the text (foreground) color of the label - font (
const GFXfont*
) : pointer to an Adafruit GFX font object. UseNULL
for classic 5*8 font, or&<font name>
- textSizeX (
byte
) optional: Text X size to be used intft.setTextSize()
. It causes text to be blocky (because fonts are raster). If you don't want that, use a bigger font. Default:1
- textSizeX (
byte
) optional: Text Y size to be used intft.setTextSize()
. It causes text to be blocky (because fonts are raster). If you don't want that, use a bigger font. Default:1
- enabled (
bool
) optional: Iffalse
, the label is darkened. Default:true
- visible (
bool
) optional: Iffalse
, the label is hidden (not shown). Default:true
The index of the new label
addButton(PAGE_MAIN,CENTER,0,"Welcome",TFT_WHITE); // A white 'Welcome' in top center of the page with classic font
addButton(PAGE_MAIN,CENTER,CENTER,"Loading...",TFT_BLACK,&FreeBigFont); // A black 'Loading...' in the middle of the page with a big font