GDScript.xml 1.1 KB

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="GDScript" inherits="Script" version="4.0" 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 instantiate 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 title="GDScript documentation index">$DOCS_URL/tutorials/scripting/gdscript/index.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="new" qualifiers="vararg">
  15. <return type="Variant" />
  16. <description>
  17. Returns a new instance of the script.
  18. For example:
  19. [codeblock]
  20. var MyClass = load("myclass.gd")
  21. var instance = MyClass.new()
  22. assert(instance.get_script() == MyClass)
  23. [/codeblock]
  24. </description>
  25. </method>
  26. </methods>
  27. </class>