Script.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Script" inherits="Resource" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. A class stored as a resource.
  5. </brief_description>
  6. <description>
  7. A class stored as a resource. The script exends the functionality of all objects that instance it.
  8. The 'new' method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="can_instance" qualifiers="const">
  16. <return type="bool">
  17. </return>
  18. <description>
  19. Returns true if the script can be instanced.
  20. </description>
  21. </method>
  22. <method name="get_node_type" qualifiers="const">
  23. <return type="String">
  24. </return>
  25. <description>
  26. </description>
  27. </method>
  28. <method name="get_source_code" qualifiers="const">
  29. <return type="String">
  30. </return>
  31. <description>
  32. Returns the script source code, or an empty string if source code is not available.
  33. </description>
  34. </method>
  35. <method name="has_script_signal" qualifiers="const">
  36. <return type="bool">
  37. </return>
  38. <argument index="0" name="signal_name" type="String">
  39. </argument>
  40. <description>
  41. Returns true if the script, or a base class, defines a signal with the given name.
  42. </description>
  43. </method>
  44. <method name="has_source_code" qualifiers="const">
  45. <return type="bool">
  46. </return>
  47. <description>
  48. Returns true if the script contains non-empty source code.
  49. </description>
  50. </method>
  51. <method name="instance_has" qualifiers="const">
  52. <return type="bool">
  53. </return>
  54. <argument index="0" name="base_object" type="Object">
  55. </argument>
  56. <description>
  57. Returns true if 'base_object' is an instance of this script.
  58. </description>
  59. </method>
  60. <method name="is_tool" qualifiers="const">
  61. <return type="bool">
  62. </return>
  63. <description>
  64. Returns true if the script is a tool script. A tool script can run in the editor.
  65. </description>
  66. </method>
  67. <method name="reload">
  68. <return type="int" enum="Error">
  69. </return>
  70. <argument index="0" name="keep_state" type="bool" default="false">
  71. </argument>
  72. <description>
  73. Reloads the script's class implementation. Returns an error code.
  74. </description>
  75. </method>
  76. <method name="set_source_code">
  77. <return type="void">
  78. </return>
  79. <argument index="0" name="source" type="String">
  80. </argument>
  81. <description>
  82. Sets the script source code. Does not reload the class implementation.
  83. </description>
  84. </method>
  85. </methods>
  86. <constants>
  87. </constants>
  88. </class>