- Edited
Hi, I'm using the Image class for manipulation of ImageTexture, and the result is really hard to understand. Specifically:
- This is my code initiating the TextureRect node with an ImageTexture
var canvas = $SubViewport/Canvas # TextureRect Node to a white
var overlay = $SubViewport/OverlayLayer/Overlay # Overlay is also a TextureRect layered on top
og = Image.create(canvas.get_size().x, canvas.get_size().y, false, Image.FORMAT_RGBA8)
overlay.set_texture(ImageTexture.create_from_image(og)) - This is the code for turning pixel (1,1) red
og.set_pixelv(Vector2(1, 1), Color.RED)
overlay.get_texture().update(og) - This is somehow the result I got:
I really don't understand why I got this, I really need someone to point out where I got it wrong.
Also, I'm on Godot 4.0.3. There is no tutorial on using this Image class that I could find useful, and the docs for it even have 1 method needing description.