hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.64k stars 1.16k forks source link

Displaying several elements at once, at the end of a loop #647

Open danielhdzzz opened 6 years ago

danielhdzzz commented 6 years ago

I'm currently trying to display an image (animated) as a background, and setting text on top of it. My code looks like this:

while running_intro:
    matrix.SetImage(frames_menu1[0], 0, 0)
    graphics.DrawText(matrix, fontS, 2, 10, white, "text")

I assumed that for each iteration of the while loop, it would define every pixel in the matrix and then update it. But it seems that it first sets the image, and immediately after sets the text. This results in the display showing only the image for a fraction of a second, so the text is "blinking" constantly. Is there any way around this? A way of defining what's going to be displayed on-screen and only afterwards displaying everything at once?

Here's a video of how it looks now. I slowed it down a lot to make it clearer

Thanks!

angelogoncalve commented 6 years ago

see the examples in https://github.com/BNNorman/rpi-rgb-led-matrix-animator