Script

Inherits: Resource < Reference < Object

Inherited By: VisualScript, GDScript, NativeScript

Category: Core

Brief Description

Base class for scripts.

Member Functions

bool can_instance ( ) const
String get_node_type ( ) const
String get_source_code ( ) const
bool has_script_signal ( String signal_name ) const
bool has_source_code ( ) const
bool instance_has ( Object base_object ) const
bool is_tool ( ) const
int reload ( bool keep_state=false )
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_node_type ( ) const
  • String get_source_code ( ) const

Return the script source code (if available).

  • bool has_script_signal ( String signal_name ) const
  • 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.

  • bool is_tool ( ) const
  • int reload ( bool keep_state=false )
  • void set_source_code ( String source )

Set the script source code.