A node used to preload sub-resources inside a scene.
This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. You can add the resources using the ResourcePreloader tab when the node is selected.
GDScript has a simplified @GDScript.preload built-in method which can be used in most situations, leaving the use of ResourcePreloader for more advanced scenarios.
void | add_resource ( StringName name, Resource resource ) |
get_resource ( StringName name ) const | |
get_resource_list ( ) const | |
has_resource ( StringName name ) const | |
void | remove_resource ( StringName name ) |
void | rename_resource ( StringName name, StringName newname ) |
Adds a resource to the preloader with the given name. If a resource with the given name already exists, the new resource will be renamed to "name N" where N is an incrementing number starting from 2.
Returns the resource associated to name.
Returns the list of resources inside the preloader.
Returns true if the preloader contains a resource associated to name.
Removes the resource associated to name from the preloader.
Renames a resource inside the preloader from name to newname.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_resourcepreloader.html