M5.Lcd.printf writes over previous print



  • I wanted to do something I thought was simple.

          M5.Lcd.setTextSize(2);
          M5.Lcd.setTextColor(ORANGE);
    
          for(int x=0; x < 100;x++)
          {
            M5.lcd.setCursor(240,165);
            M5.Lcd.print(x);
          }
    

    Yet, when it prints to the LCD they just overlap to the point where its all just a blob. I have tried M5.Lcd.printf, M5.Lcd.print, M5.Lcd.drawNumber, and M5.Lcd.drawString and they all do the same thing.
    I.E. it does not clear the pixels to the background color that are not part of what being drawn.
    My next though was that i needed to use fillRect inbetween prints, but that seems like a waste of cpu time to do that.
    Would it not be better to have an extra option for all these to set non used pixels to a background color when it prints?
    I.E. drawString(const char *string, int32_t poX, int32_t poY, , uint16_t color);

    OR, is there another way that I am just not seeing.