General area when it fits no where else

Moderator: Mmiscool

User avatar
By Ecoli-557
#55731 Anyone else out there working with these TFT screens?
I am printing to the screen as in my button/TFT demo, however, I want to clear just one line of code.
CLS and re-painting the screen takes too long.
Anyone out there have any tricks, pointers, guesses?
Regards.
User avatar
By Ecoli-557
#55839 OK, have a crude solution so I thought I would share it. If you have a menu as in my TFT and button demo AND you want to erase just one line, you 1st need to have those areas in which you want to erase to be a tft.obj.label.
Then, you simply 'paint' a label with the foreground and the background the same color as your menu background right before you update the label.
An example:
Code: Select alllabel1=tft.obj.label("                   ",5,300,225,20,2, tft.rgb(0,0,0), tft.rgb(0,0,0))
tft.text.color(tft.rgb(0,255,255))
tft.text.cursor(5,300)
tft.print("Temp:" & degreesF & " Hum:" & humidity)

This will paint a black label area at the bottom of the TFT screen, then, it will write the values for temperature and humidity.
This works fairly well and you don't have to waste all the time repainting the screen.
Hope this helps someone else.
Regards.