Loading textures during runtime from paths doesn't work after export

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By exuin

So, I’m making a character creator. I want the user to be able to pick a bunch of items to put on the character, and download their character once they’re done. It works fine when I run it from the editor, but when I export it (to HTML5), the images don’t appear.

What I’m doing is opening a folder in the res:// directory and looking for all images in that folder, and then loading them as textures on TextureRects. But it just doesn’t work. I don’t know why because no error messages are shown.

Also, I exported the project for Windows Desktop and the images don’t load there either. But when I save the image and generate a sprite sheet, the images are loaded from paths.

I really don’t know what’s going on here. Can I not search through a folder for all of its image files? If I can’t, what should I do instead?

Edit: I put all of the image names into an array and just looked through that instead, which worked. But is there a better way of doing this?

:bust_in_silhouette: Reply From: exuin

As it turns out, the imported image files are all stored in the .import folder and I can’t find them in the filesystem. But if I pass them through the load() function, it can still load them properly. I guess putting all of the image names into an array worked.