ResourcePreloader

Inherits: Node < Object

Category: Core

Brief Description

Resource Preloader Node.

Member Functions

void add_resource ( String name, Object resource )
Object get_resource ( String name ) const
StringArray get_resource_list ( ) const
bool has_resource ( String name ) const
void remove_resource ( String name )
void rename_resource ( String name, String newname )

Description

Resource Preloader Node. 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 be retrieved from here.

Member Function Description

void add_resource ( String name, Object resource )

Add a resource to the preloader. Set the text-id that will be used to identify it (retrieve it/erase it/etc).

Object get_resource ( String name ) const

Return the resource given a text-id.

StringArray get_resource_list ( ) const

Return the list of resources inside the preloader.

bool has_resource ( String name ) const

Return true if the preloader has a given resource.

void remove_resource ( String name )

Remove a resource from the preloader by text id.

void rename_resource ( String name, String newname )

Rename a resource inside the preloader, from a text-id to a new text-id.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_resourcepreloader.html