Skip to content

Latest commit

 

History

History
58 lines (35 loc) · 1.98 KB

class_gdscript.rst

File metadata and controls

58 lines (35 loc) · 1.98 KB

GDScript

Inherits: Script<class_script> < Resource<class_resource> < Reference<class_reference> < Object<class_object>

Category: Core

Brief Description

A script implemented in the GDScript programming language.

Member Functions

PoolByteArray<class_poolbytearray> get_as_byte_code<class_GDScript_get_as_byte_code> ( ) const
Object<class_object> new<class_GDScript_new> ( ) vararg

Description

A script implemented in the GDScript programming language. The script exends the functionality of all objects that instance it.

new<class_GDScript_new> creates a new instance of the script. Object.set_script<class_Object_set_script> extends an existing object, if that object's class matches one of the script's base classes.

Member Function Description

  • PoolByteArray<class_poolbytearray> get_as_byte_code ( ) const

Returns byte code for the script source code.

  • Object<class_object> new ( ) vararg

Returns a new instance of the script.

For example:

var MyClass = load("myclass.gd")
var instance = MyClass.new()
assert(instance.get_script() == MyClass)