1 editor viewport and world tools
forgejo-actions edited this page 2026-07-11 10:33:50 +00:00

Editor Viewport And World Tools

Purpose

The editor viewport is the bridge between scene-space authoring and the rest of the workbench. It owns camera input, hover state, coordinate projection, object focus, tile painting, placement tools, overlays, and world-space affordances for triggers, lights, sounds, mobs, NPCs, farming fields, and prefabs.

Steps

  1. Select the relevant viewport mode or scene object from the dock.
  2. Use hover and coordinate readouts to confirm the target tile or world position.
  3. Place or edit through the viewport action, not by mutating scene state from UI drawing code.
  4. Review overlay feedback for bounds, dependencies, nav masks, spawn safety, and authored object state.
  5. Run scene validation or the related domain validation after viewport placement changes.

Expected Outputs

Viewport actions should produce stable scene object ids, command-bus reports when applicable, mementos for undo/redo, and visual overlay feedback. Tile paint operations should update the scene tile data without losing layer bounds or selected tileset context.

Common Mistakes

Do not consume gameplay input while an egui text field or drag interaction has focus. Do not place objects outside the active scene bounds. Do not bypass command or memento paths for edits that need undo. Do not let overlay-only state become the source of truth for a scene object.

Recovery Paths

If hover or placement is offset, check camera projection and the coordinate HUD. If an object cannot be selected, confirm its scene id and inspection target. If tile painting writes the wrong layer, inspect the selected tileset, layer, and paint command. If overlays disagree with validation, rerun scene validation and repair the authored scene source.