4 ms·
I wanted to make something that used pixel drawing in Godot and ended up creating a Image, manipulating the pixels of the image then copying the image to a text
by richardjam73 3y ago
I wanted to make something that used pixel drawing in Godot and ended up creating a Image, manipulating the pixels of the image then copying the image to a texture and setting a sprite2d to that texture.
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)