Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing documentation for type_hint in ResourceLoader #1258

Closed
bartosz-m opened this issue Mar 23, 2018 · 2 comments · Fixed by godotengine/godot#44414
Closed

Missing documentation for type_hint in ResourceLoader #1258

bartosz-m opened this issue Mar 23, 2018 · 2 comments · Fixed by godotengine/godot#44414

Comments

@bartosz-m
Copy link

There is no information what correct values could be passed to ResorceLoader functions load and load_interactive.
I've looked directly at source code of ResorceLoader but I still have no clue.

@hungrymonkey
Copy link
Contributor

hungrymonkey commented Apr 18, 2018

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

https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp#L169

https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp#L54

https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp#L74

you pass these values.

https://github.com/godotengine/godot/blob/master/modules/vorbis/audio_stream_ogg_vorbis.cpp#L411

var oggresource = load("res://file.ogg", "AudioStreamOGGVorbis")

@nathanfranke
Copy link
Contributor

@hungrymonkey Maybe things have changed in the past 2 years, but

print(ResourceLoader.load("res://icon.png", "Image"))

prints [StreamTexture:1180]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants