There is a good recent thread talking about flicker and the like that @ptillisch posted some good information in a response:
But assuming you are using Adafruit GFX and the system font, what you probably
are wanting to do is use opaque text output.
You set that up on the setTextColor line, with a second color, which is used when
the font character you are outputting does not set that pixel on.
Something like: display.setTextColor(RED, BLACK);
Assuming you background is BLACK...
Note: If your new output text is shorter than the previous output, this will not overwrite
the characters at the end. There are several possible ways to do this, like
simply output some additional blank characters. I would try this first!
Another approach is to use a fillRect with the background color to fill in the rest, warning typing on fly so maybe typos or names of functions wrong.
display.print("WiFi Not Connected");
int x = tft.getCursorX();
tft.fllRect(x, <Y start>, <width to fill>, <height to fill>, BLACK);
Some of these fields you may need to play with,
like I would start at your 420
Width: if nothing else displayed in same line, could be: display.width() - x;
HEIGHT: I think fonts are 6x8? you are using size 3, so probably try 24...
Alternatively, you could use getTextBounds to compute this:
void getTextBounds(const char *string, int16_t x, int16_t y, int16_t *x1,
int16_t *y1, uint16_t *w, uint16_t *h);
You can ask for the bounds of strings you output and if the width of the
last one you output is smaller than the width of the previous one, you could
fillRect the difference. Hope that makes sense.
Good luck