olikraus / U8g2_for_Adafruit_GFX

Add U8g2 fonts to any Adafruit GFX based graphics library.
Other
117 stars 35 forks source link

Scroll text #48

Closed yuan910715 closed 2 months ago

yuan910715 commented 2 months ago

Hi I use u8g2 for Adafruit and ESP32-HUB75-MatrixPanel-I2S-DMA to drive 2 HUB75 6464 LEDs I want to display a scroll text (I turned on the double_buff for smoother display)

const char *str="1234567890";
void loop() {
    int16_t width = u8g2->getUTF8Width(str);
     for(int i=0; i<width; i++){
        dma_display->clearScreen();    
        u8g2->drawUTF8(-i+64*2,58,str);
        dma_display->flipDMABuffer();
    }

}

it works well , but when I increase the length of str eg: const char *str="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"; The scrolling speed will become very slow, I guess in drawUTF8, even the part beyond the LED display range is still calculated ,is there any good solution?

Thank you very much!!