class_scripteditor.rst 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ScriptEditor.xml.
  6. .. _class_ScriptEditor:
  7. ScriptEditor
  8. ============
  9. **Inherits:** :ref:`PanelContainer<class_PanelContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Godot editor's script editor.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_script_editor<class_EditorInterface_method_get_script_editor>`.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`can_drop_data_fw<class_ScriptEditor_method_can_drop_data_fw>` **(** :ref:`Vector2<class_Vector2>` point, :ref:`Variant<class_Variant>` data, :ref:`Control<class_Control>` from **)** |const| |
  22. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`drop_data_fw<class_ScriptEditor_method_drop_data_fw>` **(** :ref:`Vector2<class_Vector2>` point, :ref:`Variant<class_Variant>` data, :ref:`Control<class_Control>` from **)** |
  24. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Control<class_Control>` | :ref:`get_base_editor<class_ScriptEditor_method_get_base_editor>` **(** **)** |const| |
  26. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`Script<class_Script>` | :ref:`get_current_script<class_ScriptEditor_method_get_current_script>` **(** **)** |
  28. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Variant<class_Variant>` | :ref:`get_drag_data_fw<class_ScriptEditor_method_get_drag_data_fw>` **(** :ref:`Vector2<class_Vector2>` point, :ref:`Control<class_Control>` from **)** |
  30. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Array<class_Array>` | :ref:`get_open_scripts<class_ScriptEditor_method_get_open_scripts>` **(** **)** |const| |
  32. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`goto_line<class_ScriptEditor_method_goto_line>` **(** :ref:`int<class_int>` line_number **)** |
  34. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`open_script_create_dialog<class_ScriptEditor_method_open_script_create_dialog>` **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)** |
  36. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`reload_scripts<class_ScriptEditor_method_reload_scripts>` **(** **)** |
  38. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Signals
  43. -------
  44. .. _class_ScriptEditor_signal_editor_script_changed:
  45. .. rst-class:: classref-signal
  46. **editor_script_changed** **(** :ref:`Script<class_Script>` script **)**
  47. Emitted when user changed active script. Argument is a freshly activated :ref:`Script<class_Script>`.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_ScriptEditor_signal_script_close:
  51. .. rst-class:: classref-signal
  52. **script_close** **(** :ref:`Script<class_Script>` script **)**
  53. Emitted when editor is about to close the active script. Argument is a :ref:`Script<class_Script>` that is going to be closed.
  54. .. rst-class:: classref-section-separator
  55. ----
  56. .. rst-class:: classref-descriptions-group
  57. Method Descriptions
  58. -------------------
  59. .. _class_ScriptEditor_method_can_drop_data_fw:
  60. .. rst-class:: classref-method
  61. :ref:`bool<class_bool>` **can_drop_data_fw** **(** :ref:`Vector2<class_Vector2>` point, :ref:`Variant<class_Variant>` data, :ref:`Control<class_Control>` from **)** |const|
  62. .. container:: contribute
  63. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_ScriptEditor_method_drop_data_fw:
  67. .. rst-class:: classref-method
  68. void **drop_data_fw** **(** :ref:`Vector2<class_Vector2>` point, :ref:`Variant<class_Variant>` data, :ref:`Control<class_Control>` from **)**
  69. .. container:: contribute
  70. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_ScriptEditor_method_get_base_editor:
  74. .. rst-class:: classref-method
  75. :ref:`Control<class_Control>` **get_base_editor** **(** **)** |const|
  76. Returns the underlying :ref:`Control<class_Control>` used for editing scripts. For text scripts, this is a :ref:`TextEdit<class_TextEdit>`.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_ScriptEditor_method_get_current_script:
  80. .. rst-class:: classref-method
  81. :ref:`Script<class_Script>` **get_current_script** **(** **)**
  82. Returns a :ref:`Script<class_Script>` that is currently active in editor.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ScriptEditor_method_get_drag_data_fw:
  86. .. rst-class:: classref-method
  87. :ref:`Variant<class_Variant>` **get_drag_data_fw** **(** :ref:`Vector2<class_Vector2>` point, :ref:`Control<class_Control>` from **)**
  88. .. container:: contribute
  89. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_ScriptEditor_method_get_open_scripts:
  93. .. rst-class:: classref-method
  94. :ref:`Array<class_Array>` **get_open_scripts** **(** **)** |const|
  95. Returns an array with all :ref:`Script<class_Script>` objects which are currently open in editor.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_ScriptEditor_method_goto_line:
  99. .. rst-class:: classref-method
  100. void **goto_line** **(** :ref:`int<class_int>` line_number **)**
  101. Goes to the specified line in the current script.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_ScriptEditor_method_open_script_create_dialog:
  105. .. rst-class:: classref-method
  106. void **open_script_create_dialog** **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)**
  107. Opens the script create dialog. The script will extend ``base_name``. The file extension can be omitted from ``base_path``. It will be added based on the selected scripting language.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_ScriptEditor_method_reload_scripts:
  111. .. rst-class:: classref-method
  112. void **reload_scripts** **(** **)**
  113. Reload all currently opened scripts from disk in case the file contents are newer.
  114. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  115. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  116. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  117. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`