Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/gdscript/doc_classes/GDScript.xml
10278 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="GDScript" inherits="Script" 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, saved with the [code].gd[/code] extension. The script extends the functionality of all objects that instantiate it.
8
Calling [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
If you are looking for GDScript's built-in functions, see [@GDScript] instead.
10
</description>
11
<tutorials>
12
<link title="GDScript documentation index">$DOCS_URL/tutorials/scripting/gdscript/index.html</link>
13
</tutorials>
14
<methods>
15
<method name="new" qualifiers="vararg">
16
<return type="Variant" />
17
<description>
18
Returns a new instance of the script.
19
[codeblock]
20
var MyClass = load("myclass.gd")
21
var instance = MyClass.new()
22
print(instance.get_script() == MyClass) # Prints true
23
[/codeblock]
24
</description>
25
</method>
26
</methods>
27
</class>
28
29