.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Script: Script ====== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`VisualScript`, :ref:`GDScript`, :ref:`NativeScript` **Category:** Core Brief Description ----------------- Base class for scripts. Member Functions ---------------- +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`can_instance` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_node_type` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_source_code` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_script_signal` **(** :ref:`String` signal_name **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_source_code` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`instance_has` **(** :ref:`Object` base_object **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_tool` **(** **)** const | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`reload` **(** :ref:`bool` keep_state=false **)** | +------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_source_code` **(** :ref:`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 --------------------------- .. _class_Script_can_instance: - :ref:`bool` **can_instance** **(** **)** const Return true if this script can be instance (ie not a library). .. _class_Script_get_node_type: - :ref:`String` **get_node_type** **(** **)** const .. _class_Script_get_source_code: - :ref:`String` **get_source_code** **(** **)** const Return the script source code (if available). .. _class_Script_has_script_signal: - :ref:`bool` **has_script_signal** **(** :ref:`String` signal_name **)** const .. _class_Script_has_source_code: - :ref:`bool` **has_source_code** **(** **)** const Return true if the script contains source code. .. _class_Script_instance_has: - :ref:`bool` **instance_has** **(** :ref:`Object` base_object **)** const Return true if a given object uses an instance of this script. .. _class_Script_is_tool: - :ref:`bool` **is_tool** **(** **)** const .. _class_Script_reload: - :ref:`int` **reload** **(** :ref:`bool` keep_state=false **)** .. _class_Script_set_source_code: - void **set_source_code** **(** :ref:`String` source **)** Set the script source code.