mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 05:31:01 +00:00 
			
		
		
		
	 2d20fc39aa
			
		
	
	
		2d20fc39aa
		
	
	
	
	
		
			
			We already removed it from the online docs with #35132. Currently it can only be "Built-In Types" (Variant types) or "Core" (everything else), which is of limited use. We might also want to consider dropping it from `ClassDB` altogether in Godot 4.0.
		
			
				
	
	
		
			72 lines
		
	
	
	
		
			2.4 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
	
		
			2.4 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="UTF-8" ?>
 | |
| <class name="ResourcePreloader" inherits="Node" version="3.2">
 | |
| 	<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">
 | |
| 			</return>
 | |
| 			<argument index="0" name="name" type="String">
 | |
| 			</argument>
 | |
| 			<argument index="1" name="resource" type="Resource">
 | |
| 			</argument>
 | |
| 			<description>
 | |
| 				Adds a resource to the preloader with the given [code]name[/code]. If a resource with the given [code]name[/code] already exists, the new resource will be renamed to "[code]name[/code] N" where N is an incrementing number starting from 2.
 | |
| 			</description>
 | |
| 		</method>
 | |
| 		<method name="get_resource" qualifiers="const">
 | |
| 			<return type="Resource">
 | |
| 			</return>
 | |
| 			<argument index="0" name="name" type="String">
 | |
| 			</argument>
 | |
| 			<description>
 | |
| 				Returns the resource associated to [code]name[/code].
 | |
| 			</description>
 | |
| 		</method>
 | |
| 		<method name="get_resource_list" qualifiers="const">
 | |
| 			<return type="PoolStringArray">
 | |
| 			</return>
 | |
| 			<description>
 | |
| 				Returns the list of resources inside the preloader.
 | |
| 			</description>
 | |
| 		</method>
 | |
| 		<method name="has_resource" qualifiers="const">
 | |
| 			<return type="bool">
 | |
| 			</return>
 | |
| 			<argument index="0" name="name" type="String">
 | |
| 			</argument>
 | |
| 			<description>
 | |
| 				Returns [code]true[/code] if the preloader contains a resource associated to [code]name[/code].
 | |
| 			</description>
 | |
| 		</method>
 | |
| 		<method name="remove_resource">
 | |
| 			<return type="void">
 | |
| 			</return>
 | |
| 			<argument index="0" name="name" type="String">
 | |
| 			</argument>
 | |
| 			<description>
 | |
| 				Removes the resource associated to [code]name[/code] from the preloader.
 | |
| 			</description>
 | |
| 		</method>
 | |
| 		<method name="rename_resource">
 | |
| 			<return type="void">
 | |
| 			</return>
 | |
| 			<argument index="0" name="name" type="String">
 | |
| 			</argument>
 | |
| 			<argument index="1" name="newname" type="String">
 | |
| 			</argument>
 | |
| 			<description>
 | |
| 				Renames a resource inside the preloader from [code]name[/code] to [code]newname[/code].
 | |
| 			</description>
 | |
| 		</method>
 | |
| 	</methods>
 | |
| 	<constants>
 | |
| 	</constants>
 | |
| </class>
 |