class_script.rst 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Script:
  4. Script
  5. ======
  6. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`GDScript<class_gdscript>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Base class for scripts.
  12. Member Functions
  13. ----------------
  14. +------------------------------+------------------------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`can_instance<class_Script_can_instance>` **(** **)** const |
  16. +------------------------------+------------------------------------------------------------------------------------------------------------+
  17. | :ref:`String<class_string>` | :ref:`get_source_code<class_Script_get_source_code>` **(** **)** const |
  18. +------------------------------+------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`has_source_code<class_Script_has_source_code>` **(** **)** const |
  20. +------------------------------+------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`instance_has<class_Script_instance_has>` **(** :ref:`Object<class_object>` base_object **)** const |
  22. +------------------------------+------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`reload<class_Script_reload>` **(** :ref:`bool<class_bool>` keep_state=false **)** |
  24. +------------------------------+------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_source_code<class_Script_set_source_code>` **(** :ref:`String<class_string>` source **)** |
  26. +------------------------------+------------------------------------------------------------------------------------------------------------+
  27. Description
  28. -----------
  29. Base class for scripts. Any script that is loaded becomes one of these resources, which can then create instances.
  30. Member Function Description
  31. ---------------------------
  32. .. _class_Script_can_instance:
  33. - :ref:`bool<class_bool>` **can_instance** **(** **)** const
  34. Return true if this script can be instance (ie not a library).
  35. .. _class_Script_get_source_code:
  36. - :ref:`String<class_string>` **get_source_code** **(** **)** const
  37. Return the script source code (if available).
  38. .. _class_Script_has_source_code:
  39. - :ref:`bool<class_bool>` **has_source_code** **(** **)** const
  40. Return true if the script contains source code.
  41. .. _class_Script_instance_has:
  42. - :ref:`bool<class_bool>` **instance_has** **(** :ref:`Object<class_object>` base_object **)** const
  43. Return true if a given object uses an instance of this script.
  44. .. _class_Script_reload:
  45. - :ref:`int<class_int>` **reload** **(** :ref:`bool<class_bool>` keep_state=false **)**
  46. .. _class_Script_set_source_code:
  47. - void **set_source_code** **(** :ref:`String<class_string>` source **)**
  48. Set the script source code.