rdagger / micropython-ssd1351

MicroPython SSD1351 OLED Display Driver
MIT License
58 stars 13 forks source link

Transparent text background? #4

Closed lorhof1 closed 3 years ago

lorhof1 commented 3 years ago

Hello, is it possible to keep the pixels that are where the text background is?

rdagger commented 3 years ago

I added a transparent parameter to the draw_text method to provide transparent backgrounds. Unfortunately, it is a bit slow compared to the regular drawing method. You can always specify the background color when drawing fonts which is faster.

I also added a method draw_text8x8 which uses the built-in MicroPython 8x8 font. It doesn't support transparent backgrounds, but it uses frame buffers which you could modify to insert your own graphics behind the text.

I also cleaned up landscaping drawing to be clockwise on the origin.

rdagger commented 3 years ago

There are 2 new demos for the new features.

lorhof1 commented 3 years ago

thanks