russhughes / st7789py_mpy

Driver for 320x240, 240x240, 135x240 and 128x128 ST7789 displays written in MicroPython
MIT License
142 stars 57 forks source link

Transparency when displaying bitmaps #12

Closed sassysquatchy closed 4 months ago

sassysquatchy commented 4 months ago

Hello Russ. Thank you so much for providing this library. It has helped me learn a lot and improve several projects

I am currently currently displaying sprites with bitmaps similar to the toaster example, but I am struggling to figure out how to make the bitmap backgrounds transparent so I can layer sprites over a background or one another. I am familiar with doing this by blitting using framebuffer with a key and palette from Tony Goodhew's ST7735 driver, but I am having issues implementing something similar here.

I see that the Framebuffer module/class is mentioned several times throughout the comments, but I don't actually see the class used anywhere. I also see that blitting is mentioned in in the names of functions like blit_buffer, but I do not see anything in the code that I recognize as the framebuffer blit function. I feel like I'm overlooking something, but I'm not sure what.

If you have any suggestions or guidance, it would be greatly appreciated. Thanks again!

russhughes commented 4 months ago

The driver does not support transparency or use a full display framebuffer or the Framebuffer class. The blit_buffer method transfers the given buffer to the display overwriting it.

sassysquatchy commented 4 months ago

Thank you so much for the quick reply! I'll start exploring alternatives