Path: blob/master/modules/gdscript/doc_classes/GDScript.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="GDScript" inherits="Script" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3A script implemented in the GDScript programming language.4</brief_description>5<description>6A script implemented in the GDScript programming language, saved with the [code].gd[/code] extension. The script extends the functionality of all objects that instantiate it.7Calling [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.8If you are looking for GDScript's built-in functions, see [@GDScript] instead.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>17Returns a new instance of the script.18[codeblock]19var MyClass = load("myclass.gd")20var instance = MyClass.new()21print(instance.get_script() == MyClass) # Prints true22[/codeblock]23</description>24</method>25</methods>26</class>272829