EditorInterface

Godot editor's interface.

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. Note: This class shouldn't be instantiated directly. Instead, access the singleton using EditorPlugin.getEditorInterface.

@GodotBaseClass
struct EditorInterface {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

editNode
void editNode(Node node)

Edits the given Node. The node will be also selected if it's inside the scene tree.

editResource
void editResource(Resource resource)

Edits the given Resource.

getBaseControl
Control getBaseControl()

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.

getCurrentPath
String getCurrentPath()

Returns the current path being viewed in the FileSystemDock.

getEditedSceneRoot
Node getEditedSceneRoot()

Returns the edited (current) scene's root Node.

getEditorScale
double getEditorScale()

Returns the actual scale of the editor UI (1.0 being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins. Note: This value is set via the interface/editor/display_scale and interface/editor/custom_display_scale editor settings. Editor must be restarted for changes to be properly applied.

getEditorSettings
Ref!EditorSettings getEditorSettings()

Returns the editor's EditorSettings instance.

getEditorViewport
Control getEditorViewport()

Returns the main editor control. Use this as a parent for main screens. Note: This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically.

getFileSystemDock
FileSystemDock getFileSystemDock()

Returns the editor's FileSystemDock instance.

getInspector
EditorInspector getInspector()

Returns the editor's EditorInspector instance.

getOpenScenes
Array getOpenScenes()

Returns an Array with the file paths of the currently opened scenes.

getPlayingScene
String getPlayingScene()

Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.

getResourceFilesystem
EditorFileSystem getResourceFilesystem()

Returns the editor's EditorFileSystem instance.

getResourcePreviewer
EditorResourcePreview getResourcePreviewer()

Returns the editor's EditorResourcePreview instance.

getScriptEditor
ScriptEditor getScriptEditor()

Returns the editor's ScriptEditor instance.

getSelectedPath
String getSelectedPath()

Returns the path of the directory currently selected in the FileSystemDock. If a file is selected, its base directory will be returned using String.getBaseDir instead.

getSelection
EditorSelection getSelection()

Returns the editor's EditorSelection instance.

inspectObject
void inspectObject(GodotObject object, String for_property, bool inspector_only)

Shows the given property on the given object in the editor's Inspector dock. If inspector_only is true, plugins will not attempt to edit object.

isDistractionFreeModeEnabled
bool isDistractionFreeModeEnabled()
isPlayingScene
bool isPlayingScene()

Returns true if a scene is currently being played, false otherwise. Paused scenes are considered as being played.

isPluginEnabled
bool isPluginEnabled(String plugin)

Returns true if the specified plugin is enabled. The plugin name is the same as its directory name.

makeMeshPreviews
Array makeMeshPreviews(Array meshes, long preview_size)

Returns mesh previews rendered at the given size as an Array of Textures.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(EditorInterface other)
opEquals
bool opEquals(typeof(null) n)
openSceneFromPath
void openSceneFromPath(String scene_filepath)

Opens the scene at the given path.

playCurrentScene
void playCurrentScene()

Plays the currently active scene.

playCustomScene
void playCustomScene(String scene_filepath)

Plays the scene specified by its filepath.

playMainScene
void playMainScene()

Plays the main scene.

reloadSceneFromPath
void reloadSceneFromPath(String scene_filepath)

Reloads the scene at the given path.

saveScene
GodotError saveScene()

Saves the scene. Returns either OK or ERR_CANT_CREATE (see @GlobalScope constants).

saveSceneAs
void saveSceneAs(String path, bool with_preview)

Saves the scene as a file at path.

selectFile
void selectFile(String file)

Selects the file, with the path provided by file, in the FileSystem dock.

setDistractionFreeMode
void setDistractionFreeMode(bool enter)
setMainScreenEditor
void setMainScreenEditor(String name)

Sets the editor's current main screen to the one specified in name. name must match the text of the tab in question exactly (2D, 3D, Script, AssetLib).

setPluginEnabled
void setPluginEnabled(String plugin, bool enabled)

Sets the enabled status of a plugin. The plugin name is the same as its directory name.

stopPlayingScene
void stopPlayingScene()

Stops the scene that is currently playing.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

distractionFreeMode
bool distractionFreeMode [@property getter]
bool distractionFreeMode [@property setter]

If true, enables distraction-free mode which hides side docks to increase the space available for the main view.

Static functions

_new
EditorInterface _new()

Construct a new instance of EditorInterface. Note: use memnew!EditorInterface instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta