You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unclear when I would use the type_hint parameter to ResourceLoader.load. The current text only explains how:
An optional type_hint can be used to further specify the Resource type that should be handled by the ResourceFormatLoader. Anything that inherits from Resource can be used as a type hint, for example Image.
From #1258 (comment) it sounds like I need it to resolve resolution when the loader is ambiguous:
I think type hint is used when there are file collisions for the extension format. Like obj or bin, programmer might add multiple loaders which means that godot will be confused which ever works. Having a hint would help godot choose the correct loader.
From that I assume that I otherwise don't need to pass it and there's no benefits to passing it?
I wrote a test to try importing a bunch of types of files:
GDScript has a simplified @GDScript.load built-in method which can be used in most situations, leaving the use of ResourceLoader for more advanced scenarios.
So I suspect this type_hint is intended for loading files from the user's disk and not from within a godot project (where you should use load()).
Possibly the string could be:
An optional type_hint can be used to indicate which ResourceFormatLoader to use when loading files outside a Godot project and the file type has multiple loaders. Anything that inherits from Resource can be used as a type hint, for example Image.
Your Godot version: 4.3
Issue description:
It's unclear when I would use the
type_hint
parameter toResourceLoader.load
. The current text only explains how:From
#1258 (comment) it sounds like I need it to resolve resolution when the loader is ambiguous:
From that I assume that I otherwise don't need to pass it and there's no benefits to passing it?
I wrote a test to try importing a bunch of types of files:
And the output makes it seem like it imported them correctly (it even uses the correctly png import type that I'd already setup):
The ResourceLoader.load docs also mention:
So I suspect this
type_hint
is intended for loading files from the user's disk and not from within a godot project (where you should useload()
).Possibly the string could be:
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_resourceloader.html#class-resourceloader-method-load
The text was updated successfully, but these errors were encountered: