ResourcePreloader.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ResourcePreloader" inherits="Node" version="3.2">
  3. <brief_description>
  4. Resource Preloader Node.
  5. </brief_description>
  6. <description>
  7. 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.
  8. 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.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="add_resource">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="name" type="String">
  17. </argument>
  18. <argument index="1" name="resource" type="Resource">
  19. </argument>
  20. <description>
  21. 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.
  22. </description>
  23. </method>
  24. <method name="get_resource" qualifiers="const">
  25. <return type="Resource">
  26. </return>
  27. <argument index="0" name="name" type="String">
  28. </argument>
  29. <description>
  30. Returns the resource associated to [code]name[/code].
  31. </description>
  32. </method>
  33. <method name="get_resource_list" qualifiers="const">
  34. <return type="PoolStringArray">
  35. </return>
  36. <description>
  37. Returns the list of resources inside the preloader.
  38. </description>
  39. </method>
  40. <method name="has_resource" qualifiers="const">
  41. <return type="bool">
  42. </return>
  43. <argument index="0" name="name" type="String">
  44. </argument>
  45. <description>
  46. Returns [code]true[/code] if the preloader contains a resource associated to [code]name[/code].
  47. </description>
  48. </method>
  49. <method name="remove_resource">
  50. <return type="void">
  51. </return>
  52. <argument index="0" name="name" type="String">
  53. </argument>
  54. <description>
  55. Removes the resource associated to [code]name[/code] from the preloader.
  56. </description>
  57. </method>
  58. <method name="rename_resource">
  59. <return type="void">
  60. </return>
  61. <argument index="0" name="name" type="String">
  62. </argument>
  63. <argument index="1" name="newname" type="String">
  64. </argument>
  65. <description>
  66. Renames a resource inside the preloader from [code]name[/code] to [code]newname[/code].
  67. </description>
  68. </method>
  69. </methods>
  70. <constants>
  71. </constants>
  72. </class>