JohnRob:
add spaces to the end of each line text
Over write each line with spaces before writing the target line
write a filled rectangle before writing the target line.
Using the following format for setTextColor() may make these processes unnecessary.
/***************************************************************************************
** Function name: setTextColor
** Description: Set the font foreground and background colour
***************************************************************************************/
// Smooth fonts use the background colour for anti-aliasing and by default the
// background is not filled. If bgfill = true, then a smooth font background fill will
// be used.
void TFT_eSPI::setTextColor(uint16_t c, uint16_t b, bool bgfill)
However, if the string to be overwritten becomes shorter, the characters before the overwrite will remain, so you will need to use a formatted string or add spaces to the end.
Although it is not a perfect example, please refer to the following example:
/*
Font draw speed and flicker test, draws all numbers 0-999 in each font
Average time in milliseconds to draw is shown in red
A total of 2890 characters are drawn in each font
Needs fonts 2, 4, 6, 7 and 8
Make sure all the display driver and pin connections are correct by
editing the User_Setup.h file in the TFT_eSPI library folder.
#########################################################################
###### DON'T FORGET TO UPDATE THE User_Setup.h FILE IN THE LIBRARY ######
#########################################################################
*/
#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
このファイルは切り詰められています。 オリジナルを表示