:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ResourcePreloader.xml. .. _class_ResourcePreloader: ResourcePreloader ================= **Inherits:** :ref:`Node` **<** :ref:`Object` Resource Preloader Node. .. rst-class:: classref-introduction-group 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 has a simplified :ref:`@GDScript.preload` built-in method which can be used in most situations, leaving the use of **ResourcePreloader** for more advanced scenarios. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_resource` **(** :ref:`String` name, :ref:`Resource` resource **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Resource` | :ref:`get_resource` **(** :ref:`String` name **)** |const| | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_resource_list` **(** **)** |const| | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_resource` **(** :ref:`String` name **)** |const| | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_resource` **(** :ref:`String` name **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`rename_resource` **(** :ref:`String` name, :ref:`String` newname **)** | +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ResourcePreloader_method_add_resource: .. rst-class:: classref-method void **add_resource** **(** :ref:`String` name, :ref:`Resource` resource **)** 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. .. rst-class:: classref-item-separator ---- .. _class_ResourcePreloader_method_get_resource: .. rst-class:: classref-method :ref:`Resource` **get_resource** **(** :ref:`String` name **)** |const| Returns the resource associated to ``name``. .. rst-class:: classref-item-separator ---- .. _class_ResourcePreloader_method_get_resource_list: .. rst-class:: classref-method :ref:`PoolStringArray` **get_resource_list** **(** **)** |const| Returns the list of resources inside the preloader. .. rst-class:: classref-item-separator ---- .. _class_ResourcePreloader_method_has_resource: .. rst-class:: classref-method :ref:`bool` **has_resource** **(** :ref:`String` name **)** |const| Returns ``true`` if the preloader contains a resource associated to ``name``. .. rst-class:: classref-item-separator ---- .. _class_ResourcePreloader_method_remove_resource: .. rst-class:: classref-method void **remove_resource** **(** :ref:`String` name **)** Removes the resource associated to ``name`` from the preloader. .. rst-class:: classref-item-separator ---- .. _class_ResourcePreloader_method_rename_resource: .. rst-class:: classref-method void **rename_resource** **(** :ref:`String` name, :ref:`String` newname **)** Renames a resource inside the preloader from ``name`` to ``newname``. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`