ScriptEditor.xml 3.2 KB

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