|Topic was automatically imported from the old Question2Answer platform.
I am currently trying to implement a system where the user can easily create and use their own custom sprites for my game, I.E. they can drag and drop their own folder with a particular set of images with particular names and have that appear in the game.
I initially just tried to load each of the images the user provided for the sprite using the plain old “load” function. This didn’t work, presumably because the user provided images aren’t properly imported into godot.
I fiddled around with the code a little bit and then tried the following method:
var imageImport = Image.new()
var animationImageTexture = ImageTexture.new()
# Adding the frame to our animation at the correct location
This worked, and I tested it on a fresh machine, and I was able to provide custom user sprites on the new computer and it worked like a charm. However, allowing the user to provide their own sprite images caused a lot of nearly identical warnings to appear in the debugger. This is an example of a warning I received:
load: Loaded resource as image file, this will not work on export: 'res://Packages/Default/Player/Graphics/legs/default/0.png'. Instead, import the image file as an Image resource and load it normally as a resource.
<C++ Source> core/image.cpp:1890 @ load()
<Stack Trace> WarSprite.gd:87 @ loadAnimation()
WarSprite.gd:57 @ loadAnimations()
WarSprite.gd:37 @ init()
Actor.gd:9 @ init()
Player.gd:9 @ init()
WarScene.gd:21 @ init()
TestScene.gd:20 @ _ready()
This is concerning to me both in that I may have done something wrong that will cause issues for me down the line and because the debug warning messages cause a notable slow down (about 7-8 seconds) in the startup time of the game in the editor. Outside of the editor it is fine.
Does anyone know if I’m doing something harmful here, if there is another, better way I could accomplish what I want to accomplishment, and finally, if what I’m doing is the best way to do this, does anyone know if I can suppress these warnings?