@jgengine/shell 0.10.0 → 0.12.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/CHANGELOG.md +39 -2
- package/LICENSE +203 -661
- package/README.md +1 -1
- package/dist/CombatPresentation.d.ts +5 -0
- package/dist/CombatPresentation.js +8 -0
- package/dist/GameHost.d.ts +25 -1
- package/dist/GameHost.js +60 -4
- package/dist/GamePhaseStamp.d.ts +1 -0
- package/dist/GamePhaseStamp.js +9 -0
- package/dist/GamePlayer.d.ts +5 -0
- package/dist/GamePlayer.js +5 -0
- package/dist/GamePlayerShell.d.ts +5 -12
- package/dist/GamePlayerShell.js +67 -1332
- package/dist/GameUiPreview.js +3 -2
- package/dist/Shell3dPresentation.d.ts +63 -0
- package/dist/Shell3dPresentation.js +302 -0
- package/dist/ShellChrome.d.ts +51 -0
- package/dist/ShellChrome.js +51 -0
- package/dist/ShellHudPresentation.d.ts +41 -0
- package/dist/ShellHudPresentation.js +22 -0
- package/dist/audio/audioEngine.d.ts +4 -0
- package/dist/audio/audioEngine.js +128 -21
- package/dist/audio/audioWire.d.ts +40 -0
- package/dist/audio/audioWire.js +62 -0
- package/dist/audio/loopParams.d.ts +20 -0
- package/dist/audio/loopParams.js +28 -0
- package/dist/behaviour.d.ts +2 -1
- package/dist/behaviour.js +2 -1
- package/dist/behaviourAttach.d.ts +1 -0
- package/dist/behaviourAttach.js +1 -0
- package/dist/behaviourDriver.d.ts +1 -0
- package/dist/behaviourDriver.js +1 -0
- package/dist/boundActionDispatch.d.ts +13 -0
- package/dist/boundActionDispatch.js +37 -0
- package/dist/camera/GameCameraRig.d.ts +5 -2
- package/dist/camera/GameCameraRig.js +8 -3
- package/dist/camera/GameFirstPersonCamera.d.ts +9 -2
- package/dist/camera/GameFirstPersonCamera.js +8 -3
- package/dist/camera/GameInspectionCamera.d.ts +1 -1
- package/dist/camera/GameInspectionCamera.js +2 -2
- package/dist/camera/GameOrbitCamera.js +24 -9
- package/dist/camera/cameraBlendMath.d.ts +3 -0
- package/dist/camera/cameraBlendMath.js +3 -0
- package/dist/camera/cameraRigs.d.ts +3 -1
- package/dist/camera/cameraRigs.js +21 -3
- package/dist/camera/fovPreference.d.ts +6 -1
- package/dist/camera/fovPreference.js +6 -1
- package/dist/camera/index.d.ts +4 -7
- package/dist/camera/index.js +4 -7
- package/dist/camera/inspectionCameraMath.d.ts +7 -2
- package/dist/camera/inspectionCameraMath.js +7 -2
- package/dist/camera/orbitCameraMath.d.ts +36 -6
- package/dist/camera/orbitCameraMath.js +56 -6
- package/dist/camera/rigMath.d.ts +114 -24
- package/dist/camera/rigMath.js +129 -24
- package/dist/camera/rigResolve.d.ts +4 -2
- package/dist/camera/rigResolve.js +4 -2
- package/dist/camera/shakeChannel.d.ts +6 -2
- package/dist/camera/shakeChannel.js +6 -2
- package/dist/camera/shakeChannelMath.d.ts +1 -0
- package/dist/camera/shakeChannelMath.js +1 -0
- package/dist/commandSink.d.ts +8 -3
- package/dist/commandSink.js +8 -3
- package/dist/defineGame.d.ts +15 -1
- package/dist/defineGame.js +50 -9
- package/dist/devtools/ColPanel.d.ts +1 -0
- package/dist/devtools/ColPanel.js +14 -0
- package/dist/devtools/DevtoolsOverlay.d.ts +11 -7
- package/dist/devtools/DevtoolsOverlay.js +47 -462
- package/dist/devtools/KeysPanel.d.ts +4 -0
- package/dist/devtools/KeysPanel.js +31 -0
- package/dist/devtools/LogsPanel.d.ts +1 -0
- package/dist/devtools/LogsPanel.js +12 -0
- package/dist/devtools/NetPanel.d.ts +4 -0
- package/dist/devtools/NetPanel.js +10 -0
- package/dist/devtools/PerfPanel.d.ts +4 -0
- package/dist/devtools/PerfPanel.js +53 -0
- package/dist/devtools/TunePanel.d.ts +3 -0
- package/dist/devtools/TunePanel.js +309 -0
- package/dist/devtools/agentBridge.d.ts +41 -0
- package/dist/devtools/agentBridge.js +266 -0
- package/dist/devtools/collisionDebug.d.ts +6 -0
- package/dist/devtools/collisionDebug.js +6 -0
- package/dist/devtools/collisionDebugMath.d.ts +8 -2
- package/dist/devtools/collisionDebugMath.js +24 -5
- package/dist/devtools/devtoolsOverrides.d.ts +6 -0
- package/dist/devtools/devtoolsOverrides.js +48 -0
- package/dist/devtools/panelAtoms.d.ts +9 -0
- package/dist/devtools/panelAtoms.js +10 -0
- package/dist/devtools/perfDiagnose.d.ts +2 -0
- package/dist/devtools/perfDiagnose.js +43 -0
- package/dist/diagnostics/RuntimeDiagnostics.d.ts +36 -0
- package/dist/diagnostics/RuntimeDiagnostics.js +80 -0
- package/dist/drivers/FrameDriver.d.ts +37 -0
- package/dist/drivers/FrameDriver.js +232 -0
- package/dist/drivers/HudOnlyDriver.d.ts +16 -0
- package/dist/drivers/HudOnlyDriver.js +60 -0
- package/dist/environment/Daylight.d.ts +23 -7
- package/dist/environment/Daylight.js +106 -13
- package/dist/environment/EnvironmentScene.js +44 -9
- package/dist/environment/VolumetricClouds.d.ts +17 -0
- package/dist/environment/VolumetricClouds.js +202 -0
- package/dist/environment/daylightCycle.d.ts +3 -1
- package/dist/environment/daylightCycle.js +3 -1
- package/dist/environment/groundPadMath.d.ts +3 -0
- package/dist/environment/groundPadMath.js +3 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.js +1 -0
- package/dist/environment/skyLightingPolicy.d.ts +2 -0
- package/dist/environment/skyLightingPolicy.js +2 -0
- package/dist/environment/terrainGroundColor.d.ts +9 -0
- package/dist/environment/terrainGroundColor.js +22 -0
- package/dist/gameKit.d.ts +27 -0
- package/dist/gameKit.js +29 -0
- package/dist/hotbarActions.d.ts +26 -0
- package/dist/hotbarActions.js +27 -0
- package/dist/inputSink.d.ts +16 -4
- package/dist/inputSink.js +57 -7
- package/dist/map/MapMarkerBeacons.d.ts +3 -2
- package/dist/materialOverride.d.ts +10 -0
- package/dist/materialOverride.js +15 -3
- package/dist/multiplayer.js +8 -2
- package/dist/postfx/PostProcessing.d.ts +9 -1
- package/dist/postfx/PostProcessing.js +56 -11
- package/dist/postfx/gradeShader.js +9 -1
- package/dist/presentationResolve.d.ts +35 -0
- package/dist/presentationResolve.js +51 -0
- package/dist/registry.d.ts +4 -2
- package/dist/render/EnvironmentLighting.d.ts +10 -0
- package/dist/render/EnvironmentLighting.js +34 -0
- package/dist/render/SceneLighting.d.ts +7 -0
- package/dist/render/SceneLighting.js +18 -0
- package/dist/render/SceneModels.d.ts +14 -0
- package/dist/render/SceneModels.js +337 -0
- package/dist/render/assetBase.d.ts +17 -0
- package/dist/render/assetBase.js +35 -0
- package/dist/render/defaultSurface.d.ts +29 -0
- package/dist/render/defaultSurface.js +101 -0
- package/dist/render/modelLoad.d.ts +24 -0
- package/dist/render/modelLoad.js +76 -0
- package/dist/render/modelRender.d.ts +11 -0
- package/dist/render/modelRender.js +15 -0
- package/dist/render/resolveModel.d.ts +54 -3
- package/dist/render/resolveModel.js +116 -4
- package/dist/render/useEntityRenderCues.d.ts +13 -0
- package/dist/render/useEntityRenderCues.js +62 -0
- package/dist/scatter/InstancedScatter.d.ts +24 -0
- package/dist/scatter/InstancedScatter.js +135 -0
- package/dist/scatter/scatterModels.d.ts +25 -0
- package/dist/scatter/scatterModels.js +61 -0
- package/dist/scatter/scatterProxies.d.ts +6 -0
- package/dist/scatter/scatterProxies.js +118 -0
- package/dist/scatter.d.ts +1 -0
- package/dist/scatter.js +1 -0
- package/dist/scene/AuthoredScene.d.ts +84 -0
- package/dist/scene/AuthoredScene.js +178 -0
- package/dist/scene/CityRenderer.d.ts +2 -0
- package/dist/scene/CityRenderer.js +1031 -0
- package/dist/scene/GeneratedAssetRenderer.d.ts +14 -0
- package/dist/scene/GeneratedAssetRenderer.js +59 -0
- package/dist/scene/GrassFieldRenderer.d.ts +2 -0
- package/dist/scene/GrassFieldRenderer.js +73 -0
- package/dist/scene/PoleLineRenderer.d.ts +2 -0
- package/dist/scene/PoleLineRenderer.js +287 -0
- package/dist/scene/SoilPatchRenderer.d.ts +2 -0
- package/dist/scene/SoilPatchRenderer.js +84 -0
- package/dist/scene/StudioStage.d.ts +37 -0
- package/dist/scene/StudioStage.js +42 -0
- package/dist/scene/WaterRenderer.d.ts +2 -0
- package/dist/scene/WaterRenderer.js +61 -0
- package/dist/scene/builtinSceneKindRenderers.d.ts +2 -0
- package/dist/scene/builtinSceneKindRenderers.js +26 -0
- package/dist/scene/cityWindowMaterial.d.ts +16 -0
- package/dist/scene/cityWindowMaterial.js +81 -0
- package/dist/scene/sceneKindRenderers.d.ts +30 -0
- package/dist/scene/sceneKindRenderers.js +17 -0
- package/dist/scene.d.ts +1 -0
- package/dist/scene.js +1 -0
- package/dist/settings/appliedSettings.d.ts +7 -1
- package/dist/settings/appliedSettings.js +13 -2
- package/dist/settings/settingsController.d.ts +2 -0
- package/dist/settings/settingsController.js +22 -1
- package/dist/shellConstants.d.ts +4 -0
- package/dist/shellConstants.js +4 -0
- package/dist/shellMovement.d.ts +8 -0
- package/dist/shellMovement.js +11 -0
- package/dist/shellPointer.d.ts +20 -0
- package/dist/shellPointer.js +28 -0
- package/dist/structures/PlacementGhost.d.ts +4 -0
- package/dist/structures/PlacementGhost.js +4 -0
- package/dist/structures/TransformGizmo.d.ts +53 -0
- package/dist/structures/TransformGizmo.js +59 -0
- package/dist/structures/index.d.ts +1 -0
- package/dist/structures/index.js +1 -0
- package/dist/terrain/GrassField.d.ts +11 -3
- package/dist/terrain/GrassField.js +16 -6
- package/dist/terrain/TerraformBrushCursor.js +3 -0
- package/dist/terrain/grassBudget.d.ts +11 -2
- package/dist/terrain/grassBudget.js +20 -4
- package/dist/terrain/grassGeometry.d.ts +35 -0
- package/dist/terrain/grassGeometry.js +85 -20
- package/dist/terrain/grassMaterial.d.ts +20 -0
- package/dist/terrain/grassMaterial.js +68 -13
- package/dist/terrain/heightfieldGeometry.d.ts +34 -0
- package/dist/terrain/heightfieldGeometry.js +109 -0
- package/dist/terrain/index.d.ts +1 -0
- package/dist/terrain/index.js +1 -0
- package/dist/terrain/random.d.ts +3 -0
- package/dist/terrain/random.js +3 -0
- package/dist/terrain/soilPatchMaterial.d.ts +23 -0
- package/dist/terrain/soilPatchMaterial.js +147 -0
- package/dist/terrain/terrainDetailMaterial.d.ts +19 -2
- package/dist/terrain/terrainDetailMaterial.js +87 -7
- package/dist/terrain/terrainMath.d.ts +8 -1
- package/dist/terrain/terrainMath.js +8 -1
- package/dist/touch/TouchControlsOverlay.d.ts +9 -5
- package/dist/touch/TouchControlsOverlay.js +201 -22
- package/dist/useShellMultiplayerSync.d.ts +9 -0
- package/dist/useShellMultiplayerSync.js +98 -0
- package/dist/visibility/CullingProvider.js +1 -1
- package/dist/water/Ocean.d.ts +7 -1
- package/dist/water/Ocean.js +16 -3
- package/dist/water/OceanConfig.d.ts +11 -0
- package/dist/water/OceanConfig.js +8 -0
- package/dist/water/OceanMaterial.d.ts +12 -0
- package/dist/water/OceanMaterial.js +9 -0
- package/dist/water/OceanShader.d.ts +2 -2
- package/dist/water/OceanShader.js +78 -10
- package/dist/weather/fireSpreadPose.d.ts +1 -0
- package/dist/weather/fireSpreadPose.js +1 -0
- package/dist/weather/weatherGeometry.d.ts +1 -0
- package/dist/weather/weatherGeometry.js +1 -0
- package/dist/weather/weatherMath.d.ts +3 -0
- package/dist/weather/weatherMath.js +3 -0
- package/dist/weather/weatherUniforms.d.ts +3 -0
- package/dist/weather/weatherUniforms.js +3 -0
- package/dist/world/PlaceScene.d.ts +11 -0
- package/dist/world/PlaceScene.js +27 -0
- package/dist/world/RetainedVfx.d.ts +10 -0
- package/dist/world/RetainedVfx.js +136 -0
- package/dist/world/WorldHud.d.ts +49 -2
- package/dist/world/WorldHud.js +87 -2
- package/dist/world/WorldScene.d.ts +21 -0
- package/dist/world/WorldScene.js +186 -0
- package/dist/world/WorldVfx.d.ts +9 -0
- package/dist/world/WorldVfx.js +184 -0
- package/dist/world/entityPose.d.ts +2 -0
- package/dist/world/entityPose.js +2 -0
- package/dist/world/floatTextStyle.d.ts +1 -0
- package/dist/world/floatTextStyle.js +1 -0
- package/dist/world/telegraphPulse.d.ts +1 -0
- package/dist/world/telegraphPulse.js +1 -0
- package/dist/world/worldBarSamples.d.ts +25 -0
- package/dist/world/worldBarSamples.js +38 -0
- package/dist/worldSky.d.ts +11 -0
- package/dist/worldSky.js +21 -0
- package/dist/worldSync.d.ts +2 -1
- package/dist/worldSync.js +2 -1
- package/package.json +6 -6
- package/skills/game-design/SKILL.md +28 -0
- package/skills/game-design/agents/openai.yaml +4 -0
- package/skills/game-design/references/application-playbook.md +170 -0
- package/skills/game-design/references/field-guide.md +288 -0
- package/skills/jgengine/SKILL.md +54 -0
- package/skills/jgengine/api.md +527 -0
- package/skills/jgengine/capabilities.md +131 -0
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-ui/SKILL.md +41 -0
- package/skills/jgengine-ui/api.md +2007 -0
- package/skills/jgengine-ui/capabilities.md +211 -0
- package/skills/jgengine-ui/recipes/portable-minimap.md +150 -0
- package/skills/jgengine-ui/reference.md +513 -0
- package/skills/jgengine-ui/references/visual-scorecard.md +73 -0
- package/skills/jgengine-world/SKILL.md +51 -0
- package/skills/jgengine-world/api.md +3056 -0
- package/skills/jgengine-world/capabilities.md +476 -0
- package/skills/jgengine-world/recipes/commanding-entities.md +128 -0
- package/skills/jgengine-world/reference.md +261 -0
- package/skills/level-design/SKILL.md +54 -0
- package/skills/level-design/agents/openai.yaml +4 -0
- package/skills/level-design/references/application-playbook.md +192 -0
- package/skills/level-design/references/field-guide.md +337 -0
- package/skills/level-design/references/live-editor-loop.md +179 -0
- package/dist/cartridge.d.ts +0 -145
- package/dist/cartridge.js +0 -246
- package/llms.txt +0 -2761
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<!-- GENERATED by scripts/gen-capability-index.ts — do not edit. Regenerate: bun run gen:capabilities -->
|
|
2
|
+
|
|
3
|
+
# jgengine-ui — capability index
|
|
4
|
+
|
|
5
|
+
Reach for these before hand-rolling. Each row is *the thing you need* → *the primitive that already does it*.
|
|
6
|
+
|
|
7
|
+
## action-bar — optional skinned action-bar composition over the headless model — games own chrome
|
|
8
|
+
|
|
9
|
+
- `ActionBar` (function) · `import { ActionBar } from "@jgengine/react"`
|
|
10
|
+
|
|
11
|
+
## action-bar-chrome — accessible grid/list toolbar renderer over an action-bar model with swappable item chrome
|
|
12
|
+
|
|
13
|
+
- `ActionBarChrome` (function) · `import { ActionBarChrome } from "@jgengine/react"`
|
|
14
|
+
|
|
15
|
+
## action-bar-model — headless action-collection model with focus, hover, keyboard, and hotkey routing
|
|
16
|
+
|
|
17
|
+
- `useActionBar` (function) · `import { useActionBar } from "@jgengine/react"`
|
|
18
|
+
|
|
19
|
+
## action-button — cooldown/cost/hotkey action button with complete interaction states
|
|
20
|
+
|
|
21
|
+
- `ActionButton` (function) · `import { ActionButton } from "@jgengine/react"`
|
|
22
|
+
|
|
23
|
+
## action-from-ability-slot — adapt a combat ability-kit snapshot into an action-bar action def
|
|
24
|
+
|
|
25
|
+
- `actionFromAbilitySlot` (function) · `import { actionFromAbilitySlot } from "@jgengine/react"`
|
|
26
|
+
|
|
27
|
+
## action-tooltip — structured action tooltip body (title, cost, cooldown, blocking notes)
|
|
28
|
+
|
|
29
|
+
- `ActionTooltip` (function) · `import { ActionTooltip } from "@jgengine/react"`
|
|
30
|
+
|
|
31
|
+
## clock-format — format a signed time gap like a race split (+/- m:ss.ff)
|
|
32
|
+
|
|
33
|
+
- `formatDelta` (function) · `import { formatDelta } from "@jgengine/core/ui"`
|
|
34
|
+
- `formatDuration` (function) · `import { formatDuration } from "@jgengine/core/ui"`
|
|
35
|
+
|
|
36
|
+
## controls-list — keybind-derived control legend that hides on touch
|
|
37
|
+
|
|
38
|
+
- `ControlsList` (function) · `import { ControlsList } from "@jgengine/react"`
|
|
39
|
+
|
|
40
|
+
## default-look — one field that lights a scene like a shipped game (opt out with "flat")
|
|
41
|
+
|
|
42
|
+
- `LookPreset` (type) · `import { LookPreset } from "@jgengine/core/ui"`
|
|
43
|
+
|
|
44
|
+
## distance-format — render meters as m or km for HUD stats, telemetry, and range readouts
|
|
45
|
+
|
|
46
|
+
- `formatDistance` (function) · `import { formatDistance } from "@jgengine/core/ui"`
|
|
47
|
+
|
|
48
|
+
## entity-portrait — selectable entity portrait tile with vitals and selected/focus states
|
|
49
|
+
|
|
50
|
+
- `EntityPortrait` (function) · `import { EntityPortrait } from "@jgengine/react"`
|
|
51
|
+
|
|
52
|
+
## entity-render-cues — live velocity/bob/fire/reload/hit/death cues for a custom renderEntity or viewmodel component
|
|
53
|
+
|
|
54
|
+
- `useEntityRenderCues` (function) · `import { useEntityRenderCues } from "@jgengine/shell/render/useEntityRenderCues"`
|
|
55
|
+
|
|
56
|
+
## entity-summary — primary selected-entity detail panel (name, tags, vitals)
|
|
57
|
+
|
|
58
|
+
- `EntitySummary` (function) · `import { EntitySummary } from "@jgengine/react"`
|
|
59
|
+
|
|
60
|
+
## event-meter-hud — render a core event/heat meter's live value, fraction, tier, and ready state in a HUD gauge
|
|
61
|
+
|
|
62
|
+
- `useEventMeter` (function) · `import { useEventMeter } from "@jgengine/react"`
|
|
63
|
+
|
|
64
|
+
## heightfield-mesh-update — in-place partial update of a displaced ground plane mesh
|
|
65
|
+
|
|
66
|
+
- `displaceHeightfieldGeometry` (function) · `import { displaceHeightfieldGeometry } from "@jgengine/shell/terrain"`
|
|
67
|
+
|
|
68
|
+
## hud-canvas — the HUD root surface — design-resolution scaling plus live panel-placement editing (F2+C)
|
|
69
|
+
|
|
70
|
+
- `HudCanvas` (function) · `import { HudCanvas } from "@jgengine/react"`
|
|
71
|
+
|
|
72
|
+
## hud-clock — in-game time-of-day readout bound to the sim clock
|
|
73
|
+
|
|
74
|
+
- `Clock` (function) · `import { Clock } from "@jgengine/react"`
|
|
75
|
+
|
|
76
|
+
## hud-coins — currency counter widget bound to a currency id
|
|
77
|
+
|
|
78
|
+
- `Coins` (function) · `import { Coins } from "@jgengine/react"`
|
|
79
|
+
|
|
80
|
+
## hud-frame — optional framed panel skins (glass/plate/retro/themed) — games own product chrome
|
|
81
|
+
|
|
82
|
+
- `HudFrame` (function) · `import { HudFrame } from "@jgengine/react"`
|
|
83
|
+
|
|
84
|
+
## hud-hotbar — optional inventory hotbar building block — games own slot chrome
|
|
85
|
+
|
|
86
|
+
- `Hotbar` (function) · `import { Hotbar } from "@jgengine/react"`
|
|
87
|
+
|
|
88
|
+
## hud-icons — painted-icon treatment for hotbar/action slots — glyph + gradient + count badge
|
|
89
|
+
|
|
90
|
+
- `IconSchool` (type) · `import { IconSchool } from "@jgengine/react"`
|
|
91
|
+
|
|
92
|
+
## hud-layout — persistent, live-editable HUD panel layout state for `HudCanvas`
|
|
93
|
+
|
|
94
|
+
- `useHudLayout` (function) · `import { useHudLayout } from "@jgengine/react"`
|
|
95
|
+
|
|
96
|
+
## hud-layout-persist — inject a host callback so canvas HUD edits commit into the scene document
|
|
97
|
+
|
|
98
|
+
- `HudLayoutPersistProvider` (function) · `import { HudLayoutPersistProvider } from "@jgengine/react"`
|
|
99
|
+
|
|
100
|
+
## hud-layout-persist-hook — read the host panel-commit port from a HUD layout widget
|
|
101
|
+
|
|
102
|
+
- `useHudLayoutPersist` (function) · `import { useHudLayoutPersist } from "@jgengine/react"`
|
|
103
|
+
|
|
104
|
+
## hud-panel — anchored HUD slot — drop any widget in a named, player-movable panel
|
|
105
|
+
|
|
106
|
+
- `HudPanel` (function) · `import { HudPanel } from "@jgengine/react"`
|
|
107
|
+
|
|
108
|
+
## hud-slots — atomic themed equipment/weapon/armor/potion slot grids with painted icons
|
|
109
|
+
|
|
110
|
+
- `SlotItem` (interface) · `import { SlotItem } from "@jgengine/react"`
|
|
111
|
+
|
|
112
|
+
## hud-stat-bar — optional stat-bound bar building block (health, mana, stamina) — prefer game-owned chrome
|
|
113
|
+
|
|
114
|
+
- `StatBar` (function) · `import { StatBar } from "@jgengine/react"`
|
|
115
|
+
|
|
116
|
+
## hud-theme — game-authored token object for bars, frames, slots, and minimap ring
|
|
117
|
+
|
|
118
|
+
- `HudThemePalette` (interface) · `import { HudThemePalette } from "@jgengine/react"`
|
|
119
|
+
|
|
120
|
+
## hud-vitals — atomic purpose-named vitals bars (token-themed parts, not a finished HUD)
|
|
121
|
+
|
|
122
|
+
- `BarTokens` (interface) · `import { BarTokens } from "@jgengine/react"`
|
|
123
|
+
- `barTokens` (function) · `import { barTokens } from "@jgengine/react"`
|
|
124
|
+
|
|
125
|
+
## key-hint — keyboard/mouse control hint that hides itself on touch
|
|
126
|
+
|
|
127
|
+
- `KeyHint` (function) · `import { KeyHint } from "@jgengine/react"`
|
|
128
|
+
|
|
129
|
+
## keycap — styled keyboard/mouse key cap for control hints
|
|
130
|
+
|
|
131
|
+
- `Keycap` (function) · `import { Keycap } from "@jgengine/react"`
|
|
132
|
+
|
|
133
|
+
## live-markers — a self-ticking MarkerSet kept in sync from the live scene each HUD tick — pass a rebuild(markers, ctx) that clears+repopulates, no hand-rolled setInterval
|
|
134
|
+
|
|
135
|
+
- `useLiveMarkers` (function) · `import { useLiveMarkers } from "@jgengine/react"`
|
|
136
|
+
|
|
137
|
+
## minimap — framed circular minimap with terrain bake, fog, markers, and facing arrow
|
|
138
|
+
|
|
139
|
+
- `Minimap` (function) · `import { Minimap } from "@jgengine/react"`
|
|
140
|
+
|
|
141
|
+
## minimap-chrome — ring frame plus edge-clamped, heading-aware marker dots to nest inside a game's own `<svg>`
|
|
142
|
+
|
|
143
|
+
- `MinimapChrome` (function) · `import { MinimapChrome } from "@jgengine/react"`
|
|
144
|
+
|
|
145
|
+
## minimap-panel — circular minimap with zone label, clock, and compass composed together
|
|
146
|
+
|
|
147
|
+
- `MinimapPanel` (function) · `import { MinimapPanel } from "@jgengine/react"`
|
|
148
|
+
|
|
149
|
+
## minimap-track-hud — horizontal linear track minimap (corridor/route progress) — colored zone spans and gate/player pips positioned by 0..1 fraction, sharing chrome with the radial Minimap
|
|
150
|
+
|
|
151
|
+
- `MinimapTrack` (function) · `import { MinimapTrack } from "@jgengine/react"`
|
|
152
|
+
|
|
153
|
+
## nameplates — billboarded name + HP bar over nearby entities
|
|
154
|
+
|
|
155
|
+
- `WorldNameplates` (function) · `import { WorldNameplates } from "@jgengine/shell/world/WorldHud"`
|
|
156
|
+
|
|
157
|
+
## ordinal-format — format a placement number as 1st/2nd/3rd for HUD ranks
|
|
158
|
+
|
|
159
|
+
- `formatOrdinal` (function) · `import { formatOrdinal } from "@jgengine/core/ui"`
|
|
160
|
+
|
|
161
|
+
## placement-ghost — render valid/invalid placement preview mesh
|
|
162
|
+
|
|
163
|
+
- `PlacementGhost` (function) · `import { PlacementGhost } from "@jgengine/shell/structures"`
|
|
164
|
+
|
|
165
|
+
## popover — viewport-flipping, viewport-clamped anchored popover/tooltip shell
|
|
166
|
+
|
|
167
|
+
- `Popover` (function) · `import { Popover } from "@jgengine/react"`
|
|
168
|
+
|
|
169
|
+
## resolve-game-look — expand a look preset into concrete lighting/backdrop/post knobs
|
|
170
|
+
|
|
171
|
+
- `resolveGameLook` (function) · `import { resolveGameLook } from "@jgengine/core/ui"`
|
|
172
|
+
|
|
173
|
+
## selection-collection — accessible portrait-strip / group-chip renderer over a selection model
|
|
174
|
+
|
|
175
|
+
- `SelectionCollectionChrome` (function) · `import { SelectionCollectionChrome } from "@jgengine/react"`
|
|
176
|
+
|
|
177
|
+
## selection-group-chip — same-kind selection chip (icon + count) for a grouped selection
|
|
178
|
+
|
|
179
|
+
- `SelectionGroupChip` (function) · `import { SelectionGroupChip } from "@jgengine/react"`
|
|
180
|
+
|
|
181
|
+
## selection-model — headless multi-entity selection model with primary focus, grouping, and virtualization
|
|
182
|
+
|
|
183
|
+
- `useSelectionView` (function) · `import { useSelectionView } from "@jgengine/react"`
|
|
184
|
+
|
|
185
|
+
## selection-panel — optional selection-panel composition: summary + portrait strip / group chips
|
|
186
|
+
|
|
187
|
+
- `SelectionPanel` (function) · `import { SelectionPanel } from "@jgengine/react"`
|
|
188
|
+
|
|
189
|
+
## speed-format — render a m/s speed as km/h, mph, knots, or m/s for speedometers and telemetry HUDs
|
|
190
|
+
|
|
191
|
+
- `formatSpeed` (function) · `import { formatSpeed } from "@jgengine/core/ui"`
|
|
192
|
+
|
|
193
|
+
## start-screen — headless title/attract overlay the game fills and skins
|
|
194
|
+
|
|
195
|
+
- `StartScreen` (function) · `import { StartScreen } from "@jgengine/react"`
|
|
196
|
+
|
|
197
|
+
## studio-stage — cinematic lighting rig + backdrop + turntable for parametric studios
|
|
198
|
+
|
|
199
|
+
- `StudioStage` (function) · `import { StudioStage } from "@jgengine/shell/scene/StudioStage"`
|
|
200
|
+
|
|
201
|
+
## transform-gizmo — in-game select/move/rotate/scale gizmo
|
|
202
|
+
|
|
203
|
+
- `TransformGizmo` (const) · `import { TransformGizmo } from "@jgengine/shell/structures"`
|
|
204
|
+
|
|
205
|
+
## vital-bar — compact current/max vital meter for an entity summary
|
|
206
|
+
|
|
207
|
+
- `VitalBar` (function) · `import { VitalBar } from "@jgengine/react"`
|
|
208
|
+
|
|
209
|
+
## world-object-highlights — ground-ring highlight over every selected placed object
|
|
210
|
+
|
|
211
|
+
- `WorldObjectHighlights` (function) · `import { WorldObjectHighlights } from "@jgengine/shell/world/WorldHud"`
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Add the minimap to an existing React game
|
|
2
|
+
|
|
3
|
+
Use this recipe when a React game already owns its entities in an array, ECS
|
|
4
|
+
query, Zustand/Redux-style store, or another observable collection. JGengine
|
|
5
|
+
only needs a display view of those records; do not copy them into a
|
|
6
|
+
`MarkerSet`.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
Keep the React and React DOM versions already used by the project, then add the
|
|
11
|
+
two focused JGengine packages:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
bun add @jgengine/core @jgengine/react
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The minimap imports neither Three.js nor React Three Fiber and does not require
|
|
18
|
+
`GameProvider`.
|
|
19
|
+
|
|
20
|
+
## Static entity arrays
|
|
21
|
+
|
|
22
|
+
Project an existing array directly. Keep the array stable with the same memo or
|
|
23
|
+
selector the project already uses.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { useMemo } from "react";
|
|
27
|
+
import { Minimap } from "@jgengine/react/map";
|
|
28
|
+
|
|
29
|
+
interface Unit {
|
|
30
|
+
id: string;
|
|
31
|
+
x: number;
|
|
32
|
+
z: number;
|
|
33
|
+
team: "ally" | "enemy";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function MapHud({
|
|
37
|
+
units,
|
|
38
|
+
cameraTarget,
|
|
39
|
+
}: {
|
|
40
|
+
units: readonly Unit[];
|
|
41
|
+
cameraTarget: { x: number; z: number };
|
|
42
|
+
}) {
|
|
43
|
+
const markers = useMemo(
|
|
44
|
+
() =>
|
|
45
|
+
units.map((unit) => ({
|
|
46
|
+
id: unit.id,
|
|
47
|
+
position: [unit.x, 0, unit.z] as const,
|
|
48
|
+
kind: unit.team,
|
|
49
|
+
})),
|
|
50
|
+
[units],
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Minimap
|
|
55
|
+
markers={markers}
|
|
56
|
+
center={[cameraTarget.x, cameraTarget.z]}
|
|
57
|
+
worldRadius={120}
|
|
58
|
+
className="game-minimap"
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Only `id` and `position` are required. `kind`, `label`, `heading`, and `meta`
|
|
65
|
+
are optional display data; lifecycle timestamps are not part of this view.
|
|
66
|
+
|
|
67
|
+
## Observable external store
|
|
68
|
+
|
|
69
|
+
Create the adapter once per store. The source caches its projected marker array
|
|
70
|
+
until the external store emits, so React snapshot reads do not remap the world
|
|
71
|
+
on every frame.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { useMemo } from "react";
|
|
75
|
+
import { createMarkerSource } from "@jgengine/core/world/markers";
|
|
76
|
+
import { Minimap } from "@jgengine/react/map";
|
|
77
|
+
|
|
78
|
+
interface Unit {
|
|
79
|
+
id: string;
|
|
80
|
+
x: number;
|
|
81
|
+
z: number;
|
|
82
|
+
team: string;
|
|
83
|
+
name: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ExistingWorldStore {
|
|
87
|
+
subscribe(listener: () => void): () => void;
|
|
88
|
+
getState(): { units: readonly Unit[] };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function ExistingGameMinimap({
|
|
92
|
+
world,
|
|
93
|
+
cameraTarget,
|
|
94
|
+
}: {
|
|
95
|
+
world: ExistingWorldStore;
|
|
96
|
+
cameraTarget: { x: number; z: number };
|
|
97
|
+
}) {
|
|
98
|
+
const markers = useMemo(
|
|
99
|
+
() =>
|
|
100
|
+
createMarkerSource({
|
|
101
|
+
subscribe: (listener) => world.subscribe(listener),
|
|
102
|
+
getSnapshot: () => world.getState().units,
|
|
103
|
+
project: (unit) => ({
|
|
104
|
+
id: unit.id,
|
|
105
|
+
position: [unit.x, 0, unit.z] as const,
|
|
106
|
+
kind: unit.team,
|
|
107
|
+
label: unit.name,
|
|
108
|
+
}),
|
|
109
|
+
}),
|
|
110
|
+
[world],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<Minimap
|
|
115
|
+
markers={markers}
|
|
116
|
+
center={[cameraTarget.x, cameraTarget.z]}
|
|
117
|
+
worldRadius={120}
|
|
118
|
+
/>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For SSR, make the store's first client snapshot match the server snapshot. When
|
|
124
|
+
they differ structurally, pass `getServerSnapshot` to `createMarkerSource` and
|
|
125
|
+
read the same serialized initial units used to hydrate the external store.
|
|
126
|
+
|
|
127
|
+
## Ownership
|
|
128
|
+
|
|
129
|
+
The existing project still owns entities, updates, persistence, simulation,
|
|
130
|
+
camera, renderer, input, scheduling, and the subscription. JGengine owns only
|
|
131
|
+
the cached entity-to-marker projection, core world-to-map projection math, and
|
|
132
|
+
the React SVG presentation. Save and restore the project's unit state as usual;
|
|
133
|
+
markers are derived data and need no parallel save format.
|
|
134
|
+
|
|
135
|
+
Use `kindStyles`, `className`, and `style` to skin the production `Minimap`.
|
|
136
|
+
When the project owns every chrome element, compose `MinimapChrome` inside its
|
|
137
|
+
own SVG instead of adopting the framed default.
|
|
138
|
+
|
|
139
|
+
## Common traps
|
|
140
|
+
|
|
141
|
+
- Keep `getSnapshot()` array identity stable until `subscribe()` emits. This is
|
|
142
|
+
the React external-store contract.
|
|
143
|
+
- Create `createMarkerSource` outside render or in `useMemo`; recreating it each
|
|
144
|
+
render discards its projection cache.
|
|
145
|
+
- Pass world coordinates, not Three.js screen coordinates. Marker positions are
|
|
146
|
+
`[x, y, z]`; the minimap projects X/Z.
|
|
147
|
+
- Do not poll the source from a render loop. Notify subscribers when the
|
|
148
|
+
caller-owned collection changes.
|
|
149
|
+
- Do not add `createdAt` or `expiresAt` unless the project intentionally adopts
|
|
150
|
+
`MarkerSet` lifecycle behavior.
|