EditorInterface.xml 8.7 KB

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