printToSprite query #3095
Unanswered
NYFB8888
asked this question in
Q&A - General
Replies: 1 comment
-
No, this is due to the way the print stream sends the string character by character. Instead use setTextDatum, setTextPadding and drawString functions. These are used in some of the examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use the printToSprite function, but it doesn't work as I would like.
I used the following code to test the function
for (int i = 0; i <= 10; i++) {
tft.setCursor(0, 0);
spr.setTextColor(TFT_WHITE, TFT_BLUE);
//spr.printToSprite(String(i)); //shows nothing but blue background
//spr.printToSprite(" "+String(i)); //A) shows only 1 and 4 on a blue background
//spr.printToSprite("0"+String(i)); //B) shows 01 02 etc. on a blue background
spr.printToSprite(" "+String(i)+" "); //C) shows 1 2 3 with spaces after and before digit
delay(500);
}
Question is possible to print a digit without any space prefix and suffix?
Beta Was this translation helpful? Give feedback.
All reactions