2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-05 20:07:03 +00:00
<class name= "ResourcePreloader" inherits= "Node" version= "4.2" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2023-04-27 23:35:33 +00:00
A node used to preload sub-resources inside a scene.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2022-12-28 13:19:55 +00:00
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.
2019-06-18 16:04:29 +00:00
GDScript has a simplified [method @GDScript.preload] built-in method which can be used in most situations, leaving the use of [ResourcePreloader] for more advanced scenarios.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_resource" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "name" type= "StringName" />
<param index= "1" name= "resource" type= "Resource" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Adds a resource to the preloader with the given [param name]. If a resource with the given [param name] already exists, the new resource will be renamed to "[param name] N" where N is an incrementing number starting from 2.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_resource" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Resource" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns the resource associated to [param name].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_resource_list" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "PackedStringArray" />
2017-09-12 20:42:36 +00:00
<description >
2019-02-07 16:00:16 +00:00
Returns the list of resources inside the preloader.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "has_resource" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Returns [code]true[/code] if the preloader contains a resource associated to [param name].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "remove_resource" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "name" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Removes the resource associated to [param name] from the preloader.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "rename_resource" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "name" type= "StringName" />
<param index= "1" name= "newname" type= "StringName" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Renames a resource inside the preloader from [param name] to [param newname].
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
</class>