2
0

EditorInterface.xml 9.7 KB

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