@the-inclusionist/engine 9.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -78
- package/app/css/style.css +761 -377
- package/app/public/vendor/fonts/playwrite-cu.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es-deco.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-j.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-s.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pe.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pt.woff2 +0 -0
- package/app/public/vendor/fonts-licences/NOTICE.txt +166 -0
- package/app/public/vendor/fonts-licences/OFL-1.1.txt +86 -0
- package/app/public/vendor/fonts.css +36 -84
- package/dist-pkg/boot/create-game.d.ts +499 -219
- package/dist-pkg/boot/create-game.js +3944 -562
- package/dist-pkg/core/a11y-sr.d.ts +25 -3
- package/dist-pkg/core/a11y-sr.js +38 -19
- package/dist-pkg/core/accessible-label.d.ts +17 -0
- package/dist-pkg/core/accessible-label.js +37 -0
- package/dist-pkg/core/accommodation-subjects.d.ts +26 -0
- package/dist-pkg/core/accommodation-subjects.js +32 -0
- package/dist-pkg/core/accommodations.d.ts +125 -0
- package/dist-pkg/core/accommodations.js +195 -0
- package/dist-pkg/core/actions.d.ts +108 -55
- package/dist-pkg/core/actions.js +122 -71
- package/dist-pkg/core/calm-mode.d.ts +31 -0
- package/dist-pkg/core/calm-mode.js +47 -0
- package/dist-pkg/core/camera-cycle.d.ts +15 -0
- package/dist-pkg/core/camera-cycle.js +7 -0
- package/dist-pkg/core/caption-duration.d.ts +15 -0
- package/dist-pkg/core/caption-duration.js +19 -0
- package/dist-pkg/core/cartridge-problems.d.ts +34 -0
- package/dist-pkg/core/cartridge-problems.js +53 -0
- package/dist-pkg/core/constants.d.ts +0 -54
- package/dist-pkg/core/constants.js +9 -76
- package/dist-pkg/core/contract.d.ts +142 -164
- package/dist-pkg/core/contract.js +222 -208
- package/dist-pkg/core/dom-query.d.ts +4 -4
- package/dist-pkg/core/dom-query.js +12 -20
- package/dist-pkg/core/entity.d.ts +62 -77
- package/dist-pkg/core/entity.js +18 -32
- package/dist-pkg/core/escape-html.d.ts +9 -10
- package/dist-pkg/core/escape-html.js +16 -20
- package/dist-pkg/core/flash-threshold.d.ts +17 -0
- package/dist-pkg/core/flash-threshold.js +113 -0
- package/dist-pkg/core/game-speed.d.ts +11 -0
- package/dist-pkg/core/game-speed.js +16 -0
- package/dist-pkg/core/genres.d.ts +20 -0
- package/dist-pkg/core/genres.js +44 -0
- package/dist-pkg/core/i18n.d.ts +71 -60
- package/dist-pkg/core/i18n.js +186 -200
- package/dist-pkg/core/loop.d.ts +17 -6
- package/dist-pkg/core/loop.js +26 -26
- package/dist-pkg/core/pause-icon-catalogue.d.ts +15 -0
- package/dist-pkg/core/pause-icon-catalogue.js +54 -0
- package/dist-pkg/core/ring.d.ts +17 -0
- package/dist-pkg/core/ring.js +29 -0
- package/dist-pkg/core/rng.d.ts +7 -12
- package/dist-pkg/core/rng.js +23 -53
- package/dist-pkg/core/route.d.ts +26 -26
- package/dist-pkg/core/route.js +126 -121
- package/dist-pkg/core/scenes.d.ts +37 -40
- package/dist-pkg/core/scenes.js +41 -43
- package/dist-pkg/core/screens.d.ts +4 -4
- package/dist-pkg/core/screens.js +11 -16
- package/dist-pkg/core/session-clock.d.ts +23 -0
- package/dist-pkg/core/session-clock.js +37 -0
- package/dist-pkg/core/setting-defaults.d.ts +61 -0
- package/dist-pkg/core/setting-defaults.js +66 -0
- package/dist-pkg/core/speech-rate.d.ts +29 -0
- package/dist-pkg/core/speech-rate.js +47 -0
- package/dist-pkg/core/state.d.ts +118 -118
- package/dist-pkg/core/state.js +322 -297
- package/dist-pkg/core/visual-cycles.d.ts +30 -0
- package/dist-pkg/core/visual-cycles.js +52 -0
- package/dist-pkg/core/visual-state.d.ts +13 -0
- package/dist-pkg/core/visual-state.js +6 -0
- package/dist-pkg/educational/activities-registry.d.ts +1 -1
- package/dist-pkg/educational/activities-registry.js +9 -8
- package/dist-pkg/educational/adaptive-engine.d.ts +11 -11
- package/dist-pkg/educational/adaptive-engine.js +17 -17
- package/dist-pkg/educational/segment-bar.d.ts +12 -12
- package/dist-pkg/educational/segment-bar.js +9 -9
- package/dist-pkg/i18n/en.js +324 -223
- package/dist-pkg/i18n/es.js +323 -223
- package/dist-pkg/i18n/pt.js +348 -226
- package/dist-pkg/input/default-bindings.d.ts +37 -38
- package/dist-pkg/input/default-bindings.js +127 -144
- package/dist-pkg/input/devices.d.ts +7 -7
- package/dist-pkg/input/devices.js +17 -16
- package/dist-pkg/input/edges.d.ts +23 -32
- package/dist-pkg/input/edges.js +23 -28
- package/dist-pkg/input/empathy-filter.d.ts +22 -0
- package/dist-pkg/input/empathy-filter.js +34 -0
- package/dist-pkg/input/face-map.d.ts +96 -0
- package/dist-pkg/input/face-map.js +255 -0
- package/dist-pkg/input/face-signals.d.ts +40 -0
- package/dist-pkg/input/face-signals.js +48 -0
- package/dist-pkg/input/gamepad.d.ts +195 -145
- package/dist-pkg/input/gamepad.js +383 -556
- package/dist-pkg/input/gaze-cycle.d.ts +64 -0
- package/dist-pkg/input/gaze-cycle.js +133 -0
- package/dist-pkg/input/gaze-relative.d.ts +68 -0
- package/dist-pkg/input/gaze-relative.js +142 -0
- package/dist-pkg/input/hand-map.d.ts +28 -0
- package/dist-pkg/input/hand-map.js +142 -0
- package/dist-pkg/input/input-cooldown.d.ts +17 -0
- package/dist-pkg/input/input-cooldown.js +39 -0
- package/dist-pkg/input/key-default.d.ts +30 -0
- package/dist-pkg/input/key-default.js +60 -0
- package/dist-pkg/input/keyboard-runtime.d.ts +15 -21
- package/dist-pkg/input/keyboard-runtime.js +23 -27
- package/dist-pkg/input/keyboard.d.ts +68 -63
- package/dist-pkg/input/keyboard.js +83 -105
- package/dist-pkg/input/keydown.d.ts +123 -137
- package/dist-pkg/input/keydown.js +284 -289
- package/dist-pkg/input/latch-edge.d.ts +33 -21
- package/dist-pkg/input/latch-edge.js +34 -35
- package/dist-pkg/input/latch-scope.d.ts +51 -50
- package/dist-pkg/input/latch-scope.js +61 -82
- package/dist-pkg/input/latch-store.d.ts +26 -30
- package/dist-pkg/input/latch-store.js +42 -50
- package/dist-pkg/input/latch-sync.d.ts +29 -29
- package/dist-pkg/input/latch-sync.js +25 -25
- package/dist-pkg/input/latch.d.ts +14 -17
- package/dist-pkg/input/latch.js +29 -37
- package/dist-pkg/input/pad-defaults.d.ts +13 -16
- package/dist-pkg/input/pad-defaults.js +21 -28
- package/dist-pkg/input/pad-reading.d.ts +76 -0
- package/dist-pkg/input/pad-reading.js +169 -0
- package/dist-pkg/input/pad-wizard.d.ts +99 -0
- package/dist-pkg/input/pad-wizard.js +256 -0
- package/dist-pkg/input/pointer-space.d.ts +19 -20
- package/dist-pkg/input/pointer-space.js +27 -32
- package/dist-pkg/input/pointer.d.ts +39 -40
- package/dist-pkg/input/pointer.js +42 -45
- package/dist-pkg/input/state.d.ts +101 -89
- package/dist-pkg/input/state.js +54 -134
- package/dist-pkg/input/switch-scan.d.ts +59 -0
- package/dist-pkg/input/switch-scan.js +67 -0
- package/dist-pkg/input/synthetic-source.d.ts +42 -0
- package/dist-pkg/input/synthetic-source.js +57 -0
- package/dist-pkg/input/touch-bindings.d.ts +127 -116
- package/dist-pkg/input/touch-bindings.js +158 -173
- package/dist-pkg/input/touch.d.ts +147 -72
- package/dist-pkg/input/touch.js +362 -126
- package/dist-pkg/input/transport-in-use.d.ts +107 -0
- package/dist-pkg/input/transport-in-use.js +130 -0
- package/dist-pkg/input/transports.d.ts +90 -117
- package/dist-pkg/input/transports.js +104 -106
- package/dist-pkg/input/virtual-controller.d.ts +82 -0
- package/dist-pkg/input/virtual-controller.js +69 -0
- package/dist-pkg/input/vocabulary-migration.d.ts +50 -49
- package/dist-pkg/input/vocabulary-migration.js +80 -79
- package/dist-pkg/input/voice-map.d.ts +59 -0
- package/dist-pkg/input/voice-map.js +123 -0
- package/dist-pkg/platform/audio-ambient.d.ts +13 -2
- package/dist-pkg/platform/audio-ambient.js +14 -14
- package/dist-pkg/platform/audio-earcons.d.ts +20 -19
- package/dist-pkg/platform/audio-earcons.js +51 -42
- package/dist-pkg/platform/audio-jingles.js +9 -10
- package/dist-pkg/platform/audio-mixer.d.ts +14 -2
- package/dist-pkg/platform/audio-mixer.js +31 -39
- package/dist-pkg/platform/audio-sonar.d.ts +49 -152
- package/dist-pkg/platform/audio-sonar.js +124 -302
- package/dist-pkg/platform/audio.d.ts +62 -19
- package/dist-pkg/platform/audio.js +193 -168
- package/dist-pkg/platform/choose-by-voice.d.ts +70 -0
- package/dist-pkg/platform/choose-by-voice.js +157 -0
- package/dist-pkg/platform/flash-sampler.d.ts +19 -0
- package/dist-pkg/platform/flash-sampler.js +79 -0
- package/dist-pkg/platform/font-library.d.ts +77 -0
- package/dist-pkg/platform/font-library.js +98 -0
- package/dist-pkg/platform/font-library.json +721 -0
- package/dist-pkg/platform/heavy-catalogue.d.ts +77 -0
- package/dist-pkg/platform/heavy-catalogue.js +256 -0
- package/dist-pkg/platform/heavy-mirror.d.ts +20 -0
- package/dist-pkg/platform/heavy-mirror.js +73 -0
- package/dist-pkg/platform/heavy.d.ts +136 -0
- package/dist-pkg/platform/heavy.js +324 -0
- package/dist-pkg/platform/interruptible-speech.d.ts +23 -16
- package/dist-pkg/platform/interruptible-speech.js +77 -54
- package/dist-pkg/platform/kokoro-port.d.ts +27 -0
- package/dist-pkg/platform/kokoro-port.js +50 -0
- package/dist-pkg/platform/kokoro-runtime.d.ts +20 -0
- package/dist-pkg/platform/kokoro-runtime.js +52 -0
- package/dist-pkg/platform/kokoro.d.ts +70 -0
- package/dist-pkg/platform/kokoro.js +133 -0
- package/dist-pkg/platform/listener-scope.d.ts +12 -0
- package/dist-pkg/platform/listener-scope.js +90 -0
- package/dist-pkg/platform/locale-host.d.ts +14 -0
- package/dist-pkg/platform/locale-host.js +45 -0
- package/dist-pkg/platform/microphone.d.ts +51 -0
- package/dist-pkg/platform/microphone.js +118 -0
- package/dist-pkg/platform/onnx-runtime.d.ts +34 -0
- package/dist-pkg/platform/onnx-runtime.js +42 -0
- package/dist-pkg/platform/reading-in-worker.d.ts +64 -0
- package/dist-pkg/platform/reading-in-worker.js +125 -0
- package/dist-pkg/platform/reading-model.d.ts +94 -0
- package/dist-pkg/platform/reading-model.js +272 -0
- package/dist-pkg/platform/reading-runtime.d.ts +24 -0
- package/dist-pkg/platform/reading-runtime.js +164 -0
- package/dist-pkg/platform/reading-worker.d.ts +41 -0
- package/dist-pkg/platform/reading-worker.js +58 -0
- package/dist-pkg/platform/reading.d.ts +80 -0
- package/dist-pkg/platform/reading.js +136 -0
- package/dist-pkg/platform/speech-recognition.d.ts +60 -0
- package/dist-pkg/platform/speech-recognition.js +104 -0
- package/dist-pkg/platform/speech.d.ts +23 -1
- package/dist-pkg/platform/speech.js +29 -18
- package/dist-pkg/platform/storage-keys.d.ts +96 -0
- package/dist-pkg/platform/storage-keys.js +106 -0
- package/dist-pkg/platform/storage.d.ts +46 -111
- package/dist-pkg/platform/storage.js +104 -169
- package/dist-pkg/platform/tts.d.ts +85 -39
- package/dist-pkg/platform/tts.js +447 -127
- package/dist-pkg/platform/vision-loop.d.ts +23 -0
- package/dist-pkg/platform/vision-loop.js +56 -0
- package/dist-pkg/platform/vision.d.ts +132 -0
- package/dist-pkg/platform/vision.js +117 -0
- package/dist-pkg/platform/voice-listener.d.ts +40 -0
- package/dist-pkg/platform/voice-listener.js +88 -0
- package/dist-pkg/platform/voice-plan.d.ts +15 -98
- package/dist-pkg/platform/voice-plan.js +56 -143
- package/dist-pkg/platform/vosk-runtime.d.ts +96 -0
- package/dist-pkg/platform/vosk-runtime.js +151 -0
- package/dist-pkg/platform/vosk-vocabulary.d.ts +6 -0
- package/dist-pkg/platform/vosk-vocabulary.js +178 -0
- package/dist-pkg/render/canvas.d.ts +13 -7
- package/dist-pkg/render/canvas.js +13 -13
- package/dist-pkg/render/crt.d.ts +48 -12
- package/dist-pkg/render/crt.js +78 -80
- package/dist-pkg/render/cvd-matrices.d.ts +22 -18
- package/dist-pkg/render/cvd-matrices.js +37 -38
- package/dist-pkg/render/hc-role-data.d.ts +7 -7
- package/dist-pkg/render/hc-role-data.js +14 -14
- package/dist-pkg/render/high-contrast.d.ts +67 -56
- package/dist-pkg/render/high-contrast.js +226 -217
- package/dist-pkg/render/low-vision-drawing.d.ts +5 -0
- package/dist-pkg/render/low-vision-drawing.js +46 -0
- package/dist-pkg/render/lq-filter.d.ts +32 -20
- package/dist-pkg/render/lq-filter.js +59 -65
- package/dist-pkg/render/port.d.ts +86 -88
- package/dist-pkg/render/port.js +17 -23
- package/dist-pkg/render/screen-pipeline.d.ts +42 -42
- package/dist-pkg/render/screen-pipeline.js +80 -87
- package/dist-pkg/render/sprite-fx.d.ts +2 -1
- package/dist-pkg/render/sprite-fx.js +16 -14
- package/dist-pkg/render/viewports.d.ts +20 -15
- package/dist-pkg/render/viewports.js +83 -114
- package/dist-pkg/render/viz-axes-labels.d.ts +47 -0
- package/dist-pkg/render/viz-axes-labels.js +88 -0
- package/dist-pkg/render/viz-axes.d.ts +89 -86
- package/dist-pkg/render/viz-axes.js +128 -116
- package/dist-pkg/render/viz-modes.d.ts +28 -29
- package/dist-pkg/render/viz-modes.js +40 -45
- package/dist-pkg/render/viz-refusal.d.ts +32 -0
- package/dist-pkg/render/viz-refusal.js +57 -0
- package/dist-pkg/render/viz-setters.d.ts +104 -66
- package/dist-pkg/render/viz-setters.js +182 -191
- package/dist-pkg/ui/aac-sets.d.ts +45 -0
- package/dist-pkg/ui/aac-sets.js +41 -0
- package/dist-pkg/ui/audio-choices.d.ts +68 -0
- package/dist-pkg/ui/audio-choices.js +98 -0
- package/dist-pkg/ui/audio-rows-that-apply.d.ts +12 -0
- package/dist-pkg/ui/audio-rows-that-apply.js +43 -0
- package/dist-pkg/ui/camera-control.d.ts +53 -0
- package/dist-pkg/ui/camera-control.js +48 -0
- package/dist-pkg/ui/changed-mark.d.ts +9 -8
- package/dist-pkg/ui/changed-mark.js +22 -53
- package/dist-pkg/ui/control-choices.d.ts +37 -0
- package/dist-pkg/ui/control-choices.js +84 -0
- package/dist-pkg/ui/debug-panel.d.ts +59 -43
- package/dist-pkg/ui/debug-panel.js +68 -69
- package/dist-pkg/ui/declared-words.d.ts +21 -0
- package/dist-pkg/ui/declared-words.js +66 -0
- package/dist-pkg/ui/dom.d.ts +10 -14
- package/dist-pkg/ui/dom.js +10 -47
- package/dist-pkg/ui/drawing-problems.d.ts +25 -0
- package/dist-pkg/ui/drawing-problems.js +94 -0
- package/dist-pkg/ui/eye-control.d.ts +36 -0
- package/dist-pkg/ui/eye-control.js +178 -0
- package/dist-pkg/ui/face-control.d.ts +25 -0
- package/dist-pkg/ui/face-control.js +183 -0
- package/dist-pkg/ui/focus-trap.d.ts +39 -49
- package/dist-pkg/ui/focus-trap.js +56 -65
- package/dist-pkg/ui/fonts.d.ts +157 -68
- package/dist-pkg/ui/fonts.js +305 -115
- package/dist-pkg/ui/footer-scroll-driver.d.ts +14 -0
- package/dist-pkg/ui/footer-scroll-driver.js +201 -0
- package/dist-pkg/ui/footer-scroll.d.ts +38 -0
- package/dist-pkg/ui/footer-scroll.js +55 -0
- package/dist-pkg/ui/game-options.d.ts +47 -0
- package/dist-pkg/ui/game-options.js +158 -0
- package/dist-pkg/ui/gaze-overlay.d.ts +64 -0
- package/dist-pkg/ui/gaze-overlay.js +165 -0
- package/dist-pkg/ui/hand-control.d.ts +25 -0
- package/dist-pkg/ui/hand-control.js +143 -0
- package/dist-pkg/ui/help-panel.d.ts +87 -0
- package/dist-pkg/ui/help-panel.js +242 -0
- package/dist-pkg/ui/hud-bands.d.ts +62 -0
- package/dist-pkg/ui/hud-bands.js +146 -0
- package/dist-pkg/ui/hud-row.d.ts +34 -0
- package/dist-pkg/ui/hud-row.js +80 -0
- package/dist-pkg/ui/hud.d.ts +73 -73
- package/dist-pkg/ui/hud.js +94 -98
- package/dist-pkg/ui/item-announcement.d.ts +13 -12
- package/dist-pkg/ui/item-announcement.js +25 -26
- package/dist-pkg/ui/layout.d.ts +103 -28
- package/dist-pkg/ui/layout.js +117 -99
- package/dist-pkg/ui/libras-avatar-clip.d.ts +30 -0
- package/dist-pkg/ui/libras-avatar-clip.js +86 -0
- package/dist-pkg/ui/libras-avatar-load.d.ts +52 -0
- package/dist-pkg/ui/libras-avatar-load.js +134 -0
- package/dist-pkg/ui/libras-avatar-plan.d.ts +102 -0
- package/dist-pkg/ui/libras-avatar-plan.js +211 -0
- package/dist-pkg/ui/libras-avatar-player.d.ts +28 -0
- package/dist-pkg/ui/libras-avatar-player.js +226 -0
- package/dist-pkg/ui/libras-avatar-stage.d.ts +37 -0
- package/dist-pkg/ui/libras-avatar-stage.js +208 -0
- package/dist-pkg/ui/libras-glosses.d.ts +28 -0
- package/dist-pkg/ui/libras-glosses.js +161 -0
- package/dist-pkg/ui/locale-flags.d.ts +16 -0
- package/dist-pkg/ui/locale-flags.js +30 -0
- package/dist-pkg/ui/loop-crash.d.ts +17 -17
- package/dist-pkg/ui/loop-crash.js +33 -62
- package/dist-pkg/ui/menu-intent.d.ts +61 -0
- package/dist-pkg/ui/menu-intent.js +88 -0
- package/dist-pkg/ui/menu-items.d.ts +20 -0
- package/dist-pkg/ui/menu-items.js +51 -0
- package/dist-pkg/ui/menu-nav.d.ts +98 -92
- package/dist-pkg/ui/menu-nav.js +398 -286
- package/dist-pkg/ui/mobility-choices.d.ts +26 -0
- package/dist-pkg/ui/mobility-choices.js +41 -0
- package/dist-pkg/ui/motion-choices.d.ts +31 -0
- package/dist-pkg/ui/motion-choices.js +68 -0
- package/dist-pkg/ui/motion-scene.d.ts +24 -19
- package/dist-pkg/ui/motion-scene.js +29 -61
- package/dist-pkg/ui/mount-panel.d.ts +81 -0
- package/dist-pkg/ui/mount-panel.js +61 -0
- package/dist-pkg/ui/panel-shell.d.ts +65 -31
- package/dist-pkg/ui/panel-shell.js +92 -66
- package/dist-pkg/ui/panel-widgets.d.ts +150 -0
- package/dist-pkg/ui/panel-widgets.js +294 -0
- package/dist-pkg/ui/pause-buttons.d.ts +35 -0
- package/dist-pkg/ui/pause-buttons.js +66 -0
- package/dist-pkg/ui/pause-icons.d.ts +261 -347
- package/dist-pkg/ui/pause-icons.js +671 -601
- package/dist-pkg/ui/pause-markup.d.ts +86 -0
- package/dist-pkg/ui/pause-markup.js +125 -0
- package/dist-pkg/ui/reach-notice.d.ts +22 -23
- package/dist-pkg/ui/reach-notice.js +55 -58
- package/dist-pkg/ui/scan-overlay.d.ts +23 -0
- package/dist-pkg/ui/scan-overlay.js +50 -0
- package/dist-pkg/ui/screen-text.d.ts +25 -0
- package/dist-pkg/ui/screen-text.js +152 -0
- package/dist-pkg/ui/session-clock.d.ts +32 -0
- package/dist-pkg/ui/session-clock.js +67 -0
- package/dist-pkg/ui/settings-aac.d.ts +70 -0
- package/dist-pkg/ui/settings-aac.js +208 -0
- package/dist-pkg/ui/settings-audio.d.ts +97 -114
- package/dist-pkg/ui/settings-audio.js +493 -425
- package/dist-pkg/ui/settings-controls.d.ts +53 -96
- package/dist-pkg/ui/settings-controls.js +143 -215
- package/dist-pkg/ui/settings-empathy.d.ts +39 -30
- package/dist-pkg/ui/settings-empathy.js +53 -60
- package/dist-pkg/ui/settings-mobility.d.ts +192 -0
- package/dist-pkg/ui/settings-mobility.js +332 -0
- package/dist-pkg/ui/settings-motion.d.ts +91 -70
- package/dist-pkg/ui/settings-motion.js +287 -198
- package/dist-pkg/ui/settings-panel.d.ts +58 -45
- package/dist-pkg/ui/settings-panel.js +189 -94
- package/dist-pkg/ui/settings-typo.d.ts +29 -78
- package/dist-pkg/ui/settings-typo.js +158 -129
- package/dist-pkg/ui/settings-visual.d.ts +29 -87
- package/dist-pkg/ui/settings-visual.js +240 -193
- package/dist-pkg/ui/shell.d.ts +112 -135
- package/dist-pkg/ui/shell.js +148 -217
- package/dist-pkg/ui/simulation-list.d.ts +27 -0
- package/dist-pkg/ui/simulation-list.js +76 -0
- package/dist-pkg/ui/simulation-over-the-world.d.ts +23 -0
- package/dist-pkg/ui/simulation-over-the-world.js +131 -0
- package/dist-pkg/ui/simulation-refusal.d.ts +5 -31
- package/dist-pkg/ui/simulation-refusal.js +8 -56
- package/dist-pkg/ui/switchable-control.d.ts +11 -0
- package/dist-pkg/ui/switchable-control.js +19 -0
- package/dist-pkg/ui/title.d.ts +3 -12
- package/dist-pkg/ui/title.js +49 -18
- package/dist-pkg/ui/top-band.d.ts +26 -0
- package/dist-pkg/ui/top-band.js +96 -0
- package/dist-pkg/ui/typo-choices.d.ts +71 -0
- package/dist-pkg/ui/typo-choices.js +85 -0
- package/dist-pkg/ui/visual-axes-panel.d.ts +11 -47
- package/dist-pkg/ui/visual-axes-panel.js +12 -94
- package/dist-pkg/ui/visual-choices.d.ts +77 -0
- package/dist-pkg/ui/visual-choices.js +107 -0
- package/dist-pkg/ui/vlibras.d.ts +77 -10
- package/dist-pkg/ui/vlibras.js +130 -81
- package/dist-pkg/ui/voice-control.d.ts +68 -0
- package/dist-pkg/ui/voice-control.js +276 -0
- package/dist-pkg/ui/voice-settings.d.ts +95 -0
- package/dist-pkg/ui/voice-settings.js +352 -0
- package/dist-pkg/ui/where-the-child-is.d.ts +31 -0
- package/dist-pkg/ui/where-the-child-is.js +70 -0
- package/docs/CREDITS.md +300 -44
- package/docs/LICENSES.md +189 -145
- package/package.json +51 -27
- package/scripts/check-cartridge.mjs +78 -0
- package/scripts/game-build.d.mts +25 -0
- package/scripts/game-build.mjs +144 -0
- package/scripts/heavy-into-the-delivery.mjs +388 -0
- package/scripts/libras-avatar.json +680 -0
- package/scripts/libras-avatar.mjs +246 -0
- package/scripts/libras-glosses/gloss.py +95 -0
- package/scripts/libras-glosses/pyproject.toml +32 -0
- package/scripts/libras-glosses/uv.lock +781 -0
- package/scripts/libras-glosses.mjs +351 -0
- package/scripts/licences/Apache-2.0.txt +176 -0
- package/scripts/licences/GPL-3.0.txt +674 -0
- package/scripts/licences/MIT.txt +17 -0
- package/scripts/licences/OFL-1.1.txt +86 -0
- package/scripts/licences/UFL-1.0.txt +96 -0
- package/scripts/licences/fonts.mjs +389 -0
- package/scripts/licences/third-party.mjs +301 -0
- package/scripts/licences/vosk-browser.NOTICE.txt +268 -0
- package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
- package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-700.woff2 +0 -0
- package/app/public/vendor/fonts/lato-400.woff2 +0 -0
- package/app/public/vendor/fonts/lato-700.woff2 +0 -0
- package/app/public/vendor/fonts/literata-400.woff2 +0 -0
- package/app/public/vendor/fonts/literata-700.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
- package/app/public/vendor/fonts/opendyslexic-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
- package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
- package/app/public/vendor/fonts/pressstart-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
- package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
- package/dist-pkg/core/anel.d.ts +0 -17
- package/dist-pkg/core/anel.js +0 -31
- package/dist-pkg/core/collision.d.ts +0 -21
- package/dist-pkg/core/collision.js +0 -62
- package/dist-pkg/core/layers.d.ts +0 -63
- package/dist-pkg/core/layers.js +0 -95
- package/dist-pkg/core/letter-grid.d.ts +0 -55
- package/dist-pkg/core/letter-grid.js +0 -116
- package/dist-pkg/core/password.d.ts +0 -34
- package/dist-pkg/core/password.js +0 -205
- package/dist-pkg/core/rotulo-acessivel.d.ts +0 -17
- package/dist-pkg/core/rotulo-acessivel.js +0 -41
- package/dist-pkg/core/run-state.d.ts +0 -115
- package/dist-pkg/core/run-state.js +0 -40
- package/dist-pkg/core/tiles.d.ts +0 -12
- package/dist-pkg/core/tiles.js +0 -61
- package/dist-pkg/core/world.d.ts +0 -4
- package/dist-pkg/core/world.js +0 -58
- package/dist-pkg/input/origem-sintetica.d.ts +0 -44
- package/dist-pkg/input/origem-sintetica.js +0 -60
- package/dist-pkg/input/transporte-em-uso.d.ts +0 -101
- package/dist-pkg/input/transporte-em-uso.js +0 -130
- package/dist-pkg/platform/audio-nav.d.ts +0 -51
- package/dist-pkg/platform/audio-nav.js +0 -99
- package/dist-pkg/platform/guide-intensity.d.ts +0 -40
- package/dist-pkg/platform/guide-intensity.js +0 -73
- package/dist-pkg/platform/pesados-catalogo.d.ts +0 -14
- package/dist-pkg/platform/pesados-catalogo.js +0 -177
- package/dist-pkg/platform/pesados.d.ts +0 -31
- package/dist-pkg/platform/pesados.js +0 -75
- package/dist-pkg/platform/vozes-prontas.d.ts +0 -28
- package/dist-pkg/platform/vozes-prontas.js +0 -61
- package/dist-pkg/render/camera.d.ts +0 -58
- package/dist-pkg/render/camera.js +0 -105
- package/dist-pkg/render/cenario-data.d.ts +0 -127
- package/dist-pkg/render/cenario-data.js +0 -145
- package/dist-pkg/render/city-tex.d.ts +0 -63
- package/dist-pkg/render/city-tex.js +0 -228
- package/dist-pkg/render/city-tiles.d.ts +0 -11
- package/dist-pkg/render/city-tiles.js +0 -140
- package/dist-pkg/render/draw.d.ts +0 -149
- package/dist-pkg/render/draw.js +0 -231
- package/dist-pkg/render/fx.d.ts +0 -63
- package/dist-pkg/render/fx.js +0 -123
- package/dist-pkg/render/minimap.d.ts +0 -11
- package/dist-pkg/render/minimap.js +0 -94
- package/dist-pkg/render/parallax.d.ts +0 -85
- package/dist-pkg/render/parallax.js +0 -158
- package/dist-pkg/render/player-anim.d.ts +0 -71
- package/dist-pkg/render/player-anim.js +0 -152
- package/dist-pkg/render/recycling-tex.d.ts +0 -48
- package/dist-pkg/render/recycling-tex.js +0 -164
- package/dist-pkg/render/scene-city.d.ts +0 -77
- package/dist-pkg/render/scene-city.js +0 -181
- package/dist-pkg/render/scene-parallax.d.ts +0 -72
- package/dist-pkg/render/scene-parallax.js +0 -426
- package/dist-pkg/render/scene-sky.d.ts +0 -126
- package/dist-pkg/render/scene-sky.js +0 -295
- package/dist-pkg/render/set-cenario.d.ts +0 -54
- package/dist-pkg/render/set-cenario.js +0 -103
- package/dist-pkg/render/textures.d.ts +0 -75
- package/dist-pkg/render/textures.js +0 -240
- package/dist-pkg/render/title-scene.d.ts +0 -46
- package/dist-pkg/render/title-scene.js +0 -75
- package/dist-pkg/render/weather.d.ts +0 -96
- package/dist-pkg/render/weather.js +0 -171
- package/dist-pkg/render/wheelchair-sprites.d.ts +0 -32
- package/dist-pkg/render/wheelchair-sprites.js +0 -69
- package/dist-pkg/render/world-tex.d.ts +0 -18
- package/dist-pkg/render/world-tex.js +0 -87
- package/dist-pkg/ui/activities-menu.d.ts +0 -258
- package/dist-pkg/ui/activities-menu.js +0 -648
- package/dist-pkg/ui/caa-sets.d.ts +0 -39
- package/dist-pkg/ui/caa-sets.js +0 -65
- package/dist-pkg/ui/latch-refusal.d.ts +0 -32
- package/dist-pkg/ui/latch-refusal.js +0 -60
- package/dist-pkg/ui/map-hub.d.ts +0 -56
- package/dist-pkg/ui/map-hub.js +0 -138
- package/dist-pkg/ui/settings-caa.d.ts +0 -45
- package/dist-pkg/ui/settings-caa.js +0 -137
- package/dist-pkg/ui/settings-motor.d.ts +0 -175
- package/dist-pkg/ui/settings-motor.js +0 -342
- package/dist-pkg/ui/webcam.d.ts +0 -7
- package/dist-pkg/ui/webcam.js +0 -93
|
@@ -1,113 +1,113 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
2
|
+
import type { CreateSprite, CreateDrawing, WithFilter, DrawingWithCircle } from './port.js';
|
|
3
|
+
/** A rectangle in logical pixels. */
|
|
4
4
|
export interface Rect {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
w: number;
|
|
8
8
|
h: number;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
10
|
+
/** Where a screen sits and what is drawn around it. */
|
|
11
11
|
export interface ViewportPlacement {
|
|
12
|
-
/**
|
|
12
|
+
/** The top-left corner of the screen's sprite, on the canvas. */
|
|
13
13
|
x: number;
|
|
14
14
|
y: number;
|
|
15
|
-
/**
|
|
15
|
+
/** The frame's rectangle (half a pixel in, 1px smaller on both sides — see the header). */
|
|
16
16
|
frame: Rect;
|
|
17
|
-
/**
|
|
17
|
+
/** The anchor of the vision mode's indicator dot (the screen's top RIGHT corner, inwards). */
|
|
18
18
|
dot: {
|
|
19
19
|
x: number;
|
|
20
20
|
y: number;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/** The complete render plan for `n` players. */
|
|
24
24
|
export interface ScreenPlan {
|
|
25
|
-
/** `true` =
|
|
25
|
+
/** `true` = the SINGLE-SCREEN path: the camera goes straight onto the stage, with no render texture. */
|
|
26
26
|
single: boolean;
|
|
27
27
|
cols: number;
|
|
28
28
|
rows: number;
|
|
29
|
-
/**
|
|
29
|
+
/** The size the renderer is resized to. */
|
|
30
30
|
canvas: {
|
|
31
31
|
w: number;
|
|
32
32
|
h: number;
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
34
|
+
/** One entry per screen — EMPTY on the single-screen path, which has no viewport. */
|
|
35
35
|
viewports: ViewportPlacement[];
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
37
|
+
/** The screen frame's colour (the same blue-grey as the canvas border on a single screen). */
|
|
38
38
|
export declare const FRAME_COLOR = 13489906;
|
|
39
|
-
/**
|
|
39
|
+
/** The frame's opacity. */
|
|
40
40
|
export declare const FRAME_ALPHA = 0.95;
|
|
41
|
-
/**
|
|
41
|
+
/** The frame's thickness, in LOGICAL pixels (it scales with the canvas). */
|
|
42
42
|
export declare const FRAME_WIDTH = 1;
|
|
43
|
-
/**
|
|
43
|
+
/** The indicator dot's inset from the screen's right edge. */
|
|
44
44
|
export declare const DOT_INSET_X = 9;
|
|
45
|
-
/**
|
|
45
|
+
/** The indicator dot's inset from the screen's top. */
|
|
46
46
|
export declare const DOT_INSET_Y = 9;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* The render geometry for `n` players, touching nothing.
|
|
49
49
|
*
|
|
50
|
-
* `n <= 1`
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* `n <= 1` returns `single: true` and NO viewport: on a single screen the camera is the stage's child and PIXI draws
|
|
51
|
+
* straight onto the canvas — there is no render texture, no frame and no dot (the single screen's vision-mode indicator
|
|
52
|
+
* is another one, in the DOM).
|
|
53
53
|
*
|
|
54
|
-
* `w`/`h`
|
|
55
|
-
*
|
|
54
|
+
* `w`/`h` are parameters defaulting to the canonical pixel (320×180, ADR-0010) — not for the game to change them, but so
|
|
55
|
+
* the arithmetic can be checked with small numbers in the test.
|
|
56
56
|
*/
|
|
57
57
|
export declare function planScreens(n: number, w?: number, h?: number): ScreenPlan;
|
|
58
|
-
/**
|
|
58
|
+
/** What is touched of a `PIXI.BaseTexture`: only the scale mode (NEAREST = pixel art without blur). */
|
|
59
59
|
interface BaseTextureLike {
|
|
60
60
|
scaleMode: number;
|
|
61
61
|
}
|
|
62
|
-
/**
|
|
62
|
+
/** What is touched of a `PIXI.RenderTexture`: the baseTexture and disposal (`true` = destroys the base too). */
|
|
63
63
|
export interface RenderTextureLike {
|
|
64
64
|
baseTexture: BaseTextureLike;
|
|
65
65
|
destroy(destroyBase?: boolean): void;
|
|
66
66
|
}
|
|
67
|
-
/** `PIXI.RenderTexture`
|
|
67
|
+
/** `PIXI.RenderTexture` as a FACTORY — it is `RenderTexture.create({width,height})`, not a constructor. */
|
|
68
68
|
export interface RenderTextureFactory {
|
|
69
69
|
create(opts: {
|
|
70
70
|
width: number;
|
|
71
71
|
height: number;
|
|
72
72
|
}): RenderTextureLike;
|
|
73
73
|
}
|
|
74
|
-
/**
|
|
74
|
+
/** The minimum of a positionable, disposable scene object. */
|
|
75
75
|
export interface DisplayLike {
|
|
76
76
|
x: number;
|
|
77
77
|
y: number;
|
|
78
78
|
visible: boolean;
|
|
79
79
|
destroy(): void;
|
|
80
80
|
}
|
|
81
|
-
/** `PIXI.Sprite` —
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
export type SpriteLike = DisplayLike &
|
|
86
|
-
/** `PIXI.Graphics` —
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
export interface GraphicsLike extends DisplayLike,
|
|
81
|
+
/** `PIXI.Sprite` — here it is only born from a render texture and positioned.
|
|
82
|
+
* `filters` is NOT touched here: whoever puts a per-screen GPU filter is `render/viz-setters`, and that is where these
|
|
83
|
+
* sprites go (`getVpSpr`). THE MINIMAL SLICE INVERTS again — in handing-over position, the slice that counts is the
|
|
84
|
+
* RECEIVER's, not the reader's. See `render/port`'s header. */
|
|
85
|
+
export type SpriteLike = DisplayLike & WithFilter;
|
|
86
|
+
/** `PIXI.Graphics` — the frame draws; the dots are only positioned (viz-setters paints them).
|
|
87
|
+
* And because they are painted THERE, the declaration includes the whole drawing: the dots leave through `getVpDots`
|
|
88
|
+
* and `viz-setters` calls `clear`/`beginFill`/`drawCircle` on them. */
|
|
89
|
+
export interface GraphicsLike extends DisplayLike, DrawingWithCircle {
|
|
90
90
|
}
|
|
91
|
-
/** `PIXI.Container`
|
|
91
|
+
/** `PIXI.Container` in the role of a scene parent. */
|
|
92
92
|
export interface ContainerLike {
|
|
93
93
|
addChild(child: unknown): unknown;
|
|
94
94
|
addChildAt(child: unknown, index: number): unknown;
|
|
95
95
|
removeChild(child: unknown): unknown;
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
97
|
+
/** The camera, seen from here: only its PARENTHOOD matters (the stage's child or an orphan). */
|
|
98
98
|
export interface CameraLike {
|
|
99
99
|
parent: ContainerLike | null;
|
|
100
100
|
}
|
|
101
|
-
/** `app.renderer` —
|
|
101
|
+
/** `app.renderer` — from here only the canvas is resized. */
|
|
102
102
|
export interface ResizableRenderer {
|
|
103
103
|
resize(w: number, h: number): void;
|
|
104
104
|
}
|
|
105
105
|
export interface ScreenPipelineCtx {
|
|
106
106
|
RenderTexture: RenderTextureFactory;
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
/** Factories, not constructors: `new (texture: unknown)` does not take the real `PIXI.Sprite`, whose constructor only
|
|
108
|
+
* accepts a `Texture`. See `CreateSprite` in `render/port`'s header. */
|
|
109
|
+
createSprite: CreateSprite<SpriteLike>;
|
|
110
|
+
createDrawing: CreateDrawing<GraphicsLike>;
|
|
111
111
|
NEAREST: number;
|
|
112
112
|
stage: ContainerLike;
|
|
113
113
|
renderer: ResizableRenderer;
|
|
@@ -127,7 +127,7 @@ export interface ScreenPipelineCtx {
|
|
|
127
127
|
updateVpDots: () => void;
|
|
128
128
|
}
|
|
129
129
|
export interface ScreenPipelineApi {
|
|
130
|
-
/**
|
|
130
|
+
/** Rebuilds the render pipeline for the CURRENT player count. Idempotent: it destroys the previous set. */
|
|
131
131
|
configureRender(): void;
|
|
132
132
|
}
|
|
133
133
|
export declare function initScreenPipeline(ctx: ScreenPipelineCtx): ScreenPipelineApi;
|
|
@@ -1,96 +1,89 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// render/screen-pipeline —
|
|
2
|
+
// render/screen-pipeline — HOW MANY SCREENS EXIST, WHERE THEY SIT, AND WHICH PIXI OBJECTS EACH ONE GETS.
|
|
3
3
|
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// virando um sprite posicionado na grade" — e de volta.
|
|
4
|
+
// It runs whenever the number of players changes and when a round restarts, and it is the one function that changes the
|
|
5
|
+
// render TOPOLOGY: from "one camera drawn straight onto the stage" to "N render textures, one per player, each becoming a
|
|
6
|
+
// sprite placed on the grid" — and back.
|
|
8
7
|
//
|
|
9
|
-
// =======================
|
|
10
|
-
// "N
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// troca o pipeline não precisa saber o que mais o jogo quer refazer quando o pipeline troca.
|
|
8
|
+
// ======================= IT IS ENGINE, NOT ONE GAME'S =======================
|
|
9
|
+
// "N players on SEPARATE screens, no split-screen" is ADR-0010's pillar 7: it holds for every game, not one. A second
|
|
10
|
+
// game reuses this WHOLE — nothing here knows what a coin, a power-up, a gate or a secret area is. What the module knows
|
|
11
|
+
// is: a stage, a renderer, a camera, and `core/screens.ts`'s arithmetic. That is why it lives in `render/`, beside
|
|
12
|
+
// `render/viewports.ts`, and why everything else (the HUD, the accessibility filters, the dots) comes in by INJECTION,
|
|
13
|
+
// as a callback — whoever swaps the pipeline does not need to know what else the game wants to redo when it swaps.
|
|
16
14
|
//
|
|
17
|
-
// =======================
|
|
18
|
-
//
|
|
19
|
-
// · `render/viewports.ts`
|
|
20
|
-
// (
|
|
21
|
-
//
|
|
22
|
-
// ·
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
// ré-aplicação chamados no fim do caminho multi-tela.
|
|
15
|
+
// ======================= WHY A SIBLING FILE, AND NOT INSIDE render/viewports.ts =======================
|
|
16
|
+
// Both speak of "viewport", but they answer different questions, and the difference is exactly the boundary:
|
|
17
|
+
// · `render/viewports.ts` is the IMAGE FACTORY — given an accessible vision MODE, how the pixel comes out
|
|
18
|
+
// (colour-blindness matrix, cataract haze, high-contrast outline). It CONSUMES the viewport textures by getter and
|
|
19
|
+
// never creates them. It is a question about COLOUR and FILTER.
|
|
20
|
+
// · here is the TOPOLOGY — how many render textures exist, how big the canvas is, where each sprite sits, where the
|
|
21
|
+
// frame is drawn, where the indicator dot is anchored. It is a question about GEOMETRY and LIFECYCLE (destroying the
|
|
22
|
+
// previous set before building the new one).
|
|
23
|
+
// Merging them would give a module whose `ctx` had ~25 fields and whose name could only be "viewport stuff", which is a
|
|
24
|
+
// theme, not a responsibility — exactly the argument of `input/touch-bindings.ts`'s header. There is also a mechanical
|
|
25
|
+
// reason: `viewports.ts` READS the viewport textures (`getVpTex()`); this module REASSIGNS them. Keeping reader and writer
|
|
26
|
+
// in one file would erase the only clue that the array changes identity on every change in the number of screens. The
|
|
27
|
+
// real link between the two is narrow and explicit: `applyVpFilters()` and `updateVpDots()`, two reapply callbacks called
|
|
28
|
+
// at the end of the multi-screen path.
|
|
32
29
|
//
|
|
33
|
-
// =======================
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// ·
|
|
41
|
-
//
|
|
42
|
-
// borrada ou comida pela borda do canvas quando a escala inteira multiplica tudo.
|
|
30
|
+
// ======================= THE PURE PART: PLANNING ≠ BUILDING =======================
|
|
31
|
+
// The grid arithmetic lives entirely in `planScreens(n)`, which returns, touching nothing: the canvas size, and for each
|
|
32
|
+
// screen its position, the frame's rectangle and the dot's anchor. `configureRender()` is the execution of a plan.
|
|
33
|
+
// `planScreens` carries the three rules nobody could see among the sprite constructions:
|
|
34
|
+
// · the grid comes from `core/screens.ts` (`screenGrid`) — the SAME source as the layout, the HUD and the CRT (a local
|
|
35
|
+
// copy once diverged: `cols = n<=2 ? n : 2`, without the `n<=1` guard);
|
|
36
|
+
// · with 3 screens, the third is CENTRED on the bottom row — `x = (LOGICAL_W*cols - LOGICAL_W)/2`;
|
|
37
|
+
// · the frame is drawn on the half pixel (`+0.5`) and 1px smaller on both sides, or the 1-logical-px line comes out
|
|
38
|
+
// blurred or eaten by the canvas edge when the integer scale multiplies everything.
|
|
43
39
|
//
|
|
44
|
-
// =======================
|
|
45
|
-
// · `buildGameHud`, `applyVpFilters`, `updateVpDots`
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
// ·
|
|
49
|
-
//
|
|
50
|
-
// ·
|
|
51
|
-
//
|
|
40
|
+
// ======================= WHAT STAYED OUT =======================
|
|
41
|
+
// · `buildGameHud`, `applyVpFilters`, `updateVpDots` and `setMinimapVisible` are CALLBACKS. The HUD is overlaid DOM, the
|
|
42
|
+
// filters are accessibility policy (render/viz-setters.ts) and a minimap is a game's own; this module only knows WHEN
|
|
43
|
+
// they need to run again, not HOW.
|
|
44
|
+
// · The host creates the `camera` and welds its z-order. From here the camera only moves between "the stage's child"
|
|
45
|
+
// (one screen) and "an orphan, drawn by hand into the render textures" (several screens).
|
|
46
|
+
// · The per-viewport render LOOP (whoever calls `renderer.render(camera,{renderTexture:vpTex[i]})` every frame) is the
|
|
47
|
+
// host's drawing. Here the infrastructure is built; there it is used.
|
|
52
48
|
//
|
|
53
|
-
// =======================
|
|
54
|
-
// · `applyVpFilters`
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
// · SEM I/O no import: nada de `document`, nada de canvas no corpo. `planScreens` é aritmética pura e roda no
|
|
64
|
-
// project `node`; tudo que toca PIXI só acontece dentro de `configureRender()`.
|
|
49
|
+
// ======================= BOOT-ORDER TRAPS =======================
|
|
50
|
+
// · `applyVpFilters` and `updateVpDots` may be built after this init, so they enter the `ctx` as LAZY ARROWS
|
|
51
|
+
// (`() => applyVpFilters()`): passing them by value would read them before they exist. That is safe because
|
|
52
|
+
// `configureRender` is never called during boot — only when the player count changes or a round restarts.
|
|
53
|
+
// · The viewport textures, sprites, frames and dots are the host's, REASSIGNED by this module and read by getter
|
|
54
|
+
// elsewhere (`viewports`, `viz-setters`). That is why the `ctx` carries a getter+setter pair for each, instead of the
|
|
55
|
+
// module owning the arrays: were it the owner, the host would have to swap the getters it already handed out, and the
|
|
56
|
+
// rewiring would stop being local.
|
|
57
|
+
// · NO I/O on import: no `document`, no canvas in the body. `planScreens` is pure arithmetic and runs in the `node`
|
|
58
|
+
// project; everything touching PIXI only happens inside `configureRender()`.
|
|
65
59
|
//
|
|
66
|
-
// PIXI
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
// isso que o obrigaria a arrastar 445KB de PixiJS para dentro do project `node` do Vitest se importasse.
|
|
60
|
+
// PIXI comes in through a STRUCTURAL INTERFACE, not `import * as PIXI` — the same precedent as render/viewports. The
|
|
61
|
+
// reason is stronger than usual here: this is the module that touches the most concrete engine types (`RenderTexture`,
|
|
62
|
+
// `Sprite`, `Graphics`, `SCALE_MODES`), and importing them would drag 445KB of PixiJS into Vitest's `node` project.
|
|
70
63
|
import { LOGICAL_W, LOGICAL_H } from '../core/constants.js';
|
|
71
64
|
import { screenGrid } from '../core/screens.js';
|
|
72
|
-
/**
|
|
65
|
+
/** The screen frame's colour (the same blue-grey as the canvas border on a single screen). */
|
|
73
66
|
export const FRAME_COLOR = 0xcdd6f2;
|
|
74
|
-
/**
|
|
67
|
+
/** The frame's opacity. */
|
|
75
68
|
export const FRAME_ALPHA = 0.95;
|
|
76
|
-
/**
|
|
69
|
+
/** The frame's thickness, in LOGICAL pixels (it scales with the canvas). */
|
|
77
70
|
export const FRAME_WIDTH = 1;
|
|
78
|
-
/**
|
|
71
|
+
/** The indicator dot's inset from the screen's right edge. */
|
|
79
72
|
export const DOT_INSET_X = 9;
|
|
80
|
-
/**
|
|
73
|
+
/** The indicator dot's inset from the screen's top. */
|
|
81
74
|
export const DOT_INSET_Y = 9;
|
|
82
75
|
/**
|
|
83
|
-
*
|
|
76
|
+
* The render geometry for `n` players, touching nothing.
|
|
84
77
|
*
|
|
85
|
-
* `n <= 1`
|
|
86
|
-
*
|
|
87
|
-
*
|
|
78
|
+
* `n <= 1` returns `single: true` and NO viewport: on a single screen the camera is the stage's child and PIXI draws
|
|
79
|
+
* straight onto the canvas — there is no render texture, no frame and no dot (the single screen's vision-mode indicator
|
|
80
|
+
* is another one, in the DOM).
|
|
88
81
|
*
|
|
89
|
-
* `w`/`h`
|
|
90
|
-
*
|
|
82
|
+
* `w`/`h` are parameters defaulting to the canonical pixel (320×180, ADR-0010) — not for the game to change them, but so
|
|
83
|
+
* the arithmetic can be checked with small numbers in the test.
|
|
91
84
|
*/
|
|
92
85
|
export function planScreens(n, w = LOGICAL_W, h = LOGICAL_H) {
|
|
93
|
-
const { cols, rows } = screenGrid(n); //
|
|
86
|
+
const { cols, rows } = screenGrid(n); // the single source: core/screens.ts
|
|
94
87
|
if (n <= 1)
|
|
95
88
|
return { single: true, cols, rows, canvas: { w, h }, viewports: [] };
|
|
96
89
|
const viewports = [];
|
|
@@ -98,7 +91,7 @@ export function planScreens(n, w = LOGICAL_W, h = LOGICAL_H) {
|
|
|
98
91
|
let x = (i % cols) * w;
|
|
99
92
|
const y = Math.floor(i / cols) * h;
|
|
100
93
|
if (n === 3 && i === 2)
|
|
101
|
-
x = (w * cols - w) / 2; // 3
|
|
94
|
+
x = (w * cols - w) / 2; // 3 screens: the 3rd centred on the bottom row
|
|
102
95
|
viewports.push({
|
|
103
96
|
x, y,
|
|
104
97
|
frame: { x: x + 0.5, y: y + 0.5, w: w - 1, h: h - 1 },
|
|
@@ -109,8 +102,8 @@ export function planScreens(n, w = LOGICAL_W, h = LOGICAL_H) {
|
|
|
109
102
|
}
|
|
110
103
|
export function initScreenPipeline(ctx) {
|
|
111
104
|
function configureRender() {
|
|
112
|
-
// 1)
|
|
113
|
-
//
|
|
105
|
+
// 1) dispose of the previous set — ALWAYS, including when going back to a single screen, or the previous
|
|
106
|
+
// configuration's render textures would stay on the GPU with nobody to draw them.
|
|
114
107
|
ctx.getVpSpr().forEach((s) => s.destroy());
|
|
115
108
|
ctx.setVpSpr([]);
|
|
116
109
|
ctx.getVpTex().forEach((t) => t.destroy(true));
|
|
@@ -123,7 +116,7 @@ export function initScreenPipeline(ctx) {
|
|
|
123
116
|
ctx.getVpDots().forEach((g) => g.destroy());
|
|
124
117
|
ctx.setVpDots([]);
|
|
125
118
|
const plan = planScreens(ctx.getNumPlayers());
|
|
126
|
-
// 2)
|
|
119
|
+
// 2) single screen: the camera is the stage's child again (beneath everything) and PIXI draws straight onto the canvas.
|
|
127
120
|
if (plan.single) {
|
|
128
121
|
if (ctx.camera.parent !== ctx.stage)
|
|
129
122
|
ctx.stage.addChildAt(ctx.camera, 0);
|
|
@@ -132,17 +125,17 @@ export function initScreenPipeline(ctx) {
|
|
|
132
125
|
ctx.buildGameHud();
|
|
133
126
|
return;
|
|
134
127
|
}
|
|
135
|
-
// 3)
|
|
136
|
-
// render
|
|
128
|
+
// 3) several screens: the camera LEAVES the scene — it is drawn by hand, once per viewport, into each player's
|
|
129
|
+
// render texture (the loop itself is the host's drawing).
|
|
137
130
|
if (ctx.camera.parent)
|
|
138
131
|
ctx.camera.parent.removeChild(ctx.camera);
|
|
139
|
-
ctx.setMinimapVisible(false); //
|
|
132
|
+
ctx.setMinimapVisible(false); // a minimap is single-screen (it does not fit replicated in 4 screens of 320×180)
|
|
140
133
|
ctx.renderer.resize(plan.canvas.w, plan.canvas.h);
|
|
141
134
|
const vpTex = [], vpSpr = [];
|
|
142
135
|
for (const vp of plan.viewports) {
|
|
143
136
|
const rt = ctx.RenderTexture.create({ width: LOGICAL_W, height: LOGICAL_H });
|
|
144
|
-
rt.baseTexture.scaleMode = ctx.NEAREST; // pixel art:
|
|
145
|
-
const s = ctx.
|
|
137
|
+
rt.baseTexture.scaleMode = ctx.NEAREST; // pixel art: enlarge without interpolating
|
|
138
|
+
const s = ctx.createSprite(rt);
|
|
146
139
|
s.x = vp.x;
|
|
147
140
|
s.y = vp.y;
|
|
148
141
|
ctx.stage.addChild(s);
|
|
@@ -151,18 +144,18 @@ export function initScreenPipeline(ctx) {
|
|
|
151
144
|
}
|
|
152
145
|
ctx.setVpTex(vpTex);
|
|
153
146
|
ctx.setVpSpr(vpSpr);
|
|
154
|
-
//
|
|
155
|
-
const vpFrames = ctx.
|
|
147
|
+
// the frame: one line per screen, in a single Graphics (it separates and frames like the single screen's border)
|
|
148
|
+
const vpFrames = ctx.createDrawing();
|
|
156
149
|
for (const vp of plan.viewports) {
|
|
157
150
|
vpFrames.lineStyle(FRAME_WIDTH, FRAME_COLOR, FRAME_ALPHA);
|
|
158
151
|
vpFrames.drawRect(vp.frame.x, vp.frame.y, vp.frame.w, vp.frame.h);
|
|
159
152
|
}
|
|
160
153
|
ctx.stage.addChild(vpFrames);
|
|
161
154
|
ctx.setVpFrames(vpFrames);
|
|
162
|
-
//
|
|
163
|
-
//
|
|
155
|
+
// the vision mode's indicator dots: ABOVE everything and OUTSIDE the render texture, so outside the viewport's
|
|
156
|
+
// filter — which is why they stay visible in blindness mode (see updateVpDots in viz-setters).
|
|
164
157
|
ctx.setVpDots(plan.viewports.map((vp) => {
|
|
165
|
-
const g = ctx.
|
|
158
|
+
const g = ctx.createDrawing();
|
|
166
159
|
g.x = vp.dot.x;
|
|
167
160
|
g.y = vp.dot.y;
|
|
168
161
|
g.visible = false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
|
|
2
|
+
import { type CanvasDoc } from './canvas.js';
|
|
3
|
+
export declare function spriteToCanvas(doc: CanvasDoc, art: string[]): HTMLCanvasElement;
|
|
3
4
|
export declare function outlineCanvas(src: HTMLCanvasElement, thick: number): HTMLCanvasElement;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// render/sprite-fx.ts — helpers
|
|
3
|
-
// • spriteToCanvas:
|
|
4
|
-
// • outlineCanvas:
|
|
5
|
-
// +
|
|
2
|
+
// render/sprite-fx.ts — canvas helpers for SPRITES/silhouettes, over render/canvas.ts. A leaf module (only makeCanvas):
|
|
3
|
+
// • spriteToCanvas: paints 16×32 ASCII art (1 char = 1 px) with the unified APP palette, in the document it is handed.
|
|
4
|
+
// • outlineCanvas: a single DARK outline behind the art (high contrast's foreground) — the silhouette offset in a ring
|
|
5
|
+
// + the art on top (no cut into inner gaps). APP / _silhouette / OUTLINE_DARK are private.
|
|
6
|
+
// ADR-0232: no global document. A helper that already holds a canvas makes its scratch canvases in THAT canvas's
|
|
7
|
+
// document (`src.ownerDocument`); the one that holds none takes the document as a parameter.
|
|
6
8
|
import { makeCanvas } from './canvas.js';
|
|
7
|
-
//
|
|
8
|
-
// · W
|
|
9
|
+
// The UNIFIED palette — light from the top left, dark outline. H hair · S skin · D skin shadow · K outline/eye
|
|
10
|
+
// · W white · R shirt · T shirt shadow · B trousers · P trousers shadow.
|
|
9
11
|
const APP = { H: '#403020', S: '#c08070', D: '#9a5f50', K: '#1a1420', W: '#e8eef0', R: '#3090d0', T: '#2566a0', B: '#303050', P: '#20203a' };
|
|
10
|
-
export function spriteToCanvas(art) {
|
|
11
|
-
const cv = makeCanvas(16, 32), c = cv.getContext('2d');
|
|
12
|
+
export function spriteToCanvas(doc, art) {
|
|
13
|
+
const cv = makeCanvas(doc, 16, 32), c = cv.getContext('2d');
|
|
12
14
|
for (let y = 0; y < 32; y++) {
|
|
13
15
|
const row = art[y];
|
|
14
16
|
if (!row)
|
|
@@ -23,18 +25,18 @@ export function spriteToCanvas(art) {
|
|
|
23
25
|
}
|
|
24
26
|
return cv;
|
|
25
27
|
}
|
|
26
|
-
const OUTLINE_DARK = '#0a0a08'; //
|
|
27
|
-
function _silhouette(src, color) { const cv = makeCanvas(src.width, src.height), c = cv.getContext('2d'); c.drawImage(src, 0, 0); c.globalCompositeOperation = 'source-in'; c.fillStyle = color; c.fillRect(0, 0, cv.width, cv.height); return cv; }
|
|
28
|
-
//
|
|
28
|
+
const OUTLINE_DARK = '#0a0a08'; // dark outline (the Dev will redraw the art aiming at 3:1)
|
|
29
|
+
function _silhouette(src, color) { const cv = makeCanvas(src.ownerDocument, src.width, src.height), c = cv.getContext('2d'); c.drawImage(src, 0, 0); c.globalCompositeOperation = 'source-in'; c.fillStyle = color; c.fillRect(0, 0, cv.width, cv.height); return cv; }
|
|
30
|
+
// A single DARK outline: it keeps the art (outline BEHIND, art on top → it only shows on the outer edges, no cut into gaps).
|
|
29
31
|
export function outlineCanvas(src, thick) {
|
|
30
|
-
const cv = makeCanvas(src.width, src.height), c = cv.getContext('2d');
|
|
32
|
+
const cv = makeCanvas(src.ownerDocument, src.width, src.height), c = cv.getContext('2d');
|
|
31
33
|
const dark = _silhouette(src, OUTLINE_DARK), r = thick >= 2 ? 2 : 1;
|
|
32
34
|
for (let dx = -r; dx <= r; dx++)
|
|
33
35
|
for (let dy = -r; dy <= r; dy++) {
|
|
34
36
|
if (!dx && !dy)
|
|
35
37
|
continue;
|
|
36
38
|
c.drawImage(dark, dx, dy);
|
|
37
|
-
} //
|
|
39
|
+
} // the dark ring
|
|
38
40
|
c.drawImage(src, 0, 0);
|
|
39
|
-
return cv; //
|
|
41
|
+
return cv; // the art on top → no inner cut
|
|
40
42
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
import type
|
|
3
|
-
|
|
2
|
+
import { type CanvasDoc } from './canvas.js';
|
|
3
|
+
import { type HighContrast } from './high-contrast.js';
|
|
4
|
+
import type { RenderInto } from './port.js';
|
|
5
|
+
/** What `pixiFilterFor` touches of a `PIXI.ColorMatrixFilter` — and only that. */
|
|
4
6
|
interface ColorMatrixLike {
|
|
5
7
|
matrix: number[];
|
|
6
8
|
brightness(b: number, multiply: boolean): void;
|
|
@@ -9,43 +11,46 @@ interface ColorMatrixLike {
|
|
|
9
11
|
interface ColorMatrixCtor {
|
|
10
12
|
new (): ColorMatrixLike;
|
|
11
13
|
}
|
|
12
|
-
/** `PIXI.BlurFilter`
|
|
14
|
+
/** `PIXI.BlurFilter` is opaque here: it is only built with a strength and handed to the sprite's `filters`. */
|
|
13
15
|
interface BlurCtor {
|
|
14
16
|
new (strength: number): unknown;
|
|
15
17
|
}
|
|
16
|
-
/**
|
|
18
|
+
/** The sprite reused to stamp the low-vision overlay — only its texture is swapped. */
|
|
17
19
|
interface TexturedSprite {
|
|
18
20
|
texture: unknown;
|
|
19
21
|
}
|
|
20
|
-
/** `app.renderer` — só a passada extra em render-texture (`clear:false` = por cima da cena já desenhada). */
|
|
21
22
|
export interface ViewportsCtx {
|
|
22
23
|
ColorMatrixFilter: ColorMatrixCtor | null | undefined;
|
|
23
24
|
BlurFilter: BlurCtor | null | undefined;
|
|
24
25
|
parallaxTexNormal: unknown[];
|
|
25
26
|
getTreeTexNormal: () => unknown;
|
|
26
27
|
getLvOverlaySpr: () => TexturedSprite;
|
|
27
|
-
|
|
28
|
+
renderInto: RenderInto;
|
|
28
29
|
getVpTex: () => unknown[];
|
|
29
30
|
cvdDefsHost: Element | null;
|
|
31
|
+
/** The document the overlay canvases are made in — passed, never the global one (ADR-0232, issue #207). */
|
|
32
|
+
doc: CanvasDoc;
|
|
33
|
+
/** The two recolours this module asks of it. REQUIRED: the palette and the outline level are that instance's. */
|
|
34
|
+
hc: Pick<HighContrast, 'directBgTexture' | 'directSpriteTexture'>;
|
|
30
35
|
}
|
|
31
36
|
export interface ViewportsApi {
|
|
32
|
-
/**
|
|
37
|
+
/** Parallax layer `i` in `mode`: high contrast pushes the background back (desaturates/darkens); else the raw texture. */
|
|
33
38
|
parallaxTexFor(i: number, mode: string): unknown;
|
|
34
|
-
/**
|
|
39
|
+
/** Background decoration (tree) in `mode`: the parallax's rule, its own cache. */
|
|
35
40
|
treeTexFor(mode: string): unknown;
|
|
36
|
-
/**
|
|
41
|
+
/** The player's frame in `mode`: high contrast gets a dark outline (it jumps off the pushed-back background). */
|
|
37
42
|
playerVizTex(base: unknown, mode: string): unknown;
|
|
38
|
-
/**
|
|
43
|
+
/** The viewport's GPU filter for `mode` (an array of filters, or `null` when the mode uses none). */
|
|
39
44
|
pixiFilterFor(mode: string): unknown;
|
|
40
|
-
/**
|
|
45
|
+
/** The 320×180 canvas of the low-vision overlay (`haze`/`tunnel`/`macular`/`diabetic`). */
|
|
41
46
|
lvOverlayCanvas(lv: string): HTMLCanvasElement;
|
|
42
|
-
/**
|
|
47
|
+
/** The low-vision overlay texture (memoised). `blur` has no overlay — it is a pure filter → `null`. */
|
|
43
48
|
lvOverlayTex(lv: string): unknown;
|
|
44
|
-
/**
|
|
49
|
+
/** Stamps player `i`'s low-vision overlay INSIDE the viewport's render texture, over the scene. */
|
|
45
50
|
renderVpOverlay(i: number, mode: string): void;
|
|
46
|
-
/**
|
|
51
|
+
/** Invalidates the recoloured parallax cache — the scenery changed, the raw textures are different. */
|
|
47
52
|
clearParallaxTexCache(): void;
|
|
48
|
-
/**
|
|
53
|
+
/** Invalidates the cache of outlined player frames (called by `rebakeDirect` in viz-setters). */
|
|
49
54
|
clearPlayerDirectCache(): void;
|
|
50
55
|
}
|
|
51
56
|
export declare function initViewports(ctx: ViewportsCtx): ViewportsApi;
|