EditorInterface.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorInterface" inherits="Node" version="3.4">
  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. </return>
  16. <argument index="0" name="node" type="Node">
  17. </argument>
  18. <description>
  19. Edits the given [Node]. The node will be also selected if it's inside the scene tree.
  20. </description>
  21. </method>
  22. <method name="edit_resource">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="resource" type="Resource">
  26. </argument>
  27. <description>
  28. Edits the given [Resource].
  29. </description>
  30. </method>
  31. <method name="get_base_control">
  32. <return type="Control">
  33. </return>
  34. <description>
  35. 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.
  36. </description>
  37. </method>
  38. <method name="get_current_path" qualifiers="const">
  39. <return type="String">
  40. </return>
  41. <description>
  42. Returns the current path being viewed in the [FileSystemDock].
  43. </description>
  44. </method>
  45. <method name="get_edited_scene_root">
  46. <return type="Node">
  47. </return>
  48. <description>
  49. Returns the edited (current) scene's root [Node].
  50. </description>
  51. </method>
  52. <method name="get_editor_scale" qualifiers="const">
  53. <return type="float">
  54. </return>
  55. <description>
  56. 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.
  57. [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.
  58. </description>
  59. </method>
  60. <method name="get_editor_settings">
  61. <return type="EditorSettings">
  62. </return>
  63. <description>
  64. Returns the editor's [EditorSettings] instance.
  65. </description>
  66. </method>
  67. <method name="get_editor_viewport">
  68. <return type="Control">
  69. </return>
  70. <description>
  71. Returns the main editor control. Use this as a parent for main screens.
  72. [b]Note:[/b] This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.
  73. </description>
  74. </method>
  75. <method name="get_file_system_dock">
  76. <return type="FileSystemDock">
  77. </return>
  78. <description>
  79. Returns the editor's [FileSystemDock] instance.
  80. </description>
  81. </method>
  82. <method name="get_inspector" qualifiers="const">
  83. <return type="EditorInspector">
  84. </return>
  85. <description>
  86. Returns the editor's [EditorInspector] instance.
  87. </description>
  88. </method>
  89. <method name="get_open_scenes" qualifiers="const">
  90. <return type="Array">
  91. </return>
  92. <description>
  93. Returns an [Array] with the file paths of the currently opened scenes.
  94. </description>
  95. </method>
  96. <method name="get_playing_scene" qualifiers="const">
  97. <return type="String">
  98. </return>
  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. </return>
  106. <description>
  107. Returns the editor's [EditorFileSystem] instance.
  108. </description>
  109. </method>
  110. <method name="get_resource_previewer">
  111. <return type="EditorResourcePreview">
  112. </return>
  113. <description>
  114. Returns the editor's [EditorResourcePreview] instance.
  115. </description>
  116. </method>
  117. <method name="get_script_editor">
  118. <return type="ScriptEditor">
  119. </return>
  120. <description>
  121. Returns the editor's [ScriptEditor] instance.
  122. </description>
  123. </method>
  124. <method name="get_selected_path" qualifiers="const">
  125. <return type="String">
  126. </return>
  127. <description>
  128. 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.
  129. </description>
  130. </method>
  131. <method name="get_selection">
  132. <return type="EditorSelection">
  133. </return>
  134. <description>
  135. Returns the editor's [EditorSelection] instance.
  136. </description>
  137. </method>
  138. <method name="inspect_object">
  139. <return type="void">
  140. </return>
  141. <argument index="0" name="object" type="Object">
  142. </argument>
  143. <argument index="1" name="for_property" type="String" default="&quot;&quot;">
  144. </argument>
  145. <argument index="2" name="inspector_only" type="bool" default="false">
  146. </argument>
  147. <description>
  148. 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].
  149. </description>
  150. </method>
  151. <method name="is_playing_scene" qualifiers="const">
  152. <return type="bool">
  153. </return>
  154. <description>
  155. Returns [code]true[/code] if a scene is currently being played, [code]false[/code] otherwise. Paused scenes are considered as being played.
  156. </description>
  157. </method>
  158. <method name="is_plugin_enabled" qualifiers="const">
  159. <return type="bool">
  160. </return>
  161. <argument index="0" name="plugin" type="String">
  162. </argument>
  163. <description>
  164. Returns [code]true[/code] if the specified [code]plugin[/code] is enabled. The plugin name is the same as its directory name.
  165. </description>
  166. </method>
  167. <method name="make_mesh_previews">
  168. <return type="Array">
  169. </return>
  170. <argument index="0" name="meshes" type="Array">
  171. </argument>
  172. <argument index="1" name="preview_size" type="int">
  173. </argument>
  174. <description>
  175. Returns mesh previews rendered at the given size as an [Array] of [Texture]s.
  176. </description>
  177. </method>
  178. <method name="open_scene_from_path">
  179. <return type="void">
  180. </return>
  181. <argument index="0" name="scene_filepath" type="String">
  182. </argument>
  183. <description>
  184. Opens the scene at the given path.
  185. </description>
  186. </method>
  187. <method name="play_current_scene">
  188. <return type="void">
  189. </return>
  190. <description>
  191. Plays the currently active scene.
  192. </description>
  193. </method>
  194. <method name="play_custom_scene">
  195. <return type="void">
  196. </return>
  197. <argument index="0" name="scene_filepath" type="String">
  198. </argument>
  199. <description>
  200. Plays the scene specified by its filepath.
  201. </description>
  202. </method>
  203. <method name="play_main_scene">
  204. <return type="void">
  205. </return>
  206. <description>
  207. Plays the main scene.
  208. </description>
  209. </method>
  210. <method name="reload_scene_from_path">
  211. <return type="void">
  212. </return>
  213. <argument index="0" name="scene_filepath" type="String">
  214. </argument>
  215. <description>
  216. Reloads the scene at the given path.
  217. </description>
  218. </method>
  219. <method name="save_scene">
  220. <return type="int" enum="Error">
  221. </return>
  222. <description>
  223. Saves the scene. Returns either [code]OK[/code] or [code]ERR_CANT_CREATE[/code] (see [@GlobalScope] constants).
  224. </description>
  225. </method>
  226. <method name="save_scene_as">
  227. <return type="void">
  228. </return>
  229. <argument index="0" name="path" type="String">
  230. </argument>
  231. <argument index="1" name="with_preview" type="bool" default="true">
  232. </argument>
  233. <description>
  234. Saves the scene as a file at [code]path[/code].
  235. </description>
  236. </method>
  237. <method name="select_file">
  238. <return type="void">
  239. </return>
  240. <argument index="0" name="file" type="String">
  241. </argument>
  242. <description>
  243. Selects the file, with the path provided by [code]file[/code], in the FileSystem dock.
  244. </description>
  245. </method>
  246. <method name="set_main_screen_editor">
  247. <return type="void">
  248. </return>
  249. <argument index="0" name="name" type="String">
  250. </argument>
  251. <description>
  252. 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]).
  253. </description>
  254. </method>
  255. <method name="set_plugin_enabled">
  256. <return type="void">
  257. </return>
  258. <argument index="0" name="plugin" type="String">
  259. </argument>
  260. <argument index="1" name="enabled" type="bool">
  261. </argument>
  262. <description>
  263. Sets the enabled status of a plugin. The plugin name is the same as its directory name.
  264. </description>
  265. </method>
  266. <method name="stop_playing_scene">
  267. <return type="void">
  268. </return>
  269. <description>
  270. Stops the scene that is currently playing.
  271. </description>
  272. </method>
  273. </methods>
  274. <members>
  275. <member name="distraction_free_mode" type="bool" setter="set_distraction_free_mode" getter="is_distraction_free_mode_enabled">
  276. If [code]true[/code], enables distraction-free mode which hides side docks to increase the space available for the main view.
  277. </member>
  278. </members>
  279. <constants>
  280. </constants>
  281. </class>