[art] #9-2: extend sprite atlas + ui.js SPR + sprite_atlas.gd REGIONS for 11 portraits #19

Closed
opened 2026-09-24 15:16:11 +00:00 by Mark · 1 comment
Owner

Parent-Issue: #9

Depends on: #9-1 (portraits must exist first).

Extend the sprite atlas wiring to register 11 portrait regions. The portraits live at web/assets/portraits/<id>.png — NOT inside web/assets/sprites.png (separate file, separate layout).

Acceptance:

  • web/js/ui.js SPR map gains a PORTRAIT registry (or extend SPR with portrait-prefixed keys) pointing each unit id → { src: "assets/portraits/<id>.png", size: 96 }. (If a single atlas is preferred over per-file loads, extend web/assets/sprites.png with a portraits row and document the index.)
  • godot/scripts/sprite_atlas.gd REGIONS gains matching portrait entries (mirror the web side; the contract is "Identical numbering to web/js/ui.js SPR — single source of visual truth" per sprite_atlas.gd line 4)
  • All 11 portrait keys present on BOTH sides
  • make ci passes (lint, smoke tests)

Reference: existing SPR map at web/js/ui.js line 13, REGIONS at godot/scripts/sprite_atlas.gd line 10. Pick ONE layout decision (per-file PNG vs single-atlas extension) and write that decision into BOTH registries so the two stay in sync.

**Parent-Issue:** #9 **Depends on: #9-1 (portraits must exist first).** Extend the sprite atlas wiring to register 11 portrait regions. The portraits live at `web/assets/portraits/<id>.png` — NOT inside `web/assets/sprites.png` (separate file, separate layout). **Acceptance:** - `web/js/ui.js` SPR map gains a `PORTRAIT` registry (or extend SPR with portrait-prefixed keys) pointing each unit id → `{ src: "assets/portraits/<id>.png", size: 96 }`. (If a single atlas is preferred over per-file loads, extend `web/assets/sprites.png` with a portraits row and document the index.) - `godot/scripts/sprite_atlas.gd` REGIONS gains matching portrait entries (mirror the web side; the contract is "Identical numbering to web/js/ui.js SPR — single source of visual truth" per `sprite_atlas.gd` line 4) - All 11 portrait keys present on BOTH sides - `make ci` passes (lint, smoke tests) Reference: existing SPR map at `web/js/ui.js` line 13, REGIONS at `godot/scripts/sprite_atlas.gd` line 10. Pick ONE layout decision (per-file PNG vs single-atlas extension) and write that decision into BOTH registries so the two stay in sync. <!-- forgejo-id: Mark/cybertactics#9-2 -->
Author
Owner

Closed by commit a49b9a0 (cybertactics#19: register 11 portrait PNGs in PORTRAIT + SpriteAtlas.PORTRAIT_PATHS).

All four acceptance criteria met:

  • web/js/ui.js has PORTRAIT registry with all 11 ids, { src: assets/portraits/<id>.png, size: 96 } shape, plus a portraitFor(id) lazy loader
  • godot/scripts/sprite_atlas.gd has matching PORTRAIT_PATHS Dictionary + has_portrait() / load_portrait() helpers (parallel to existing REGIONS / load_texture() contract — same 11 ids, same per-file layout decision)
  • All 11 portrait keys (vex,diaz,rook,sable,jolt,halo,drone,ganger,heavy,sentry,wisp) verified present on BOTH sides via parity check
  • make ci PASS: 7 Node smokes + gdlint + Playwright UI smoke + Godot headless import all green; Godot successfully re-imported the 11 mirrored PNGs at godot/assets/portraits/<id>.png during the import gate

Layout decision written into both registries: per-file PNGs (NOT single-atlas extension). 11 PNGs mirrored from web/assets/portraits/ to godot/assets/portraits/ so Godot can resolve them via res://assets/portraits/<id>.png.

Closed by commit a49b9a0 (cybertactics#19: register 11 portrait PNGs in PORTRAIT + SpriteAtlas.PORTRAIT_PATHS). All four acceptance criteria met: - `web/js/ui.js` has `PORTRAIT` registry with all 11 ids, `{ src: assets/portraits/<id>.png, size: 96 }` shape, plus a `portraitFor(id)` lazy loader - `godot/scripts/sprite_atlas.gd` has matching `PORTRAIT_PATHS` Dictionary + `has_portrait()` / `load_portrait()` helpers (parallel to existing `REGIONS` / `load_texture()` contract — same 11 ids, same per-file layout decision) - All 11 portrait keys (vex,diaz,rook,sable,jolt,halo,drone,ganger,heavy,sentry,wisp) verified present on BOTH sides via parity check - `make ci` PASS: 7 Node smokes + gdlint + Playwright UI smoke + Godot headless import all green; Godot successfully re-imported the 11 mirrored PNGs at `godot/assets/portraits/<id>.png` during the import gate Layout decision written into both registries: **per-file PNGs** (NOT single-atlas extension). 11 PNGs mirrored from `web/assets/portraits/` to `godot/assets/portraits/` so Godot can resolve them via `res://assets/portraits/<id>.png`.
Sign in to join this conversation.
No description provided.