I'm trying to programmatically load an
Image and create an
ImageTexture from it. I want to do this so that I can programmatically modify the pixel data of the
Image. Here's some sample code from my
var image_texture = ImageTexture.new()
image = Image.new()
self.texture = image_texture
This works fine when I run the game from the editor. However, I get a warning in the debugger that says "Loading resource as image file, this will not work on export." And thus, when I export to Android, these images are not loaded.
I do not want to use the
load() function (as suggested here), because that gives me a
StreamTexture and doesn't allow me to manipulate pixels.
I've found a few Github issues about this:
but none of them seem to provide solutions for this issue.
So - is there a good way to make this work for exported games?