1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- .. 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<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
- **Inherited By:** :ref:`GDScript<class_gdscript>`
- **Category:** Core
- Brief Description
- -----------------
- Base class for scripts.
- Member Functions
- ----------------
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`can_instance<class_Script_can_instance>` **(** **)** const |
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_string>` | :ref:`get_source_code<class_Script_get_source_code>` **(** **)** const |
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_source_code<class_Script_has_source_code>` **(** **)** const |
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`instance_has<class_Script_instance_has>` **(** :ref:`Object<class_object>` base_object **)** const |
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`reload<class_Script_reload>` **(** :ref:`bool<class_bool>` keep_state=false **)** |
- +------------------------------+------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_source_code<class_Script_set_source_code>` **(** :ref:`String<class_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<class_bool>` **can_instance** **(** **)** const
- Return true if this script can be instance (ie not a library).
- .. _class_Script_get_source_code:
- - :ref:`String<class_string>` **get_source_code** **(** **)** const
- Return the script source code (if available).
- .. _class_Script_has_source_code:
- - :ref:`bool<class_bool>` **has_source_code** **(** **)** const
- Return true if the script contains source code.
- .. _class_Script_instance_has:
- - :ref:`bool<class_bool>` **instance_has** **(** :ref:`Object<class_object>` base_object **)** const
- Return true if a given object uses an instance of this script.
- .. _class_Script_reload:
- - :ref:`int<class_int>` **reload** **(** :ref:`bool<class_bool>` keep_state=false **)**
- .. _class_Script_set_source_code:
- - void **set_source_code** **(** :ref:`String<class_string>` source **)**
- Set the script source code.
|