1 | | = DisplayText = |
| 1 | == DisplayText == |
| 2 | Prints text on the LCD screen at the specified position using a specified length, font, and display logic. |
| 3 | |
| 4 | {{{ |
| 5 | void DisplayText(int x, int y, const char* pszText, int len = 0, font825 font = STD_FONT, int dsplogic = DSP_LOGIC_OVERWRITE); |
| 6 | |
| 7 | void DisplayText(int x, int y, const std::string& strText, int len = 0, font825 font = STD_FONT, int dsplogic = DSP_LOGIC_OVERWRITE); |
| 8 | }}} |
| 9 | |
| 10 | === Parameters === |
| 11 | |
| 12 | * x - X coordinate (0 - 639) |
| 13 | * y - Y coordinate (0 - 479) |
| 14 | * pszText - character array pointer such as string literal "Hello World" |
| 15 | * strText - const string reference |
| 16 | * len - length of character to pad (fill with spaces) or truncate the output, zero for variable length. |
| 17 | * font - font STD_FONT, BIG_FONT, BTN_FONT, or custom font number. |
| 18 | * dsplogic - DSP_LOGIC_OVERWRITE, DSP_LOGIC_SET, DSP_LOGIC_XOR, or DSP_LOGIC_RESET |
| 19 | |
| 20 | === Return Value === |
| 21 | |
| 22 | * void - does not return any value |
| 23 | |
| 24 | === Remarks === |
| 25 | * The function can be used as a shortcut to combine some string formatting operations, locating, and printing into a single function. |
| 26 | |
| 27 | === Examples === |
| 28 | |
| 29 | {{{ |
| 30 | DisplayText(10, 10, "Hello World"); |
| 31 | }}} |
| 32 | This example is equivalent to ''LocateLCD(10, 10);'' followed by ''PrintLCD("Hello World");'' |
| 33 | {{{ |
| 34 | string strText = "1234567890"; |
| 35 | DisplayText(0, 10, strText, 5); |
| 36 | |
| 37 | string strText2 = "123"; |
| 38 | DisplayText(0, 40, strText2, 10, BIG_FONT); |
| 39 | }}} |
| 40 | The first display will truncate the string to output "12345". The second display will pad the string to output "123 " and use the large font. |
| 41 | |
| 42 | === See Also === |
| 43 | |
| 44 | * LocateLCD |
| 45 | * PrintLCD |