A browser-based editor for authoring Phaser-friendly 2D scenes: import sprites, arrange formations, attach simple action scripts, preview them instantly, and round-trip the whole project as YAML.
- Multi-scene projects with a per-scene world size.
- Sprite import (embedded file → data URL, or “asset path” reference), including a spritesheet frame picker and optional auto-hitbox.
- Canvas editing: drag sprites and formations, marquee multi-select, group / dissolve, grid snap, undo/redo, pan/zoom, fit/reset view.
- Formations (groups) can use declarative arrange layouts (grid, line, circle, arc, etc.) driven by
public/editor-registry.yaml. - Attached actions (current presets):
MoveUntil,Wait,Call, plusRepeatas a script-level wrapper. Callactions require a registered handler. The Studio preview scene registers a small call registry (for exampledrop); unknowncallIdvalues will fail during preview compile/run.- Inline conditions (current):
BoundsHitandElapsedTime(used byMoveUntil). - Preview mode compiles the authored scene and runs actions; Edit mode is for authoring.
Export YAMLserializes the currentProjectSpec(assets + scenes +initialSceneId) and saves it to disk.Load YAMLparses + validates YAML and migrates older scene schemas (legacybehaviors/actions/conditions) intoattachments.- Startup mode
Reload Last YAMLrestores the last exported/loaded YAML fromlocalStorage(configurable).
- Select: click a sprite / formation. Shift+click adds to multi-select. Drag on empty space to marquee-select (Shift adds).
- Move: drag selection; Arrow keys nudge (Shift+Arrow = 10px).
- Pan / zoom: mouse wheel zoom; middle-mouse drag or hold Space + drag to pan; use Fit/Reset buttons in the view bar.
- Shortcuts (Ctrl on Windows/Linux, Cmd on macOS):
- Undo / redo: Ctrl/Cmd+Z, Ctrl/Cmd+Shift+Z (or Ctrl/Cmd+Y)
- Toggle Edit/Preview: Tab
- Toggle grid snap: Ctrl/Cmd+G
- Group selection: Ctrl/Cmd+Shift+G
- Dissolve selected formation: Ctrl/Cmd+Shift+U
Node.js is required to install dependencies and run scripts via npm.
| Command | Description |
|---|---|
npm install |
Install project dependencies |
npm run dev |
Start the dev server (defaults to http://localhost:8080) |
npm run build |
Create a production build in dist/ |
npm test |
Run unit tests (Vitest) |
npm run test:e2e |
Run Playwright end-to-end tests |
npm run test:all |
Run unit + e2e tests |
npm run dev-nolog |
Dev server without anonymous logging (see below) |
npm run build-nolog |
Build without anonymous logging (see below) |
Note: For Playwright tests, you may need to run
npx playwright installonce to install browser binaries.
public/editor-config.yamlcontrols editor startup (e.g.startupMode).public/editor-registry.yamldefines which arrange layouts, action presets, and conditions the editor exposes (and which are markedimplemented: true).
src/editor/: React UI + editor store/reducer.src/phaser/: Phaser host +EditorSceneintegration (canvas interactions, selection, history, view).src/model/: YAML types, validation, and scene migration.src/compiler/: Compiles scene specs into runtime scripts.src/runtime/: Action/condition runtime used in Preview mode.
npm run dev / npm run build run node log.js ... in the background, which sends a lightweight anonymous GET request (event + Phaser version + package name). If you’d rather not send this, use npm run dev-nolog / npm run build-nolog.
