godot: Mono: Image.Load() doesn't recognize res:// outside of editor
Godot version: 3.0.6
OS/device including version: Windows 10
Issue description:
Image.Load
won’t accepted res:// path’s in exported projects, but works fine in editor. I was told image.load() wasn’t meant for res:// paths (which doesn’t make logical sense), so I’m assuming this method is broken or doesn’t explicitly state its correct usage in the method name.
Steps to reproduce:
- Create an asset
- Try loading it using
var image = new Image();
image.Load($"res://pathtoasset");
- Create an image texture
var imageTexture = new ImageTexture();
imageTexture.CreateFromImage(image, (int) Texture.FlagsEnum.Mipmaps);
- Add it to the scene
- Run scene to make sure it outputs
- Export project and watch the image not print to the screen because it can’t find the .png path
Minimal reproduction project: Will create one after ludum dare 42
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (21 by maintainers)
Yes, those functions should be removed, they are confusing and error prone
On Mon, Aug 13, 2018, 21:11 PetePete1984 notifications@github.com wrote:
Please don’t remove Image.load, or you will piss off everyone loading non-resource images dynamically in their games and tools 😕
Use GD.Load and import the file as an image. Should probably unbind that and other functions, as it confuses users.
On Mon, Aug 13, 2018, 18:32 PetePete1984 notifications@github.com wrote: