Docking, hierarchy, Inspector, diagnostics, and layout.
Workspace & panels
The editor is a native application window where you build a DemiEngine game by looking at it: a tree of the objects in your level, a live picture of the scene, and a form for the properties of whatever you selected. It exists because arranging levels and interfaces in JSON alone is slow and error-prone, while an editor that shares the engine's own loaders and validation stays honest about what the game will actually do.
Opening the workspace
demi editor
editor— launches the native editor application.
The editor is a docking workspace: each view and tool is an independent window that you can tile, stack as tabs, or leave floating inside the main application window. Drag an individual dock tab or window title to arrange it beside or below another. For example, put Terrain Graph beside Viewport, or Profiler beside Console. The default tab groups are starting positions; moving one tab does not move its neighbours.
Use View to show or hide individual panels and View → Reset Workspace to restore the default arrangement. Layout and visibility save per-user under the platform data directory, outside the project, generated content, packages and undo history. The independent-panel layout uses new v2 settings files; previous v1 files are left untouched.
Interface scale is adjustable in the editor settings, so the same workspace works on a small laptop screen and a high-density display.
Editing shortcuts and clipboard
Use the focused Hierarchy, Viewport, HUD/UI prefab or Terrain Graph to copy, cut, paste, duplicate and delete authored content. Terrain Nodes routes these shortcuts to its bound graph, rather than the selected scene entity. Text fields keep their normal text-editing shortcuts. Game View has its own input context, and the runtime Inspector and Hierarchy are read-only: authoring shortcuts there do not change the source scene.
| Action | Default |
|---|---|
| Copy / Cut / Paste | Ctrl+C / Ctrl+X / Ctrl+V |
| Duplicate / Select all | Ctrl+D / Ctrl+A |
| Delete | Delete or Backspace |
| Undo / Redo | Ctrl+Z / Ctrl+Shift+Z or Ctrl+Y |
| Save all / Refresh project | Ctrl+S / F5 |
| Frame scene selection or graph nodes | F |
| Rename scene entity / Create child entity | F2 / Ctrl+Shift+N |
| Release captured Game View input | Ctrl+D in Game View |
Choose Edit → Editor Settings → Keyboard shortcuts to change a binding, add an alternative, clear an optional binding or restore defaults. Conflicts within overlapping contexts are rejected. Cursor release must keep at least one binding. Mappings save automatically in your user preferences, not in a game project or package. Toolbar tooltips and menu shortcuts show your current mappings.
Common toolbar actions use vector icons with tooltips; property labels remain visible. Scene and HUD selections support Ctrl-click and Select All. Copying selected parents and children includes each subtree only once. Pasting creates fresh stable IDs and remaps internal typed references while preserving asset, script and prefab URIs. Prefab instances stay instances; open their source to edit inherited children. Graph clipboard operations preserve node parameters and links between the copied nodes. Paste, duplicate, cut and multi-delete are undoable as a single edit.
The system clipboard uses a versioned authoring payload, so incompatible or malformed content is rejected without changing the document. Clipboard actions operate on authored objects and graph nodes, not arbitrary source-file operations in the Assets browser. Drag entities to Assets to create prefabs, or drag existing assets into the relevant authoring view.
The panels
Every panel below has a stable window identity and its own visibility preference. The default layout groups related windows as dock tabs:
- Centre: Viewport, Prefab, HUD, Terrain Graph, Terrain Asset and Game View. Document-specific views become available when their document is open.
- Right: Inspector, UI Palette, Terrain Nodes and Terrain Presets. Palettes appear only in their editing context.
- Bottom: Console, Lua Console, Profiler and Debug share a default dock, beside Assets.
- Left: Hierarchy follows the active authored document or running game.
Hierarchy
The hierarchy is a tree of everything in the active document: scene entities, HUD nodes, or prefab entities. It answers "what exists?" and "what is inside what?".
- Rows are keyed by stable IDs, the same IDs your JSON documents and scripts use. Renaming a display label never changes an ID.
- Children nest under their owner. Visually meaningful local structure — a weapon under a hand, a label under a button — is authored as a
childrenarray and shown nested here. - Selection is shared with the viewport and the Inspector: click a row to select it everywhere. Selecting an object in the Viewport or a control on the HUD canvas opens its ancestor branches and scrolls the selected row into view. Creating or dropping a selected control does the same. Selecting the same object again reveals it after a manual collapse; unchanged selection does not keep reopening branches. An external selection clears a stale Hierarchy search so the row can be shown.
Inspector
The Inspector is a form for the selected object. It answers "what are its properties?".
- It lists each component on the object and that component's fields — transforms, sprites, bodies, lights, and so on.
- For Lua scripts with
@demi_componentand@demi_propertyannotations, it also shows the script's typed properties so gameplay data is editable without opening the script. Drag a Hierarchy object onto anentityproperty to assign its stable ID, or use the picker and None. Native entity-reference fields accept the same drops. - Controls let you add and remove components. Field edits are applied through the same typed value model the runtime uses.
- Omitted fields show their canonical component defaults; values you type become explicit in the document.
Framing a game camera
Arrange the scene Viewport using its normal navigation, then select one camera in Hierarchy. Choose Scene → Align selected camera to view, or the matching camera button beside the existing view-to-camera action. The selected camera must have a matching Transform2D or Transform3D component for the current view dimension. The action is disabled in Play mode.
For a 3D camera, alignment copies the view's position, aim, projection mode, active lens setting and clipping distances. Parent translation, rotation and scale are taken into account; the camera's scale and parent remain unchanged. For 2D, it copies position and orthographic size. A parent with zero scale cannot be inverted, so alignment reports an error without changing the document.
Clear colour, render targets, viewport rectangles, masks, priority, HUD and follow settings remain unchanged. Game View may have a different aspect ratio, and gameplay scripts or camera-follow settings may subsequently move the camera. Prefab cameras receive instance overrides. The whole alignment is one Undo step, and Save writes the authored changes. The existing Align view to the first authored camera button moves only the editor view.
Viewport
The canvas has no redundant HUD/projection badge or selection-status caption. Use the dock tab and projection toolbar for view context, and Hierarchy/Inspector for the current selection.
Viewport shows the scene. Prefab, HUD and Terrain Asset have their own authoring windows; Game View shows the isolated play session. These views answer "what does it look like?" and can be arranged beside the tools you use to edit them.
- Scene and HUD views render to GPU targets displayed as images inside the panel, so they composite correctly with docking. You can freely drag the panel without display glitches.
- Click objects to select them; the hierarchy and Inspector follow.
- Debug overlays (colliders, contacts, grid, entity IDs, draw order, UI bounds, profiler) can be toggled for this view.
Diagnostics
Console lists validation problems in the active document and everything it references. It uses the same diagnostic codes as demi validate on the command line, so a code you see here can be grepped in build logs and continuous integration output. Selecting a diagnostic jumps to the offending object. Lua Console, Profiler and Debug are separate windows; you can keep them visible beside Console rather than switching internal tabs.
Profiler
The resource overview separates Editor + Game process CPU/RAM from the Lua VM heap. Process CPU uses 100% per logical CPU, and peak RAM is a process-lifetime value. Lua heap usage can rise and fall as automatic garbage collection reclaims memory.
The profiler panel shows frame timing while the game runs in play mode: total frame time and per-scope costs. It is the in-editor view of the same measurement data as the command-line profiler. Use it to find the slow part, then confirm with the reports described in Replay & profiler.
Stages: scene, HUD, and prefab
The editor starts maximized in the display's available work area. It remains resizable and windowed, so desktop panels and window controls stay available.
Scene, prefab, HUD/UI prefab and terrain asset views use the same editing tools, but retain distinct document state. Each open session keeps its own source, selection and Undo/Redo history. Focusing another view changes what Inspector and Hierarchy show; it does not replace the document displayed in an unfocused view.
| Stage | Document | What you author |
|---|---|---|
| Scene | *.scene.json | Entities, components, prefab instances — a level or screen of the game. |
| HUD | *.hud.json | Interface node trees — buttons, panels, labels, virtual controls. |
| Prefab | *.prefab.json | Reusable entity compositions placed by scenes and other prefabs. |
A scene's attached HUD opens in an independent HUD session when you enter HUD editing. Explicitly opened HUDs and UI prefabs use that same session. With HUD and Viewport side by side, clicking the scene leaves the HUD's opened source and selection intact. Save all includes the open sessions and checks for conflicting unsaved edits to the same source before writing. Authoring flow is covered on Authoring scenes & HUDs.
Terrain Graph is pinned to the terrain owner you opened it for. Selecting a camera, another object or another terrain in Inspector does not retarget the open graph or change its draft. To open another terrain's graph, generate or discard the current draft and finish any pending generation or brush stroke first. Viewport brushes require the bound terrain to be selected.
Inspector contains the selected object's properties. The two drag-and-drop palettes are separate dockable windows:
- UI Palette appears while editing a HUD or UI prefab. Search controls and project UI prefabs, then drag a card onto the HUD canvas. It is hidden when you leave HUD editing.
- Terrain Nodes appears while working in Terrain Graph. Search graph node types, then drag one onto the graph canvas.
Clicking Inspector or the active palette keeps that editing context and its palette available, including its toggle in the View menu. Switching to another authoring context hides the previous palette without changing your visibility preference or dock location. Dragging a card carries its stable module ID, so the destination resolves the current definition before authoring. These palettes are authoring tools, not installed engine packages.
Shared rules with the CLI
The editor is not a second engine. It uses the same loaders, metadata, diagnostics, importer, build service, cook, and package paths as demi commands:
- A document the Inspector accepts is a document Build, cook & test will validate.
- Asset IDs and URI references behave the same here and in Lua (
asset://,prefab://,scene://,ui-prefab://,script://). - Saves patch source JSON with small diffs and preserve formatting — the file on disk after an editor save is reviewable.
What the editor does not do to your data
- Dock layout and panel visibility are per-user and never stored in the project.
- Play mode runs in an isolated runtime world and must not mutate authored scene data (see Play mode).
- Saves are atomic and conflict-aware: a failed write leaves the previous file intact.
Continue with Authoring scenes & HUDs for the editing workflow, or demi.project.json for the document roots the workspace organizes.