class_scripteditor.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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. Description
  12. -----------
  13. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_script_editor<class_EditorInterface_method_get_script_editor>`.
  14. Methods
  15. -------
  16. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`ScriptEditorBase<class_ScriptEditorBase>` | :ref:`get_current_editor<class_ScriptEditor_method_get_current_editor>` **(** **)** |const| |
  18. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Script<class_Script>` | :ref:`get_current_script<class_ScriptEditor_method_get_current_script>` **(** **)** |
  20. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Array<class_Array>` | :ref:`get_open_script_editors<class_ScriptEditor_method_get_open_script_editors>` **(** **)** |const| |
  22. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Array<class_Array>` | :ref:`get_open_scripts<class_ScriptEditor_method_get_open_scripts>` **(** **)** |const| |
  24. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`goto_line<class_ScriptEditor_method_goto_line>` **(** :ref:`int<class_int>` line_number **)** |
  26. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | 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 **)** |
  28. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`register_syntax_highlighter<class_ScriptEditor_method_register_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
  30. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`unregister_syntax_highlighter<class_ScriptEditor_method_unregister_syntax_highlighter>` **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)** |
  32. +-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. Signals
  34. -------
  35. .. _class_ScriptEditor_signal_editor_script_changed:
  36. - **editor_script_changed** **(** :ref:`Script<class_Script>` script **)**
  37. Emitted when user changed active script. Argument is a freshly activated :ref:`Script<class_Script>`.
  38. ----
  39. .. _class_ScriptEditor_signal_script_close:
  40. - **script_close** **(** :ref:`Script<class_Script>` script **)**
  41. Emitted when editor is about to close the active script. Argument is a :ref:`Script<class_Script>` that is going to be closed.
  42. Method Descriptions
  43. -------------------
  44. .. _class_ScriptEditor_method_get_current_editor:
  45. - :ref:`ScriptEditorBase<class_ScriptEditorBase>` **get_current_editor** **(** **)** |const|
  46. Returns the :ref:`ScriptEditorBase<class_ScriptEditorBase>` object that the user is currently editing.
  47. ----
  48. .. _class_ScriptEditor_method_get_current_script:
  49. - :ref:`Script<class_Script>` **get_current_script** **(** **)**
  50. Returns a :ref:`Script<class_Script>` that is currently active in editor.
  51. ----
  52. .. _class_ScriptEditor_method_get_open_script_editors:
  53. - :ref:`Array<class_Array>` **get_open_script_editors** **(** **)** |const|
  54. Returns an array with all :ref:`ScriptEditorBase<class_ScriptEditorBase>` objects which are currently open in editor.
  55. ----
  56. .. _class_ScriptEditor_method_get_open_scripts:
  57. - :ref:`Array<class_Array>` **get_open_scripts** **(** **)** |const|
  58. Returns an array with all :ref:`Script<class_Script>` objects which are currently open in editor.
  59. ----
  60. .. _class_ScriptEditor_method_goto_line:
  61. - void **goto_line** **(** :ref:`int<class_int>` line_number **)**
  62. Goes to the specified line in the current script.
  63. ----
  64. .. _class_ScriptEditor_method_open_script_create_dialog:
  65. - void **open_script_create_dialog** **(** :ref:`String<class_String>` base_name, :ref:`String<class_String>` base_path **)**
  66. 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.
  67. ----
  68. .. _class_ScriptEditor_method_register_syntax_highlighter:
  69. - void **register_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
  70. Registers the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` to the editor, the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` will be available on all open scripts.
  71. \ **Note:** Does not apply to scripts that are already opened.
  72. ----
  73. .. _class_ScriptEditor_method_unregister_syntax_highlighter:
  74. - void **unregister_syntax_highlighter** **(** :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` syntax_highlighter **)**
  75. Unregisters the :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` from the editor.
  76. \ **Note:** The :ref:`EditorSyntaxHighlighter<class_EditorSyntaxHighlighter>` will still be applied to scripts that are already opened.
  77. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  78. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  79. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  80. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  81. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  82. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`