Script.xml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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_source_code" qualifiers="const">
  23. <return type="String">
  24. </return>
  25. <description>
  26. Returns the script source code, or an empty string if source code is not available.
  27. </description>
  28. </method>
  29. <method name="has_script_signal" qualifiers="const">
  30. <return type="bool">
  31. </return>
  32. <argument index="0" name="signal_name" type="String">
  33. </argument>
  34. <description>
  35. Returns true if the script, or a base class, defines a signal with the given name.
  36. </description>
  37. </method>
  38. <method name="has_source_code" qualifiers="const">
  39. <return type="bool">
  40. </return>
  41. <description>
  42. Returns true if the script contains non-empty source code.
  43. </description>
  44. </method>
  45. <method name="instance_has" qualifiers="const">
  46. <return type="bool">
  47. </return>
  48. <argument index="0" name="base_object" type="Object">
  49. </argument>
  50. <description>
  51. Returns true if 'base_object' is an instance of this script.
  52. </description>
  53. </method>
  54. <method name="is_tool" qualifiers="const">
  55. <return type="bool">
  56. </return>
  57. <description>
  58. Returns true if the script is a tool script. A tool script can run in the editor.
  59. </description>
  60. </method>
  61. <method name="reload">
  62. <return type="int" enum="Error">
  63. </return>
  64. <argument index="0" name="keep_state" type="bool" default="false">
  65. </argument>
  66. <description>
  67. Reloads the script's class implementation. Returns an error code.
  68. </description>
  69. </method>
  70. <method name="set_source_code">
  71. <return type="void">
  72. </return>
  73. <argument index="0" name="source" type="String">
  74. </argument>
  75. <description>
  76. Sets the script source code. Does not reload the class implementation.
  77. </description>
  78. </method>
  79. </methods>
  80. <constants>
  81. </constants>
  82. </class>