mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-01-23 15:17:21 +01:00
93 lines
5.3 KiB
ReStructuredText
93 lines
5.3 KiB
ReStructuredText
|
:github_url: hide
|
||
|
|
||
|
.. DO NOT EDIT THIS FILE!!!
|
||
|
.. Generated automatically from Godot engine sources.
|
||
|
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
|
||
|
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ResourcePreloader.xml.
|
||
|
|
||
|
.. _class_ResourcePreloader:
|
||
|
|
||
|
ResourcePreloader
|
||
|
=================
|
||
|
|
||
|
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_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 has a simplified :ref:`@GDScript.preload<class_@GDScript_method_preload>` built-in method which can be used in most situations, leaving the use of ``ResourcePreloader`` for more advanced scenarios.
|
||
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`add_resource<class_ResourcePreloader_method_add_resource>` **(** :ref:`String<class_String>` name, :ref:`Resource<class_Resource>` resource **)** |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`Resource<class_Resource>` | :ref:`get_resource<class_ResourcePreloader_method_get_resource>` **(** :ref:`String<class_String>` name **)** |const| |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_resource_list<class_ResourcePreloader_method_get_resource_list>` **(** **)** |const| |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| :ref:`bool<class_bool>` | :ref:`has_resource<class_ResourcePreloader_method_has_resource>` **(** :ref:`String<class_String>` name **)** |const| |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`remove_resource<class_ResourcePreloader_method_remove_resource>` **(** :ref:`String<class_String>` name **)** |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`rename_resource<class_ResourcePreloader_method_rename_resource>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)** |
|
||
|
+-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
|
||
|
Method Descriptions
|
||
|
-------------------
|
||
|
|
||
|
.. _class_ResourcePreloader_method_add_resource:
|
||
|
|
||
|
- void **add_resource** **(** :ref:`String<class_String>` name, :ref:`Resource<class_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.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_ResourcePreloader_method_get_resource:
|
||
|
|
||
|
- :ref:`Resource<class_Resource>` **get_resource** **(** :ref:`String<class_String>` name **)** |const|
|
||
|
|
||
|
Returns the resource associated to ``name``.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_ResourcePreloader_method_get_resource_list:
|
||
|
|
||
|
- :ref:`PoolStringArray<class_PoolStringArray>` **get_resource_list** **(** **)** |const|
|
||
|
|
||
|
Returns the list of resources inside the preloader.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_ResourcePreloader_method_has_resource:
|
||
|
|
||
|
- :ref:`bool<class_bool>` **has_resource** **(** :ref:`String<class_String>` name **)** |const|
|
||
|
|
||
|
Returns ``true`` if the preloader contains a resource associated to ``name``.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_ResourcePreloader_method_remove_resource:
|
||
|
|
||
|
- void **remove_resource** **(** :ref:`String<class_String>` name **)**
|
||
|
|
||
|
Removes the resource associated to ``name`` from the preloader.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_ResourcePreloader_method_rename_resource:
|
||
|
|
||
|
- void **rename_resource** **(** :ref:`String<class_String>` name, :ref:`String<class_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.)`
|