ResourcePreloader

Inherits: Node < Object Resource Preloader Node.

Description

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. @GDScript.preload built-in method which can be used in most situations, leaving the use of ResourcePreloader for more advanced scenarios.

Methods

Method Descriptions

  • add_resource ( String name, Resource resource ) 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.

  • Resource get_resource ( String name ) const name.

  • PoolStringArray get_resource_list ( ) const Returns the list of resources inside the preloader.

  • bool has_resource ( String name ) const true if the preloader contains a resource associated to name.

  • remove_resource ( String name ) name from the preloader.

  • rename_resource ( String name, String newname ) name to newname.