Let levels put pictures on the posters #30

Merged
James merged 1 commit from claudebot/poster-pictures into main 2026-10-14 16:27:14 +01:00 AGit
Contributor

Why

You wanted to hang clues on the classroom walls. The room already has 10 posters (poster_door_01 to _06, poster_back_01 to _03 and aberdare_way_poster), but a level had no way to change them. Now it can, the same way it already sets up wall displays: by naming the mesh.

"posters": { "poster_door_01": { "image": "images/clue.png" } }

image is a path under public/ or a web address, like the picture fields on clue and image stations.

What changed

  • Game (src/posters.js, src/main.js): when the team presses Start, each listed poster gets its picture. The picture is fitted inside the poster on white paper rather than cropped, so no part of a clue is cut off; portrait A4 shaped pictures fill it exactly. It keeps the poster's own material, so it is lit like the posters next to it instead of glowing like a screen. Posters not listed keep their own picture. A picture that will not load leaves the poster as it was and writes a warning to the console, rather than showing pupils a blank square.
  • Level format (level.schema.json): a new optional posters object. Names must start poster_ or end _poster, so a typo such as board_door_red is an error rather than being quietly ignored. Poster names missing from the model are warned about before Start, in the editor and on model upload, like stations and displays.
  • Editor: every poster has a label in the room view (above the poster, so the picture stays visible) and a box on the Level tab with a preview. Clicking a poster opens it on the Station tab. The picture shows on the wall in the room view once the box loses focus, so half-typed paths are not loaded.
  • Docs: README, SPEC and HANDOFF.

Worth knowing

In the ca02 model, display_left hangs over the back wall posters: poster_back_02 and poster_back_03 are completely hidden and poster_back_01 is half hidden. The 6 posters on the door wall and aberdare_way_poster are clear. This is in the README; fixing it means moving the display or the posters in Blender.

Checked

  • npm test: 121 pass, including new tests for the poster rules and the missing name warning.
  • npm run build passes.
  • In Chromium against a local API: set pictures in the editor, saved the room, checked /api/levels/BIN42 serves posters to players, then played it and looked at the wall. A portrait clue filled its poster, a landscape picture sat on white paper, and a missing file left the original poster with the console warning.
## Why You wanted to hang clues on the classroom walls. The room already has 10 posters (`poster_door_01` to `_06`, `poster_back_01` to `_03` and `aberdare_way_poster`), but a level had no way to change them. Now it can, the same way it already sets up wall displays: by naming the mesh. ```json "posters": { "poster_door_01": { "image": "images/clue.png" } } ``` `image` is a path under `public/` or a web address, like the picture fields on clue and image stations. ## What changed - **Game** (`src/posters.js`, `src/main.js`): when the team presses Start, each listed poster gets its picture. The picture is fitted inside the poster on white paper rather than cropped, so no part of a clue is cut off; portrait A4 shaped pictures fill it exactly. It keeps the poster's own material, so it is lit like the posters next to it instead of glowing like a screen. Posters not listed keep their own picture. A picture that will not load leaves the poster as it was and writes a warning to the console, rather than showing pupils a blank square. - **Level format** (`level.schema.json`): a new optional `posters` object. Names must start `poster_` or end `_poster`, so a typo such as `board_door_red` is an error rather than being quietly ignored. Poster names missing from the model are warned about before Start, in the editor and on model upload, like stations and displays. - **Editor**: every poster has a label in the room view (above the poster, so the picture stays visible) and a box on the Level tab with a preview. Clicking a poster opens it on the Station tab. The picture shows on the wall in the room view once the box loses focus, so half-typed paths are not loaded. - **Docs**: README, SPEC and HANDOFF. ## Worth knowing In the `ca02` model, `display_left` hangs over the back wall posters: `poster_back_02` and `poster_back_03` are completely hidden and `poster_back_01` is half hidden. The 6 posters on the door wall and `aberdare_way_poster` are clear. This is in the README; fixing it means moving the display or the posters in Blender. ## Checked - `npm test`: 121 pass, including new tests for the poster rules and the missing name warning. - `npm run build` passes. - In Chromium against a local API: set pictures in the editor, saved the room, checked `/api/levels/BIN42` serves `posters` to players, then played it and looked at the wall. A portrait clue filled its poster, a landscape picture sat on white paper, and a missing file left the original poster with the console warning.
Let levels put pictures on the posters
All checks were successful
Game and API image / ci-image (pull_request) Successful in 2s
Game and API image / test (pull_request) Successful in 10s
Game tests and build / build (pull_request) Successful in 15s
Game and API image / image (pull_request) Successful in 8s
Game and API image / deploy (pull_request) Has been skipped
8b7e36bd64
A level can now list posters by their mesh name and give each one a
picture, so clues can hang on the classroom walls:

  "posters": { "poster_door_01": { "image": "images/clue.png" } }

The game puts the picture on the poster when the team presses Start. It is
fitted inside the poster on white paper, so no part of a clue is cut off,
and it keeps the poster's own material so it is lit like the posters round
it. A picture that will not load leaves the poster as it was and writes a
warning to the console.

In the editor every poster has a label in the room and a box on the Level
tab, with a preview, and the picture shows on the wall in the room view.
Poster names not in the model are warned about like stations and displays.
James merged commit d73f8e5253 into main 2026-10-14 16:27:14 +01:00
Sign in to join this conversation.
No description provided.