Texture of sprites and texturerects won't load in android

try to save it as a raw Image type, problem will be you dont drag and drop this kind of image import type to scene, it will bloat your scene size.

here is the snippet how to load it from code:

var raw_image=load("res://assets/images/raw_image.jpg")
var raw_image_texture= ImageTexture.create_from_image(raw_image_texture)
texture_rect.texture=raw_image_texture

what i meant by raw Image type:
image

if you do the above, you should be able to load image from res://

the explanation for this why this work, why the normal Texture2D doesnt work is because Texture2D in res:// is converted to compressed mode and saved in .import folder. the original Texture2D wont get exported on builds

1 Like