ResourcePreloader.xml 2.3 KB

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