wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Display/DisplayText

DisplayText

Displays text on the LCD screen at the specified position using a specified length, font, and display logic.

void DisplayText(int x, int y, const string& strText, int len = 0, font825 font = STD_FONT, int dsplogic = DSP_LOGIC_OVERWRITE);

void DisplayText(int x, int y, const char* pszText, int len = 0, font825 font = STD_FONT, int dsplogic = DSP_LOGIC_OVERWRITE);

Parameters

  • x - X coordinate (0 - 639)
  • y - Y coordinate (0 - 479)
  • strText - string to display
  • pszText - pointer to character array to display such as literal "Hello World"
  • len - length of character to pad (fill with spaces) or truncate the output, zero for variable length.
  • font - font STD_FONT, BIG_FONT, BTN_FONT, or custom font number.
  • dsplogic - DSP_LOGIC_OVERWRITE, DSP_LOGIC_SET, DSP_LOGIC_XOR, or DSP_LOGIC_RESET

Return Value

  • void - does not return any value

Remarks

  • The function can be used as a shortcut to combine some string formatting operations, locating, and printing into a single function.

Examples

DisplayText(10, 10, "Hello World");

This example is equivalent to LocateLCD(10, 10); followed by PrintLCD("Hello World");

string strText = "1234567890";
DisplayText(0, 10, strText, 5);

string strText2 = "123";
DisplayText(0, 40, strText2, 10, BIG_FONT);

The first display will truncate the string to output "12345". The second display will pad the string to output "123-------" ('-' is used to show the spaces) and use the large font.

See Also

Last modified 7 years ago Last modified on 04/19/18 07:11:17
Note: See TracWiki for help on using the wiki.