GDScript.xml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GDScript" inherits="Script" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
  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 extends 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>$DOCS_URL/tutorials/scripting/gdscript/index.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="get_as_byte_code" qualifiers="const">
  15. <return type="PoolByteArray" />
  16. <description>
  17. Returns byte code for the script source code.
  18. </description>
  19. </method>
  20. <method name="new" qualifiers="vararg">
  21. <return type="Variant" />
  22. <description>
  23. Returns a new instance of the script.
  24. For example:
  25. [codeblock]
  26. var MyClass = load("myclass.gd")
  27. var instance = MyClass.new()
  28. assert(instance.get_script() == MyClass)
  29. [/codeblock]
  30. </description>
  31. </method>
  32. </methods>
  33. <constants>
  34. </constants>
  35. </class>