EditorInterface.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorInterface" inherits="Node" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Godot editor's interface.
  5. </brief_description>
  6. <description>
  7. EditorInterface gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to [EditorSettings], [EditorFileSystem], [EditorResourcePreview], [ScriptEditor], the editor viewport, and information about scenes.
  8. [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorPlugin.get_editor_interface].
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="edit_node">
  14. <return type="void" />
  15. <argument index="0" name="node" type="Node" />
  16. <description>
  17. Edits the given [Node]. The node will be also selected if it's inside the scene tree.
  18. </description>
  19. </method>
  20. <method name="edit_resource">
  21. <return type="void" />
  22. <argument index="0" name="resource" type="Resource" />
  23. <description>
  24. Edits the given [Resource]. If the resource is a [Script] you can also edit it with [method edit_script] to specify the line and column position.
  25. </description>
  26. </method>
  27. <method name="edit_script">
  28. <return type="void" />
  29. <argument index="0" name="script" type="Script" />
  30. <argument index="1" name="line" type="int" default="-1" />
  31. <argument index="2" name="column" type="int" default="0" />
  32. <argument index="3" name="grab_focus" type="bool" default="true" />
  33. <description>
  34. Edits the given [Script]. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor.
  35. </description>
  36. </method>
  37. <method name="get_base_control">
  38. <return type="Control" />
  39. <description>
  40. Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
  41. [b]Warning:[/b] Removing and freeing this node will render the editor useless and may cause a crash.
  42. </description>
  43. </method>
  44. <method name="get_current_path" qualifiers="const">
  45. <return type="String" />
  46. <description>
  47. Returns the current path being viewed in the [FileSystemDock].
  48. </description>
  49. </method>
  50. <method name="get_edited_scene_root">
  51. <return type="Node" />
  52. <description>
  53. Returns the edited (current) scene's root [Node].
  54. </description>
  55. </method>
  56. <method name="get_editor_scale" qualifiers="const">
  57. <return type="float" />
  58. <description>
  59. Returns the actual scale of the editor UI ([code]1.0[/code] being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins.
  60. [b]Note:[/b] This value is set via the [code]interface/editor/display_scale[/code] and [code]interface/editor/custom_display_scale[/code] editor settings. Editor must be restarted for changes to be properly applied.
  61. </description>
  62. </method>
  63. <method name="get_editor_settings">
  64. <return type="EditorSettings" />
  65. <description>
  66. Returns the editor's [EditorSettings] instance.
  67. </description>
  68. </method>
  69. <method name="get_editor_viewport">
  70. <return type="Control" />
  71. <description>
  72. Returns the main editor control. Use this as a parent for main screens.
  73. [b]Note:[/b] This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.
  74. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
  75. </description>
  76. </method>
  77. <method name="get_file_system_dock">
  78. <return type="FileSystemDock" />
  79. <description>
  80. Returns the editor's [FileSystemDock] instance.
  81. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
  82. </description>
  83. </method>
  84. <method name="get_inspector" qualifiers="const">
  85. <return type="EditorInspector" />
  86. <description>
  87. Returns the editor's [EditorInspector] instance.
  88. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
  89. </description>
  90. </method>
  91. <method name="get_open_scenes" qualifiers="const">
  92. <return type="Array" />
  93. <description>
  94. Returns an [Array] with the file paths of the currently opened scenes.
  95. </description>
  96. </method>
  97. <method name="get_playing_scene" qualifiers="const">
  98. <return type="String" />
  99. <description>
  100. Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.
  101. </description>
  102. </method>
  103. <method name="get_resource_filesystem">
  104. <return type="EditorFileSystem" />
  105. <description>
  106. Returns the editor's [EditorFileSystem] instance.
  107. </description>
  108. </method>
  109. <method name="get_resource_previewer">
  110. <return type="EditorResourcePreview" />
  111. <description>
  112. Returns the editor's [EditorResourcePreview] instance.
  113. </description>
  114. </method>
  115. <method name="get_script_editor">
  116. <return type="ScriptEditor" />
  117. <description>
  118. Returns the editor's [ScriptEditor] instance.
  119. [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash.
  120. </description>
  121. </method>
  122. <method name="get_selected_path" qualifiers="const">
  123. <return type="String" />
  124. <description>
  125. Returns the path of the directory currently selected in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead.
  126. </description>
  127. </method>
  128. <method name="get_selection">
  129. <return type="EditorSelection" />
  130. <description>
  131. Returns the editor's [EditorSelection] instance.
  132. </description>
  133. </method>
  134. <method name="inspect_object">
  135. <return type="void" />
  136. <argument index="0" name="object" type="Object" />
  137. <argument index="1" name="for_property" type="String" default="&quot;&quot;" />
  138. <argument index="2" name="inspector_only" type="bool" default="false" />
  139. <description>
  140. Shows the given property on the given [code]object[/code] in the editor's Inspector dock. If [code]inspector_only[/code] is [code]true[/code], plugins will not attempt to edit [code]object[/code].
  141. </description>
  142. </method>
  143. <method name="is_playing_scene" qualifiers="const">
  144. <return type="bool" />
  145. <description>
  146. Returns [code]true[/code] if a scene is currently being played, [code]false[/code] otherwise. Paused scenes are considered as being played.
  147. </description>
  148. </method>
  149. <method name="is_plugin_enabled" qualifiers="const">
  150. <return type="bool" />
  151. <argument index="0" name="plugin" type="String" />
  152. <description>
  153. Returns [code]true[/code] if the specified [code]plugin[/code] is enabled. The plugin name is the same as its directory name.
  154. </description>
  155. </method>
  156. <method name="make_mesh_previews">
  157. <return type="Array" />
  158. <argument index="0" name="meshes" type="Array" />
  159. <argument index="1" name="preview_size" type="int" />
  160. <description>
  161. Returns mesh previews rendered at the given size as an [Array] of [Texture]s.
  162. </description>
  163. </method>
  164. <method name="open_scene_from_path">
  165. <return type="void" />
  166. <argument index="0" name="scene_filepath" type="String" />
  167. <description>
  168. Opens the scene at the given path.
  169. </description>
  170. </method>
  171. <method name="play_current_scene">
  172. <return type="void" />
  173. <description>
  174. Plays the currently active scene.
  175. </description>
  176. </method>
  177. <method name="play_custom_scene">
  178. <return type="void" />
  179. <argument index="0" name="scene_filepath" type="String" />
  180. <description>
  181. Plays the scene specified by its filepath.
  182. </description>
  183. </method>
  184. <method name="play_main_scene">
  185. <return type="void" />
  186. <description>
  187. Plays the main scene.
  188. </description>
  189. </method>
  190. <method name="reload_scene_from_path">
  191. <return type="void" />
  192. <argument index="0" name="scene_filepath" type="String" />
  193. <description>
  194. Reloads the scene at the given path.
  195. </description>
  196. </method>
  197. <method name="save_scene">
  198. <return type="int" enum="Error" />
  199. <description>
  200. Saves the scene. Returns either [code]OK[/code] or [code]ERR_CANT_CREATE[/code] (see [@GlobalScope] constants).
  201. </description>
  202. </method>
  203. <method name="save_scene_as">
  204. <return type="void" />
  205. <argument index="0" name="path" type="String" />
  206. <argument index="1" name="with_preview" type="bool" default="true" />
  207. <description>
  208. Saves the scene as a file at [code]path[/code].
  209. </description>
  210. </method>
  211. <method name="select_file">
  212. <return type="void" />
  213. <argument index="0" name="file" type="String" />
  214. <description>
  215. Selects the file, with the path provided by [code]file[/code], in the FileSystem dock.
  216. </description>
  217. </method>
  218. <method name="set_main_screen_editor">
  219. <return type="void" />
  220. <argument index="0" name="name" type="String" />
  221. <description>
  222. Sets the editor's current main screen to the one specified in [code]name[/code]. [code]name[/code] must match the text of the tab in question exactly ([code]2D[/code], [code]3D[/code], [code]Script[/code], [code]AssetLib[/code]).
  223. </description>
  224. </method>
  225. <method name="set_plugin_enabled">
  226. <return type="void" />
  227. <argument index="0" name="plugin" type="String" />
  228. <argument index="1" name="enabled" type="bool" />
  229. <description>
  230. Sets the enabled status of a plugin. The plugin name is the same as its directory name.
  231. </description>
  232. </method>
  233. <method name="stop_playing_scene">
  234. <return type="void" />
  235. <description>
  236. Stops the scene that is currently playing.
  237. </description>
  238. </method>
  239. </methods>
  240. <members>
  241. <member name="distraction_free_mode" type="bool" setter="set_distraction_free_mode" getter="is_distraction_free_mode_enabled">
  242. If [code]true[/code], enables distraction-free mode which hides side docks to increase the space available for the main view.
  243. </member>
  244. </members>
  245. <constants>
  246. </constants>
  247. </class>