From 82dd9f1b774aa17640e07fc0bbf5dc9ca9afe880 Mon Sep 17 00:00:00 2001 From: meleki Date: Sun, 27 Sep 2026 12:58:01 +0200 Subject: [PATCH] Describe the scene tab header and Fit on the camera (#245) Co-Authored-By: Claude Opus 5.5 --- Architecture.md | 3 ++- Development.md | 2 +- Scene-editing.md | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Architecture.md b/Architecture.md index d0f1d32..39570a4 100644 --- a/Architecture.md +++ b/Architecture.md @@ -198,7 +198,8 @@ src/editor/panels/ AssetPanel, assetGroups (groups by type and their order, plus the List, Game, Plugins and User management tabs' own four, which stand for no asset), assetMenu (the two groups of the + menu), HierarchyPanel + hierarchyDrop (#241: what dropping a row does, group rows included) + GroupNameDialog, - Toolbar + toolbarIcons (icon buttons, no captions: menu, undo, redo, play, pause, #183, and the eye), + Toolbar + toolbarIcons (icon buttons, no captions: menu, undo, redo, play, pause, #183, and the eye + the scene tab's header wears, see ScenePane), SceneVisibilityPopup (behind the eye: symbol, name and collider outline per type), headerIcons (the pictures of the tab headers' switches: the magnet, #194), markIcons (the kind marks, the row actions reset, apply and the two fit arrows, and a diff --git a/Development.md b/Development.md index 0bf367b..8d1c47c 100644 --- a/Development.md +++ b/Development.md @@ -15,7 +15,7 @@ npm run build # writes dist/ and regenerates index.html php tools/make-user.php [admin|user] # an account; every tool signs in (see Accounts) php tests/php/accounts.test.php # the API's account rules, no server needed (CI's gate job) php tests/php/snapshots.test.php # the snapshot store (#231), the same way -node tools/seed-e2e.mjs && node tools/e2e.mjs # 1455 editor checks, screenshots in /tmp/gm-e2e-*.png +node tools/seed-e2e.mjs && node tools/e2e.mjs # 1457 editor checks, screenshots in /tmp/gm-e2e-*.png GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step ./e2e.sh start [GM_STEPS] # the same run detached, see below ./e2e.sh status # live progress, or the last run's result diff --git a/Scene-editing.md b/Scene-editing.md index 305bceb..6e43a39 100644 --- a/Scene-editing.md +++ b/Scene-editing.md @@ -10,14 +10,24 @@ Dragging is the only way to place: a double-click on an asset opens its tab (a s the active one), it never places. **Zoom in whole steps.** The wheel in the Scene and Container tabs and in the animation preview -moves the zoom one step at a time: 1/8, 1/4, 1/2, then 1 to 6, 8, 12, 16 and 24 screen pixels per -world pixel. A mouse notch is one step, a trackpad takes one every 50 pixels of scrolling. *Fit* rounds +moves the zoom one step at a time: 1/8, 1/4, 1/2, then 1 to 6, 8, 12, 16, 24, 32, 48 and 64 screen +pixels per world pixel. A mouse notch is one step, a trackpad takes one every 50 pixels of scrolling. *Fit* rounds down to the step that still fits. The steps count **device** pixels, so zoom 1 stays one screen pixel per world pixel even with Windows display scaling at 125% or 150%. With every texel getting the same number of screen pixels, pixel art never shows one pixel wider than its neighbour, wherever the view is panned. Sprites that are turned or scaled by an odd factor still cannot be even. +**Fit in the Scene tab frames what the game shows.** The Scene tab has a header bar like every +other tab, with **Fit** and the eye. With a camera switched on, *Fit* shows the world exactly as +the Game tab does at the scale picked there: the same zoom and the camera's centre on the same +screen pixel, so switching between the two tabs moves nothing (`freeViewOfCamera`, +`src/viewport/view.ts`). At *Auto* that is a whole step, at *Fit* the fraction the Game tab came +to. The camera is the one the Game tab previews when nothing is playing. The two views +match only while they are the same size: with the tilemap panel open beside the scene view, the +view is narrower and *Auto* may come to a smaller step. Without a camera, *Fit* frames the whole +content in a whole step as before. + **Editor symbols are always on top.** The viewport draws scene content (sprites) in an `objects` layer and editor symbols (camera icon, labels) in an `overlay` layer above it, so a sprite can never hide a symbol regardless of z or hierarchy order. A viewport label keeps a @@ -59,7 +69,7 @@ on until the row is free (`stackLabels`, `src/viewport/labelRows.ts`). Names are bottom, so the upper of two keeps its row, and a name only moves up or down: it stays on its icon's side. Names off screen take their row as well, so none jumps while the view pans. -**The eye in the top bar picks what the Scene tab shows.** Beside redo, the eye opens a list of +**The eye picks what the Scene tab shows.** Beside *Fit* in the tab's header, the eye opens a list of every type that can be placed, Behavior to Tilemap, and per type up to three switches: **Symbol** (its icon), **Name** (its name plate) and **Shape**: on a collider its outline, on a tilemap the outline of its solid cells, while the map's tiles stay drawn. Sprite,