@holtjs/stage 0.8.0 → 0.10.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 +31 -0
- package/README.md +12 -11
- package/dist/{anims-ClNi6zZQ.d.ts → anims-xOSYNG79.d.ts} +23 -4
- package/dist/anims.d.ts +1 -1
- package/dist/anims.js +49 -5
- package/dist/display-CZb3yen0.js +2162 -0
- package/dist/{game-CEa0m4eX.d.ts → game-BbgtwqyW.d.ts} +80 -14
- package/dist/{game-D46nY-B2.js → game-CUZbJLbR.js} +107 -21
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/joystick.d.ts +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/lighting.d.ts +99 -15
- package/dist/lighting.js +602 -98
- package/dist/projection.d.ts +47 -14
- package/dist/projection.js +206 -4
- package/dist/{renderer-webgpu-BXU-ZDIp.js → renderer-webgpu-BZ3J971y.js} +43 -1925
- package/dist/renderer-webgpu.d.ts +1 -1
- package/dist/renderer-webgpu.js +1 -1
- package/dist/rig2d.d.ts +2 -2
- package/dist/tilemap.d.ts +1 -1
- package/dist/trace.d.ts +1 -1
- package/llms.txt +12 -11
- package/package.json +1 -1
- package/skills/stage/SKILL.md +17 -11
- package/skills/stage/references/subpaths.md +13 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as WebGpuBootstrapResult, Q as RequestWebGpuOptions, X as RendererWebGpu, Z as RendererWebGpuOptions, et as WebGpuCanvasContextLike, nt as requestWebGpuDevice, tt as WebGpuDeviceLike } from "./game-
|
|
1
|
+
import { $ as WebGpuBootstrapResult, Q as RequestWebGpuOptions, X as RendererWebGpu, Z as RendererWebGpuOptions, et as WebGpuCanvasContextLike, nt as requestWebGpuDevice, tt as WebGpuDeviceLike } from "./game-BbgtwqyW.js";
|
|
2
2
|
export { RendererWebGpu, RendererWebGpuOptions, RequestWebGpuOptions, WebGpuBootstrapResult, WebGpuCanvasContextLike, WebGpuDeviceLike, requestWebGpuDevice };
|
package/dist/renderer-webgpu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as RendererWebGpu, n as requestWebGpuDevice } from "./renderer-webgpu-
|
|
1
|
+
export { t as RendererWebGpu, n as requestWebGpuDevice } from "./renderer-webgpu-BZ3J971y.js";
|
package/dist/rig2d.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as BlendMode } from "./anims-
|
|
2
|
-
import {
|
|
1
|
+
import { T as BlendMode } from "./anims-xOSYNG79.js";
|
|
2
|
+
import { It as SceneHostLike, Tt as ImageObject, pt as Container, wt as Graphics } from "./game-BbgtwqyW.js";
|
|
3
3
|
export type RigCurveKind = 'linear' | 'step' | 'smoothstep' | 'outBack';
|
|
4
4
|
export interface RigBoneDef {
|
|
5
5
|
name: string;
|
package/dist/tilemap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { It as SceneHostLike, dt as BlitterObject, pt as Container } from "./game-BbgtwqyW.js";
|
|
2
2
|
/** Pack signed 16-bit chunk coordinates `[-32768..32767]` into a single 32-bit integer Map key (zero string allocation). */
|
|
3
3
|
export declare function packChunkKey(cx: number, cy: number): number;
|
|
4
4
|
export declare function unpackChunkX(key: number): number;
|
package/dist/trace.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as SceneDigestSurfaceEntry, F as SceneDigestEngineSandbox, H as SceneDigestSurfaces, I as SceneDigestNode, L as SceneDigestOptions, N as SceneDigest, P as SceneDigestActiveFocus, R as SceneDigestOverlayStats, U as buildSceneDigest, V as SceneDigestSurfaceSource, W as sanitizeTrackToken, z as SceneDigestSandbox } from "./game-
|
|
1
|
+
import { B as SceneDigestSurfaceEntry, F as SceneDigestEngineSandbox, H as SceneDigestSurfaces, I as SceneDigestNode, L as SceneDigestOptions, N as SceneDigest, P as SceneDigestActiveFocus, R as SceneDigestOverlayStats, U as buildSceneDigest, V as SceneDigestSurfaceSource, W as sanitizeTrackToken, z as SceneDigestSandbox } from "./game-BbgtwqyW.js";
|
|
2
2
|
export { SceneDigest, SceneDigestActiveFocus, SceneDigestEngineSandbox, SceneDigestNode, SceneDigestOptions, SceneDigestOverlayStats, SceneDigestSandbox, SceneDigestSurfaceEntry, SceneDigestSurfaceSource, SceneDigestSurfaces, buildSceneDigest, sanitizeTrackToken };
|
package/llms.txt
CHANGED
|
@@ -5,28 +5,29 @@
|
|
|
5
5
|
## Core Documentation
|
|
6
6
|
|
|
7
7
|
- [Official Docs & Live Playground](https://holt.js.org): Interactive KAPLAY-green playground, WebGPU & Kernel guide, 2.5D Survival Sandbox guide, and subpath references.
|
|
8
|
-
- [README](https://github.com/botiverse-play/stage/blob/main/README.md): Overview, install,
|
|
8
|
+
- [README](https://github.com/botiverse-play/stage/blob/main/README.md): Overview, install, 21-subpath table, quick starts for WebGPU, `StageKernel`, 60 FPS video, and 2.5D survival games.
|
|
9
9
|
- [Architecture](https://github.com/botiverse-play/stage/blob/main/docs/architecture.md): WebGPU/WebGL2/Canvas2D batchers, `StageKernel`, DPR/camera contracts, LIFO disposal, `SurfaceTree`, tracing-first observability.
|
|
10
|
-
- [Changelog](https://github.com/botiverse-play/stage/blob/main/CHANGELOG.md): Release history (`0.1.0` – `0.
|
|
10
|
+
- [Changelog](https://github.com/botiverse-play/stage/blob/main/CHANGELOG.md): Release history (`0.1.0` – `0.10.0`).
|
|
11
11
|
- [Contributing](https://github.com/botiverse-play/stage/blob/main/CONTRIBUTING.md): Setup, invariants, verification gate, PR guidelines.
|
|
12
12
|
|
|
13
13
|
## AI Agent Skills & Instructions
|
|
14
14
|
|
|
15
15
|
- [Stage Agent Skill](https://github.com/botiverse-play/stage/blob/main/skills/stage/SKILL.md): Complete recipes, patterns, and pitfalls for building 2D/2.5D games, UI, WebGPU apps, `StageKernel` input timelines, and 60 FPS videos with `@holtjs/stage`.
|
|
16
|
-
- [Subpath API Reference](https://github.com/botiverse-play/stage/blob/main/skills/stage/references/subpaths.md): Exact exported functions, classes, and types across all
|
|
16
|
+
- [Subpath API Reference](https://github.com/botiverse-play/stage/blob/main/skills/stage/references/subpaths.md): Exact exported functions, classes, and types across all 21 subpaths.
|
|
17
17
|
- [Contributor Skill](https://github.com/botiverse-play/stage/blob/main/skills/stage-contributor/SKILL.md): Adding subpaths, maintaining `.d.ts` / size / renderer parity invariants, OIDC releases.
|
|
18
18
|
- [AGENTS.md](https://github.com/botiverse-play/stage/blob/main/AGENTS.md): Repository map and non-negotiable engineering rules.
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 21 Subpaths (`sideEffects: false`, zero runtime dependencies)
|
|
21
21
|
|
|
22
|
-
- `@holtjs/stage` (~
|
|
23
|
-
- `@holtjs/stage/
|
|
24
|
-
- `@holtjs/stage/
|
|
25
|
-
- `@holtjs/stage/
|
|
22
|
+
- `@holtjs/stage` (~71.3 kB gz): Full engine barrel (`Game`, `Scene`, `WEBGPU`, `WEBGL`, `CANVAS`, `SpriteObject` (`playDirectional`, `bindEquipment`), `ImageObject` (6-DOF `syncAttachment`, `getAnchorPose`), `AnimationManager`, `RendererWebGpu`, `RendererGl`, `Renderer2D`, `ShapeBatchObject`, `InstancedBatchObject`, `StageRenderTarget`, `CustomPassObject`, `PanelObject`, `Graphics`, `Container`, `StageKernel`, `InputPlugin`, `EngineClock`, `TweenManager`, `VirtualJoystick`, `SurfaceTree`, `buildSceneDigest`, `computeFlexLayout`, `computeWrapLayout`).
|
|
23
|
+
- `@holtjs/stage/anims` (~2.9 kB gz, no DOM): `AnimationManager` (`createFromAtlas` with `inheritFrom` + `baseChar` cross-actor rule inheritance, bare aliases, `generateFrameNames`, `generateFrameNumbers`).
|
|
24
|
+
- `@holtjs/stage/webgpu` (~15.9 kB gz): Native WebGPU renderer (`RendererWebGpu`, `requestWebGpuDevice`) with WGSL quad/poly batching and WGSL analytical SDF `PanelObject` & `ShapeBatchObject` pipelines.
|
|
25
|
+
- `@holtjs/stage/kernel` (~4.9 kB gz, no DOM): `StageKernel` (`game.kernel`), `StagePlugin` lifecycle, `ActionMap`, `InputProvider` bus, `createInputTimeline` (`trackId` semantic clicks + virtual cursor), `createInputRecorder`, `createInputReplay`.
|
|
26
|
+
- `@holtjs/stage/headless` (~50.4 kB gz, pure Node with `@napi-rs/canvas`): `createHeadlessStage` (`.step()`, `.fastForward()`, `.toRgbaInto()`, `.recordFrames()`), `renderStoryboard`, `createAudioTimeline` stereo WAV mixer.
|
|
26
27
|
- `@holtjs/stage/rig2d` (~5.7 kB gz, no DOM): 2D cutout/slot skeletal rig (`defineRig2DSkeleton`, `Rig2DInstance`, `mountRig2D`, `bakeCutoutAtlas`), O(1) equipment/skin swapping, 2-layer base + bone-masked overlay mixer.
|
|
27
|
-
- `@holtjs/stage/tilemap` (~
|
|
28
|
-
- `@holtjs/stage/projection` (~
|
|
29
|
-
- `@holtjs/stage/lighting` (~
|
|
28
|
+
- `@holtjs/stage/tilemap` (~4.0 kB gz, no DOM): Sparse `ChunkedTilemap`, Oskar Stålberg 16-tile Dual-Grid autotiler (`computeDualGridMask`, `bakeDualGridTileset`), 47-tile Blob autotiler (`computeBlob47Index`), `createIslandBiomeGenerator`, chunk-cached `mountChunkedTilemap`.
|
|
29
|
+
- `@holtjs/stage/projection` (~2.8 kB gz, no DOM): Rotatable oblique `Camera25D` (`worldToScreen` ↔ `screenToGround`, smooth `Q/E` yaw spin) and `mountStage25D` (tilted ground plane + oblique sun `shadowLayer` + upright cylindrical depth-sorted billboards).
|
|
30
|
+
- `@holtjs/stage/lighting` (~9.2 kB gz, no DOM): `DayNightCycle`, Sobel 3×3 `computeNormalMapPixels` / `bakeNormalMapCanvas`, `Lighting2DSystem` (zero-band radial `MULTIPLY` lightmap + `bindEmissive` self-lit glow), batched `createSceneNormalLitPass`.
|
|
30
31
|
- `@holtjs/stage/world` (~2.8 kB gz, no DOM): `ItemRegistry`, `InventoryContainer` (with spoilage), `RecipeRegistry`, `WorkstationInstance` / `WorkstationScheduler` (offline tick catch-up), `WorldDeltaSave` (`HWLD` binary codec).
|
|
31
32
|
- `@holtjs/stage/flex` (~2.3 kB gz, no DOM): `computeFlexLayout`, `computeWrapLayout`, `resolvePadding`.
|
|
32
33
|
- `@holtjs/stage/tween` (~1.4 kB gz, no DOM): `TweenManager`, `Easings` (tweens + damped springs).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holtjs/stage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Zero-dependency TypeScript stage engine for 2D WebGPU/WebGL2/Canvas2D games, GPU SDF UI, procedural audio, StageKernel plugins, tracing-native observability, and deterministic 60 FPS headless image & video rendering.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Botiverse, Inc.",
|
package/skills/stage/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Build zero-dependency WebGPU/WebGL2/Canvas2D 2D & 2.5D games, GPU S
|
|
|
5
5
|
|
|
6
6
|
# Building 2D/2.5D Games, WebGPU UI & 60 FPS Video with `@holtjs/stage`
|
|
7
7
|
|
|
8
|
-
Use this skill whenever creating or modifying a browser 2D/2.5D game, WebGPU/WebGL2 canvas UI, survival sandbox, automated `InputTimeline` test, or pure-Node headless image/storyboard/60 FPS video pipeline built on `@holtjs/stage` (`v0.
|
|
8
|
+
Use this skill whenever creating or modifying a browser 2D/2.5D game, WebGPU/WebGL2 canvas UI, survival sandbox, automated `InputTimeline` test, or pure-Node headless image/storyboard/60 FPS video pipeline built on `@holtjs/stage` (`v0.10.0`, 21 subpaths).
|
|
9
9
|
|
|
10
10
|
For the exhaustive exported symbol list across all 21 subpaths, see [references/subpaths.md](references/subpaths.md).
|
|
11
11
|
|
|
@@ -143,9 +143,9 @@ const dgAtlas = bakeDualGridTileset('island_dg', 36, [
|
|
|
143
143
|
{ id: 'meadow', fillColor: 0x5c8d3e, edgeColor: 0x3f6212, matches: (t) => t >= SurvivalBiomes.MEADOW },
|
|
144
144
|
]);
|
|
145
145
|
|
|
146
|
-
// 2. Rotatable 2.5D Oblique Camera + Upright Cylindrical Billboards
|
|
146
|
+
// 2. Rotatable 2.5D Oblique Camera + Upright Cylindrical Billboards + True Oblique Sun Silhouette Shadows (`shadows: true`)
|
|
147
147
|
const cam25 = new Camera25D({ viewportWidth: 1280, viewportHeight: 720, pitch: 0.84, zoom: 1.4 });
|
|
148
|
-
const stage25 = mountStage25D(scene, cam25, { depth: 10 });
|
|
148
|
+
const stage25 = mountStage25D(scene, cam25, { depth: 10, shadows: true });
|
|
149
149
|
const mountedTerrain = mountChunkedTilemap(scene, tilemap, dgAtlas);
|
|
150
150
|
mountedTerrain.container.removeFromDisplayList();
|
|
151
151
|
stage25.groundWorld.add(mountedTerrain.container);
|
|
@@ -154,18 +154,21 @@ stage25.groundWorld.add(mountedTerrain.container);
|
|
|
154
154
|
// Automatically aligns trimmed per-frame `ax/ay` pivots, transforms `hand` sockets, preserves walk phase across turns, & fires `footstep` events!
|
|
155
155
|
scene.textures.addAtlas('actors', bakedCanvas, bakedAtlasJson);
|
|
156
156
|
scene.anims.createFromAtlas('actors', {
|
|
157
|
+
inheritFrom: { 'held/*': 'survivor' }, // optional cross-actor rule inheritance (`bakeEquipment` also inherits via `baseChar`!)
|
|
157
158
|
clips: {
|
|
158
|
-
walk: { frameRate: 10, events: { 1: 'footstep', 4: 'footstep' } },
|
|
159
|
-
attack: { frameRate: 14, repeat: 0, events: { 2: 'hit' } },
|
|
159
|
+
'survivor/walk': { frameRate: 10, events: { 1: 'footstep', 4: 'footstep' } },
|
|
160
|
+
'survivor/attack': { frameRate: 14, repeat: 0, events: { 2: 'hit' } },
|
|
160
161
|
},
|
|
161
162
|
});
|
|
162
163
|
const survivor = scene.make.sprite(0, 0, 'actors', 'chars/survivor/idle/d0/f0');
|
|
163
164
|
survivor.trackId = 'actor.survivor';
|
|
164
165
|
survivor.onAnimEvent((ev) => { if (ev === 'footstep') playStepSfx(); });
|
|
165
166
|
stage25.registerBillboard(survivor, 0, 0);
|
|
166
|
-
// Inside update(): survivor.playDirectional('survivor/walk', Math.atan2(vy, vx), { cameraYaw: cam25.yaw });
|
|
167
|
-
//
|
|
168
|
-
// survivor.
|
|
167
|
+
// Inside update(): survivor.playDirectional('survivor/walk', Math.atan2(vy, vx), { cameraYaw: cam25.yaw, startFrame });
|
|
168
|
+
// Option 1 (exact per-pixel hand/body occlusion via `@holtjs/craft/three` `bakeEquipment`):
|
|
169
|
+
// const equipSlot = survivor.bindEquipment(equipImage, 'equip/axe'); // O(1) swap via equipSlot.setPrefix('equip/spear'), auto-hides 1x1/2x2 empty frames!
|
|
170
|
+
// Option 2 (single-PNG procedural weapon via 8-tuple `handBasisSocket`):
|
|
171
|
+
// survivor.syncAttachment(axeSprite, 'hand', { restAngle: -Math.PI / 2, clipAngles: { walk: 0.66, thrust: 0 } });
|
|
169
172
|
|
|
170
173
|
// 3B. Or 2D Cutout Skeletal Rig: O(1) equipment swap + 2-layer bone-masked overlay animation
|
|
171
174
|
const rig = new Rig2DInstance(heroSkeleton);
|
|
@@ -175,17 +178,20 @@ rig.playOverlay('chop', { maskBones: ['arm_r', 'hand_r', 'torso'] }); // chops w
|
|
|
175
178
|
const heroView = mountRig2D(scene, rig, { depth: 20, trackId: 'actor.survivor' });
|
|
176
179
|
stage25.registerBillboard(heroView.container, 0, 0);
|
|
177
180
|
|
|
178
|
-
// 4. Day/Night Cycle +
|
|
181
|
+
// 4. Day/Night Cycle + Zero-Band Radial Lightmap + Self-Lit Emissive Glow + Scene Normal-Map Rim Pass
|
|
179
182
|
const dayNight = new DayNightCycle({ dayLengthMs: 60_000, initialTime01: 0.72 }); // dusk -> night
|
|
180
183
|
const lighting = new Lighting2DSystem(scene, { width: 1280, height: 720, depth: 500 });
|
|
181
|
-
|
|
184
|
+
// Auto-drive flickering point light from `Frame.emissiveCenter` AND render `actors_emissive` above night darkness:
|
|
185
|
+
lighting.bindEmissive(campfireSprite, { radius: 220, color: 0xffa94d, intensity: 1.2, flicker: 0.14 });
|
|
186
|
+
createSceneNormalLitPass(scene, { source: stage25.billboardLayer, lighting, mode: 'rim' });
|
|
182
187
|
|
|
183
188
|
// Inside Scene.update(_t, deltaMs):
|
|
184
189
|
if (scene.game.kernel.actions.justPressed('rotateCW')) cam25.rotateSteps(1);
|
|
185
190
|
stage25.update(deltaMs);
|
|
186
191
|
mountedTerrain.update(cam25.getGroundViewportBounds());
|
|
187
192
|
heroView.update(deltaMs);
|
|
188
|
-
lighting.update(deltaMs, (wx, wy, wz, out) => { const p = cam25.worldToScreen(wx, wy, wz); out.x = p.x; out.y = p.y; out.scale = p.scale; });
|
|
193
|
+
const dnState = lighting.update(deltaMs, (wx, wy, wz, out) => { const p = cam25.worldToScreen(wx, wy, wz); out.x = p.x; out.y = p.y; out.scale = p.scale; });
|
|
194
|
+
stage25.syncDayNight(dnState); // updates oblique sun shadow angle & auto-fades sun shadows out at night!
|
|
189
195
|
|
|
190
196
|
// 5. Compact Binary World Delta Save (only modified tiles + inventories + workstations)
|
|
191
197
|
const deltaBytes = encodeWorldDeltaBytes(captureWorldDelta({ seed: 1337, simTimeMs: 42_000, tilemap }));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# `@holtjs/stage` Subpath API Quick Reference
|
|
2
2
|
|
|
3
|
-
All symbols verified against `src/*.ts` (`@holtjs/stage@0.
|
|
3
|
+
All symbols verified against `src/*.ts` (`@holtjs/stage@0.10.0`, 21 subpaths).
|
|
4
4
|
|
|
5
|
-
## `@holtjs/stage` (~
|
|
5
|
+
## `@holtjs/stage` (~71.3 kB gz · Core Engine Barrel)
|
|
6
6
|
- **Bootstrap & Lifecycle**: `Stage` / `Stage2D` (namespaces), `AUTO`, `WEBGPU`, `WEBGL`, `CANVAS`, `Scale` (`NONE`, `FIT`, `RESIZE`), `Scenes`, `Game` (`.stepSimOnly()`, `.kernel`, `.anims`), `Scene` (`.update()` simulation + `.preRender()` presentation, `.anims`), `SceneManager`, `ScaleManager` (`.fitToContainer()`), `GameLoop`, `EngineClock`, `LoaderPlugin` (`.atlas()`), `JsonCache`, `GameObjectFactory` (`scene.add.sprite`, `shapeBatch`, `instancedBatch`, `customPass`, `panel`, `blitter`, etc.), `AnimationManager` (`.create()`, `.createFromAtlas()`, `.generateFrameNames()`, `.generateFrameNumbers()`)
|
|
7
|
-
- **Display Graph**: `DisplayList`, `DisplayObject` (reactive `.zIndex`), `Container`, `ImageObject` (`.useFramePivot()`, `.getAnchor(name, space?)`, `.getAnchorPose(name, space?)`, `.syncAttachment(child, name, opts?)`), `SpriteObject` (`.play()`, `.playDirectional()`, `.onAnimEvent()`, `.pause()`, `.resume()`, `.stop()`), `NineSliceObject`, `TileSpriteObject`, `RectangleObject`, `PanelObject`, `MsdfIconObject`, `TextObject`, `Graphics` (GPU SDF fast-path + Canvas2D `Path2D` cache), `BlitterObject`, `InstancedBatchObject`, `ShapeBatchObject` (zero-texture SoA analytical SDF shapes), `CustomPassObject` (`restoreState: true` default)
|
|
8
|
-
- **Renderers & GPU Batchers**: `RendererWebGpu`, `requestWebGpuDevice`, `RendererGl` (`.createRenderTarget()`, `.renderToTarget(rt, content, cam?)`, `.restoreState()`), `StageRenderTarget` (`.camera`, `.readPixels()`), `Renderer2D` (4-corner frustum culling + sprite tint LRU cache), `SdfPanelBatcher`, `MsdfIconBatcher`, `PixelAaBatcher`, `Camera` (`.configureHiDpi()`, `.setBounds()`, `.clearBounds()`, `.startFollow()`, `.stopFollow()`, `.screenToWorld()`, `.worldToScreen()`, `.logicalToWorld()`, `.worldToLogical()`, `.clientToWorld()`), `Texture` (`.atlasYaw`), `CanvasTexture`, `TextureSource`, `Frame` (`.setPivot()`, `.setPixelPivot()`, `.setAnchor()`, `.getAnchor()`), `TextureManager` (`.exists()`, `.addAtlas()`, `.addCanvas()`, `.get()`)
|
|
7
|
+
- **Display Graph**: `DisplayList`, `DisplayObject` (reactive `.zIndex`, 6-DOF `.skewX`/`.skewY`/`.setSkew()`), `Container`, `ImageObject` (`.useFramePivot()`, `.getAnchor(name, space?)`, `.getAnchorPose(name, space?)`, 6-DOF `.syncAttachment(child, name, opts?)` with 8-tuple `ux/uy/vx/vy` foreshortening, isometric shear & `clipAngles`), `SpriteObject` (`.play()`, `.playDirectional(key, heading, { cameraYaw?, startFrame? })`, `.bindEquipment(target, prefix, opts?)`, `.onAnimEvent()`, `.pause()`, `.resume()`, `.stop()`), `NineSliceObject`, `TileSpriteObject`, `RectangleObject`, `PanelObject`, `MsdfIconObject`, `TextObject`, `Graphics` (GPU SDF fast-path + Canvas2D `Path2D` cache), `BlitterObject`, `InstancedBatchObject`, `ShapeBatchObject` (zero-texture SoA analytical SDF shapes), `CustomPassObject` (`restoreState: true` default, VAO-isolated)
|
|
8
|
+
- **Renderers & GPU Batchers**: `RendererWebGpu`, `requestWebGpuDevice`, `RendererGl` (`.createRenderTarget()`, `.renderToTarget(rt, content, cam?)`, `.restoreState()`), `StageRenderTarget` (`.camera`, `.readPixels()`), `Renderer2D` (4-corner frustum culling + sprite tint LRU cache), `SdfPanelBatcher`, `MsdfIconBatcher`, `PixelAaBatcher`, `Camera` (`.configureHiDpi()`, `.setBounds()`, `.clearBounds()`, `.startFollow()`, `.stopFollow()`, `.screenToWorld()`, `.worldToScreen()`, `.logicalToWorld()`, `.worldToLogical()`, `.clientToWorld()`), `Texture` (`.atlasYaw`), `CanvasTexture`, `TextureSource`, `Frame` (`.empty`, `.baseActor`, `.setPivot()`, `.setPixelPivot()`, `.setAnchor()`, `.getAnchor()`), `TextureManager` (`.exists()`, `.addAtlas()`, `.addCanvas()`, `.get()`)
|
|
9
9
|
- **Kernel & Input**: `StageKernel`, `ActionMap`, `createInputTimeline`, `createInputRecorder`, `createInputReplay`, `EventEmitter`, `Pointer`, `KeyboardPlugin` (`.isDown()`, `.justPressed()`, `.justReleased()`, `.injectKey()`), `InputPlugin`
|
|
10
10
|
- **Math & Color**: `BlendModes` (`NORMAL`, `ADD`, `MULTIPLY`, `SCREEN`), `TintModes`, `FilterMode`, `WHITE_RGB`, `BLACK_RGB`, `HEX_MASK`, `createMatrix2D`, `parseColor`, `rgbToCss`, `packColorAbgr`
|
|
11
11
|
- **Bundled UI/Observability Re-exports**: `computeFlexLayout`, `computeWrapLayout`, `resolvePadding`, `Easings`, `TweenManager`, `VirtualJoystick`, `clampJoystickOrigin`, `computeJoystickVector`, `isInJoystickZone`, `pullJoystickOrigin`, `quantizeJoystickDpad`, `SURFACE_BAND`, `createSurfaceTree`, `resolveSurfacePriority`, `surfacePriorityToDomZ`, `computeSurfaceDomZ`, `buildSceneDigest`, `sanitizeTrackToken`
|
|
12
12
|
|
|
13
|
-
## `@holtjs/stage/anims` (~2.
|
|
14
|
-
- `AnimationManager`: `.create(cfg)`, `.createFromAtlas(textureKey,
|
|
13
|
+
## `@holtjs/stage/anims` (~2.9 kB gz · zero DOM)
|
|
14
|
+
- `AnimationManager`: `.create(cfg)`, `.createFromAtlas(textureKey, { defaultFrameRate?, defaultRepeat?, clips?, inheritFrom? })`, `.generateFrameNames(key, cfg?)`, `.generateFrameNumbers(key, cfg?)`, `.exists(key)`, `.get(key)`, `.getDirectionalGroup(baseKey)`, `.listKeys()`, `.listDirectionalGroups()`
|
|
15
15
|
- Types: `AnimationFrameInput`, `CompiledAnimationFrame`, `AnimationConfig`, `StageAnimation`, `GenerateFrameNamesConfig`, `GenerateFrameNumbersConfig`, `AtlasClipRule`, `AtlasAutoAnimOptions`, `DirectionalAnimGroup`
|
|
16
16
|
|
|
17
17
|
## `@holtjs/stage/webgpu` (~15.4 kB gz · Native WebGPU Renderer)
|
|
@@ -43,16 +43,16 @@ All symbols verified against `src/*.ts` (`@holtjs/stage@0.8.0`, 21 subpaths).
|
|
|
43
43
|
- Scene Streaming Adapter: `mountChunkedTilemap(scene, tilemap, atlas, opts?)` -> `MountedChunkedTilemap` (`.container`, `.update(viewBounds)`, `.destroy()`)
|
|
44
44
|
- Types: `TileChunk`, `ChunkGeneratorFn`, `ChunkedTilemapOptions`, `IslandBiomeConfig`, `DualGridLayerSpec`, `BakedDualGridAtlas`, `MountedChunkedTilemap`
|
|
45
45
|
|
|
46
|
-
## `@holtjs/stage/projection` (~
|
|
46
|
+
## `@holtjs/stage/projection` (~2.8 kB gz · zero DOM)
|
|
47
47
|
- `Camera25D`: `.worldToScreen(wx, wy, wz?, out?)`, `.screenToGround(sx, sy, planeZ?, out?)` (exact inverse across any 360° `yaw`), `.rotateSteps(steps, stepAngleRad?)`, `.setYawImmediate(yawRad)`, `.step(deltaMs)`, `.getGroundViewportBounds()`, `.computeSunShadowVector(...)`
|
|
48
|
-
- `mountStage25D(scene, cam, opts?)` -> `Stage25DRig` (`.groundWorld`, `.shadowLayer`, `.billboardLayer`, `.registerBillboard(node, wx, wy, opts?)`, `.removeBillboard(entryOrNode)`, `.update(deltaMs?)`, `.destroy()`)
|
|
49
|
-
- Types: `Camera25DConfig`, `ProjectedPoint25D`, `BillboardEntry`, `Stage25DRig`
|
|
48
|
+
- `mountStage25D(scene, cam, opts?)` -> `Stage25DRig` (`.groundWorld`, `.shadowLayer`, `.billboardLayer`, `.registerBillboard(node, wx, wy, opts?)`, `.removeBillboard(entryOrNode)`, `.setSunShadow(cfg)`, `.syncDayNight(state)`, `.update(deltaMs?)`, `.destroy()`)
|
|
49
|
+
- Types: `Camera25DConfig`, `ProjectedPoint25D`, `Shadow25DConfig`, `BillboardOptions25D`, `BillboardEntry`, `MountStage25DOptions`, `Stage25DRig`
|
|
50
50
|
|
|
51
|
-
## `@holtjs/stage/lighting` (~
|
|
52
|
-
- `DayNightCycle`: `.step(deltaMs)`, `.setTime01(t)`, `.sample(out?)` -> `DayNightState` (`phase`, `ambientRgb`, `
|
|
51
|
+
## `@holtjs/stage/lighting` (~9.2 kB gz · zero DOM)
|
|
52
|
+
- `DayNightCycle`: `.step(deltaMs)`, `.setTime01(t)`, `.sample(out?)` -> `DayNightState` (`phase`, `ambientRgb`, `darkness`, `sunAzimuthRad`, `sunElevationRad`), `lerpRgb`
|
|
53
53
|
- Normal Maps & Per-Pixel Evaluation: `computeNormalMapPixels(rgba, w, h, opts?)` (3×3 Sobel height-to-normal), `bakeNormalMapCanvas(srcCanvas, createCanvas?, opts?)`, `evaluateNormalLitPixel(...)`
|
|
54
|
-
- Scene Lightmap &
|
|
55
|
-
- Types: `DayPhase`, `DayNightConfig`, `DayNightState`, `NormalMapBakeOptions`, `PointLight2D`, `Lighting2DSystemOptions`, `NormalLitQuad`
|
|
54
|
+
- Scene Lightmap, Self-Lit Emissive & Batched Normal Passes: `Lighting2DSystem` (`.emissiveLayer`, `.screenLights`, `.currentAmbientRgb`, `.addLight(light)`, `.getLight(id)`, `.removeLight(id)`, `.bindEmissive(sprite, opts?)`, `.setAmbientOverride(rgb)`, `.update(deltaMs, projectToScreen?)`, `.destroy()`), `createNormalLitSpritePass(scene, diffKey, normKey, getQuadsAndLights)`, `createSceneNormalLitPass(scene, opts)`
|
|
55
|
+
- Types: `DayPhase`, `DayNightConfig`, `DayNightState`, `NormalMapBakeOptions`, `PointLight2D`, `ScreenLightSample2D`, `EmissiveBindOptions`, `EmissiveBinding`, `Lighting2DSystemOptions`, `NormalLitQuad`, `SceneNormalLitPassOptions`
|
|
56
56
|
|
|
57
57
|
## `@holtjs/stage/world` (~2.8 kB gz · zero DOM)
|
|
58
58
|
- Items, Spoilage & Crafting: `ItemRegistry`, `InventoryContainer` (`.addItem()`, `.removeItem()`, `.countItem()`, `.hasItems()`, `.stepSpoilage(deltaMs)`), `RecipeRegistry` (`.canCraft()`, `.craftInstant()`), `WorkstationInstance` (`.enqueue()`, `.step()`), `WorkstationScheduler` (`.stepAll(deltaMs)` offline catch-up)
|