Click or drag to resize

ResourceLoaderLoad Method

Overload List
  NameDescription
Public methodStatic memberLoadT(String, String, Boolean)
Public methodStatic memberLoad(String, String, Boolean)

Loads a resource at the given path, caching the result for further access.

The registered ResourceFormatLoaders are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted.

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.

If no_cache is true, the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists.

Returns an empty resource if no ResourceFormatLoader could handle the file.

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.

Top
See Also