Topic was automatically imported from the old Question2Answer platform.
Asked By
Maxpilot
Want to achieve something like a photo album, showing pictures not in the assets folder, but elsewhere on the HD of a user. Loading a texture directly with:
gives an Error like “No loader found” if say a “.png” file is outside the asset folder. I can load this “external” file into an Image object without error, but I found no way to convert this Image to a texture and assign that texture, like so:
func _on_Button_pressed():
var imgFile = "F:/pictures/" + fileList[imgNumber]
imgNumber += 1
var img = Image.new()
img.load(imgFile)
get_node("../TextureRect").texture.set_data(img)
Before I set the texture of the “TextureRect” to an “ImageTexture” with size 640 x 360. With this there always is an error like: