Understanding and customizing the Godot Editor interface
The Godot Editor interface provides a comprehensive environment for game development. The EditorInterface singleton gives you programmatic access to all major editor components.
The main screen hosts the primary workspace tabs (2D, 3D, Script, Game, AssetLib):
# Get the main screen containervar main_screen = EditorInterface.get_editor_main_screen()# Switch to a specific workspaceEditorInterface.set_main_screen_editor("3D")
// In C# you can access it via the static Singleton propertyVBoxContainer mainScreen = EditorInterface.Singleton.GetEditorMainScreen();// Switch workspaceEditorInterface.Singleton.SetMainScreenEditor("3D");
The main screen node is a VBoxContainer. If you add a child Control, set its size_flags_vertical to SIZE_EXPAND_FILL to make it use the full available space.
Access the editor viewports for custom rendering or camera manipulation:
# Get the 2D viewportvar viewport_2d = EditorInterface.get_editor_viewport_2d()# Access canvas transform directlyvar canvas_transform = viewport_2d.global_canvas_transform# Get 3D viewports (0-3 for different views)var viewport_3d = EditorInterface.get_editor_viewport_3d(0)var camera = viewport_3d.get_camera_3d()
The 2D viewport does not have a camera. View transforms are done directly using global_canvas_transform.
The scene tree displays the hierarchy of nodes in your current scene:
# Get the currently edited scene rootvar scene_root = EditorInterface.get_edited_scene_root()# Edit a specific node (selects it in the tree)EditorInterface.edit_node(some_node)
The filesystem dock shows your project’s files and directories:
# Get the FileSystemDock instancevar fs_dock = EditorInterface.get_file_system_dock()# Get current directory being viewedvar current_dir = EditorInterface.get_current_directory()var current_path = EditorInterface.get_current_path()# Select a file in the filesystemEditorInterface.select_file("res://icon.svg")# Get selected filesvar selected = EditorInterface.get_selected_paths()
The inspector shows and edits properties of the selected node or resource:
# Get the inspector instancevar inspector = EditorInterface.get_inspector()# Inspect an objectEditorInterface.inspect_object(my_object)# Inspect a specific propertyEditorInterface.inspect_object(my_object, "position", false)
Access and modify editor settings programmatically:
# Get editor settingsvar settings = EditorInterface.get_editor_settings()# Get editor scalevar scale = EditorInterface.get_editor_scale()# Get editor themevar theme = EditorInterface.get_editor_theme()# Get editor languagevar language = EditorInterface.get_editor_language()
# Get open scenesvar open_scenes = EditorInterface.get_open_scenes()var open_roots = EditorInterface.get_open_scene_roots()# Check for unsaved changesvar unsaved = EditorInterface.get_unsaved_scenes()# Save operationsEditorInterface.save_scene() # Save current sceneEditorInterface.save_all_scenes() # Save all open scenesEditorInterface.save_scene_as("res://new_scene.tscn")# Open/reload scenesEditorInterface.open_scene_from_path("res://main.tscn")EditorInterface.reload_scene_from_path("res://main.tscn")# Mark scene as modifiedEditorInterface.mark_scene_as_unsaved()