Unicorn hat HD - how to write to the buffer


To achieve scrolling displays on my unicorn hat, I manipulate the display buffers:

Buffer = unicorn.get_pixels()
…do stuff…

Now I am porting my code to a unicornHD, but there does not seem to be a set_pixels() command.
Am I misreading things? Is there a better way to do this?


I think the way to do it would be to write directly to the buffer with:

unicornhathd._buf[x][y] = r, g, b

You can see the way the set_pixel method does it internally here.


Ok thanks. I’ll give that a try. I was just used to reading the buffer as a whole, then writing at a whole. Not sure why the HD is different. Maybe I am the only one doing crazy stuff with it.