summaryrefslogtreecommitdiff
path: root/doc/classes/ResourcePreloader.xml
blob: 17904697e6f4a5d828e4c388bbdf477397a01585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ResourcePreloader" inherits="Node" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		Resource Preloader Node.
	</brief_description>
	<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 [method @GDScript.preload] built-in method which can be used in most situations, leaving the use of [ResourcePreloader] for more advanced scenarios.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="add_resource">
			<return type="void" />
			<param index="0" name="name" type="StringName" />
			<param index="1" name="resource" type="Resource" />
			<description>
				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.
			</description>
		</method>
		<method name="get_resource" qualifiers="const">
			<return type="Resource" />
			<param index="0" name="name" type="StringName" />
			<description>
				Returns the resource associated to [param name].
			</description>
		</method>
		<method name="get_resource_list" qualifiers="const">
			<return type="PackedStringArray" />
			<description>
				Returns the list of resources inside the preloader.
			</description>
		</method>
		<method name="has_resource" qualifiers="const">
			<return type="bool" />
			<param index="0" name="name" type="StringName" />
			<description>
				Returns [code]true[/code] if the preloader contains a resource associated to [param name].
			</description>
		</method>
		<method name="remove_resource">
			<return type="void" />
			<param index="0" name="name" type="StringName" />
			<description>
				Removes the resource associated to [param name] from the preloader.
			</description>
		</method>
		<method name="rename_resource">
			<return type="void" />
			<param index="0" name="name" type="StringName" />
			<param index="1" name="newname" type="StringName" />
			<description>
				Renames a resource inside the preloader from [param name] to [param newname].
			</description>
		</method>
	</methods>
</class>