GDScript.xml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GDScript" inherits="Script" category="Core" version="3.1">
  3. <brief_description>
  4. A script implemented in the GDScript programming language.
  5. </brief_description>
  6. <description>
  7. A script implemented in the GDScript programming language. The script exends the functionality of all objects that instance it.
  8. [method new] creates a new instance of the script. [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. <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/index.html</link>
  12. </tutorials>
  13. <demos>
  14. </demos>
  15. <methods>
  16. <method name="get_as_byte_code" qualifiers="const">
  17. <return type="PoolByteArray">
  18. </return>
  19. <description>
  20. Returns byte code for the script source code.
  21. </description>
  22. </method>
  23. <method name="new" qualifiers="vararg">
  24. <return type="Object">
  25. </return>
  26. <description>
  27. Returns a new instance of the script.
  28. For example:
  29. [codeblock]
  30. var MyClass = load("myclass.gd")
  31. var instance = MyClass.new()
  32. assert(instance.get_script() == MyClass)
  33. [/codeblock]
  34. </description>
  35. </method>
  36. </methods>
  37. <constants>
  38. </constants>
  39. </class>