Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

addlabel()

Mammad900 edited this page Aug 28, 2020 · 1 revision

addlabel(page, X, Y, text, textcolor, font, texSizeX, textSizeY, enabled, visible )

Summary

Adds a label to the application user interface.

Parameters

  1. Page (int) : The number of the page which contains the new label
  2. X (unsigned int) : The X coordinate of the new label in pixels. You can use CENTER or RIGHT too.
  3. Y (unsigned int) : The Y coordinate of the new label in pixels. You can use CENTER or RIGHT too.
  4. text (String) : The new label's content
  5. textcolor (unsigned int) : A 16-bit number representing the text (foreground) color of the label
  6. font (const GFXfont*) : pointer to an Adafruit GFX font object. Use NULL for classic 5*8 font, or &<font name>
  7. textSizeX (byte) optional: Text X size to be used in tft.setTextSize(). It causes text to be blocky (because fonts are raster). If you don't want that, use a bigger font. Default: 1
  8. textSizeX (byte) optional: Text Y size to be used in tft.setTextSize(). It causes text to be blocky (because fonts are raster). If you don't want that, use a bigger font. Default: 1
  9. enabled (bool) optional: If false, the label is darkened. Default: true
  10. visible (bool) optional: If false, the label is hidden (not shown). Default: true

Returns

The index of the new label

Examples

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
Clone this wiki locally