I'm very new to this, so please forgive me if this is a very basic question with an obvious answer.
I would like to create an internal bitmap with 2176x1536 pixels where I would draw some stuff, using GDScript and could access in several nodes.
My first assumption was that I would have to create a CanvasLayer. But that is for display, right?
So, how could I create such a bitmap? I would like to be able to show it in the viewport also, for "debugging" purposes. But, mainly, I would like to be able to read and write into it, and have access to is from other nodes scripts.
Creating an internal bitmap
- Best Answerset by rui_mac
You can create an Image class in code, then use set_pixel() to draw to a particular pixel. To show the Image on the screen, you'll need to create a Texture initialized with the Image, then create a TextureRect and set the texture property to the Texture. The TextureRect can be in a Control node, such as a CanvasLayer so you can see it on the screen.
https://docs.godotengine.org/en/stable/classes/class_image.html
Thank you so much. I managed to have something working now.
Awesome! So glad it worked. Feel free to select as best answer so it can help other people. Cheers.