lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
377 stars 52 forks source link

Scroll text #63

Closed tomudo closed 2 years ago

tomudo commented 3 years ago

Scroll text feature. I tried to write code for scroll text by use printFixed( x_pos, y_pos, "text", any_style); but when I scroll to right by increase x_pos beyond edge of screen. The text is mess up by jumping to next line. I want a solution to scroll text to right or left for text longer than screen.

lexus2k commented 3 years ago

Hi.

Can you provide the code to demonstrate the issue?

PS. Direct API doesn't support cropping at all. For that, you need to use canvas and double buffering

tomudo commented 3 years ago

My code looks like this.

void scrollText(){ for(int i=0;i<160;i++){ display.printFixed(i , 32, "Hello world", STYLE_NORMAL); } }

I will look into using canvas technic. Thank you.

lexus2k commented 3 years ago

If you're not limited in memory, you can create NanoCanvas<128,64,1>. It needs only 1024 bytes of RAM. Please make sure that canvas property CANVAS_TEXT_WRAP_LOCAL is disabled.