by genewitch · 3y ago · 0 comments
I have a mighty need for something that can quickly render frames of arbitrary pixels. Ideally a line at a time for smoothness. I also had this working - kinda - in pygame, but after 2.5 screens worth of lines being drawn it gives up.
Looking at the godot documentation, it would be nice to see something non-trivial and arbitrary expressed as code.
[0] https://www.fullscreensavers.com/sea-raindrops-screensaver/
Dependent on the complexity of your application and how comfortable you are working in C++, you could give CImg [1] a go. I've used it for a handful of projects with a similar requirement. It can be lightning quick, but a pain to get started with.
img = Image.create(width, height, false, Image.FORMAT_RGBA8)
img.set_pixel(x, y, col)
tex: ImageTexture = ImageTexture.create_from_image(img)
spr.set_texture(tex)