ScriptEditor.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ScriptEditor" inherits="PanelContainer" version="4.0">
  3. <brief_description>
  4. Godot editor's script editor.
  5. </brief_description>
  6. <description>
  7. [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_script_editor].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_current_editor" qualifiers="const">
  13. <return type="ScriptEditorBase" />
  14. <description>
  15. Returns the [ScriptEditorBase] object that the user is currently editing.
  16. </description>
  17. </method>
  18. <method name="get_current_script">
  19. <return type="Script" />
  20. <description>
  21. Returns a [Script] that is currently active in editor.
  22. </description>
  23. </method>
  24. <method name="get_open_script_editors" qualifiers="const">
  25. <return type="Array" />
  26. <description>
  27. Returns an array with all [ScriptEditorBase] objects which are currently open in editor.
  28. </description>
  29. </method>
  30. <method name="get_open_scripts" qualifiers="const">
  31. <return type="Array" />
  32. <description>
  33. Returns an array with all [Script] objects which are currently open in editor.
  34. </description>
  35. </method>
  36. <method name="goto_line">
  37. <return type="void" />
  38. <argument index="0" name="line_number" type="int" />
  39. <description>
  40. Goes to the specified line in the current script.
  41. </description>
  42. </method>
  43. <method name="open_script_create_dialog">
  44. <return type="void" />
  45. <argument index="0" name="base_name" type="String" />
  46. <argument index="1" name="base_path" type="String" />
  47. <description>
  48. Opens the script create dialog. The script will extend [code]base_name[/code]. The file extension can be omitted from [code]base_path[/code]. It will be added based on the selected scripting language.
  49. </description>
  50. </method>
  51. <method name="register_syntax_highlighter">
  52. <return type="void" />
  53. <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter" />
  54. <description>
  55. Registers the [EditorSyntaxHighlighter] to the editor, the [EditorSyntaxHighlighter] will be available on all open scripts.
  56. [b]Note:[/b] Does not apply to scripts that are already opened.
  57. </description>
  58. </method>
  59. <method name="unregister_syntax_highlighter">
  60. <return type="void" />
  61. <argument index="0" name="syntax_highlighter" type="EditorSyntaxHighlighter" />
  62. <description>
  63. Unregisters the [EditorSyntaxHighlighter] from the editor.
  64. [b]Note:[/b] The [EditorSyntaxHighlighter] will still be applied to scripts that are already opened.
  65. </description>
  66. </method>
  67. </methods>
  68. <signals>
  69. <signal name="editor_script_changed">
  70. <argument index="0" name="script" type="Script" />
  71. <description>
  72. Emitted when user changed active script. Argument is a freshly activated [Script].
  73. </description>
  74. </signal>
  75. <signal name="script_close">
  76. <argument index="0" name="script" type="Script" />
  77. <description>
  78. Emitted when editor is about to close the active script. Argument is a [Script] that is going to be closed.
  79. </description>
  80. </signal>
  81. </signals>
  82. </class>