Let levels put pictures on the posters #30
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
James/Escape-Room!30
Loading…
Reference in a new issue
No description provided.
Delete branch "claudebot/poster-pictures"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
You wanted to hang clues on the classroom walls. The room already has 10 posters (
poster_door_01to_06,poster_back_01to_03andaberdare_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.imageis a path underpublic/or a web address, like the picture fields on clue and image stations.What changed
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.schema.json): a new optionalpostersobject. Names must startposter_or end_poster, so a typo such asboard_door_redis 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.Worth knowing
In the
ca02model,display_lefthangs over the back wall posters:poster_back_02andposter_back_03are completely hidden andposter_back_01is half hidden. The 6 posters on the door wall andaberdare_way_posterare 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 buildpasses./api/levels/BIN42servespostersto 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.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.