EditorInterface.xml 9.3 KB

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