Closed zekageri closed 3 years ago
Have you set the background colour for the text to white, so thne the new text over-writes the old text?
Have you set the background colour for the text to white, so thne the new text over-writes the old text?
Oh. I thought the text background is default white and my screen background is filled with white default too. The text color is green.
The update function looks like this now:
static const inline void updateText(){
if(scrollableText != "" && !writing){
if(millis() - lastUpdateMs <= LAST_NOTY_DISP_TIME_MS){
tft.setTextColor(DKGREEN,WHITE);
tft.setTextWrap(false,false);
int minPos = scrollableText.length() * 18;
if(lastPos < -minPos){ lastPos = 160; tft.fillRect(1,92,158,45,WHITE);}
tft.setCursor(lastPos,93);
tft.setTextSize(3);
lastPos = lastPos - 3;
tft.print( scrollableText );
tft.setTextWrap(true,true);
}else if(!resetOnce){
resetOnce = true;
tft.fillRect(1,92,158,45,WHITE);
}
}
}
Hi!
I want to scroll any text ( its a notification text line on the screen ) while the screen is
tft.setRotation(3);
.I achived this with the following code:
The problem is that the text flickering because of this
tft.fillRect(1,92,157,45,WHITE);
line.How can i update the text without filling this rect with white background?