Inheritance #

ResourcePreloader

Table of contents

ResourcePreloader #

is_instantiable, resource, Node, core, not_builtin_classes

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.

Members #

Methods #

func add_resource(resource: Resource) -> void#

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.

const func get_resource(name: StringName) -> Resource#

Returns the resource associated to name.

const func get_resource_list() -> PackedStringArray#

Returns the list of resources inside the preloader.

const func has_resource(name: StringName) -> bool#

Returns true if the preloader contains a resource associated to name.

func remove_resource(name: StringName) -> void#

Removes the resource associated to name from the preloader.

func rename_resource(newname: StringName) -> void#

Renames a resource inside the preloader from name to newname.

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

Theme Items #

Tutorials #