Script

Inherits: Resource < Reference < Object

Inherited By: GDScript

Category: Core

Brief Description

Base class for scripts.

Member Functions

bool can_instance ( ) const
String get_source_code ( ) const
bool has_source_code ( ) const
bool instance_has ( Object base_object ) const
int reload ( )
void set_source_code ( String source )

Description

Base class for scripts. Any script that is loaded becomes one of these resources, which can then create instances.

Member Function Description

  • bool can_instance ( ) const

Return true if this script can be instance (ie not a library).

  • String get_source_code ( ) const

Return the script source code (if available).

  • bool has_source_code ( ) const

Return true if the script contains source code.

Return true if a given object uses an instance of this script.

  • int reload ( )

Reload the script. This will fail if there are existing instances.

  • void set_source_code ( String source )

Set the script source code.