Centre Text #1978
-
How can i print a word in the centre of my display? ive tried using the string align example but still cant figure it out |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Use the function setTextDATUM() with MC_DATUM which means middle centre. |
Beta Was this translation helpful? Give feedback.
-
How do I print something Top Centre and 15px from top? |
Beta Was this translation helpful? Give feedback.
-
tft.setTextDatum(TC_DATUM); |
Beta Was this translation helpful? Give feedback.
-
The print stream cannot be used with text formatting for technical reasons. Use drawString():
|
Beta Was this translation helpful? Give feedback.
-
thanks guys, fixed my last problem centering a number with: |
Beta Was this translation helpful? Give feedback.
-
What if the text is wrapping? I need to center the new line too. Instead of this
I need something like this
Any idea? If i do it like this tft.setTextWrap(true,true);
tft.setCursor(20,90);
tft.print("This is a centered text"); It will wrap and the new line begins at the beginning of the display. I have tried scrolling but the task does not get enough time so the scrolling is lagging sometimes. ( I don't want to increase the priority just for that ) |
Beta Was this translation helpful? Give feedback.
-
I also have this setup
The rectangle is an icon. If the first text wraps, it will start inside the icon. How could I prevent that? Worst case
Good case
|
Beta Was this translation helpful? Give feedback.
The print stream cannot be used with text formatting for technical reasons. Use drawString():