KurtE / ILI9341_t3n

Extended ILI9341_T3 library (Teensy) including all SPI buses, Frame buffer, plus
MIT License
50 stars 23 forks source link

Center text like RA8875 #23

Closed KurtE closed 4 years ago

KurtE commented 4 years ago

Added support to the member method setCursor to optionally be able to tell system to center the text horizontally and/or vertically at the position passed in or the center of the screen.

That is:

tft.setCursor(100, 100, true);
tft.print("Center");

Will center the text "center" at location 100, 100

Also have ability to set X and or Y to be centered at center of screen.

tft.setCursor(ILI9341_t3n::CENTER, 100);
tft.print("zzz");

Will print zzz starting at y location 100 with the text centered horzontally .

And similar for:

tft.setCursor(100, ILI9341_t3n::CENTER);
tft.print("yyy");

Where again yyy is printed with the text centered vertically on screen start at x 100...