Play through the first camera that is switched on
The game view took whatever camera came first in the scene, ignoring the switch, so `enabled = false` on a camera did nothing and a second camera never got its turn. `World.activeCamera()` now decides: of the cameras switched on – the whole parent chain counted, as for any object – the first in hierarchy order, and none on renders nothing at all. It is asked per frame, so a graph switching cameras hands the view over immediately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
75be133374
commit
37fff5dabf
8 files changed
+227
-13
No files matched your search
@@ -29,8 +29,10 @@ Live: <https://nockal.com/game-maker/> · Widget playground: <https://nockal.com
|
||||
**The camera defines what is rendered.** A camera asset has a view size (`width` × `height`,
|
||||
default 640×360) and a `zoom`; the frame it covers in world units is `size / zoom`. The Scene
|
||||
tab draws that frame as an outline. The Game tab renders only that frame – fitted into the
|
||||
view with black letterboxing – and objects outside it are culled. A scene without a camera
|
||||
renders nothing in the Game tab. Play has no built-in behaviour (no input, no movement):
|
||||
view with black letterboxing – and objects outside it are culled. Of several cameras the first
|
||||
one in hierarchy order that is **switched on** (`enabled`, its parents included) is the active
|
||||
one, so switching it off hands the view to the next; with none on nothing is rendered at all.
|
||||
Play has no built-in behaviour (no input, no movement):
|
||||
everything that happens is defined by behavior graphs.
|
||||
|
||||
**Editing while playing.** Play opens the Game tab but leaves the editor fully usable: the
|
||||
@@ -448,7 +450,7 @@ npm run format # Prettier over src, tests and tools
|
||||
npm run check # typecheck + lint + format:check + tests, what CI would run
|
||||
npm run build # writes dist/ and regenerates index.html
|
||||
export GM_REMOTE=user@host # where the browser runs; see below
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 330 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 337 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-jumprun.mjs && node tools/smoke-jumprun.mjs # 24 checks: the example game, played end to end
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user