@holtjs/stage 0.10.0 → 0.10.1

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 CHANGED
@@ -6,6 +6,16 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.10.1] - 2026-12-04
10
+
11
+ ### Added & Fixed
12
+ - **Multi-Atlas Collision Diagnostics & Namespace `prefix` (`AnimationManager.createFromAtlas` / `create`, `src/anims.ts`)**:
13
+ - `AnimationManager.createFromAtlas()` and `AnimationManager.create()` now emit a concise `console.warn` when overwriting an existing animation clip key from an earlier atlas (and refresh bare actor/group aliases in lockstep so `survivor/walk` never split-brains across textures).
14
+ - Added `{ prefix?: string, overwrite?: boolean }` to `AtlasAutoAnimOptions` (e.g. `createFromAtlas('npc_sheet', { prefix: 'npc' })`) and `{ overwrite?: boolean }` to `AnimationConfig`.
15
+ - **Occluded `bindEquipment` Transform Parity & `<=64x64` Empty-Placeholder Detection (`src/display.ts`, `src/texture.ts`)**:
16
+ - `SpriteObject.bindEquipment()` now synchronizes `x`, `y`, `flipX`, `flipY`, `scale`, `rotation`, `skew`, `alpha`, and `zIndex` even when the bound layer is hidden on an occluded/missing frame (`visible = false`), ensuring callers reading `toolImage.x/y` always see exact coordinates.
17
+ - Extended `TextureManager.addAtlas()` lazy transparent-placeholder probing from `<=4x4` up to `<=64x64` (`5x5`, `8x8`, `16x16`, `32x32`, `64x64` all-alpha-zero cells automatically set `Frame.empty = true`, memoized per rect).
18
+
9
19
  ## [0.10.0] - 2026-12-04
10
20
 
11
21
  ### Added
@@ -317,6 +317,8 @@ interface AnimationConfig {
317
317
  readonly yoyo?: boolean;
318
318
  /** Declarative map from 0-based frame index to event name(s), e.g. `{ 1: 'footstep', 4: 'footstep' }`. */
319
319
  readonly events?: Readonly<Record<number, string | readonly string[]>>;
320
+ /** Silence duplicate-key overwrite warning when intentionally replacing an existing animation (`default = false`). */
321
+ readonly overwrite?: boolean;
320
322
  }
321
323
  interface StageAnimation {
322
324
  readonly key: string;
@@ -362,6 +364,10 @@ interface AtlasAutoAnimOptions {
362
364
  * Frames baked via `@holtjs/craft/three` `bakeEquipment` also inherit automatically via frame `baseChar` metadata!
363
365
  */
364
366
  readonly inheritFrom?: Readonly<Record<string, string>>;
367
+ /** Optional namespace prefix prepended to generated clip & directional group keys (e.g. `'npc'` -> `'npc/chars/survivor/walk/d0'`) when loading multiple atlases with overlapping actor/clip names. */
368
+ readonly prefix?: string;
369
+ /** Silence duplicate-key overwrite warning when intentionally replacing animations from an earlier `createFromAtlas` call (`default = false`). */
370
+ readonly overwrite?: boolean;
365
371
  }
366
372
  interface DirectionalAnimGroup {
367
373
  readonly baseKey: string;
@@ -390,6 +396,7 @@ declare class AnimationManager {
390
396
  listKeys(): string[];
391
397
  listDirectionalGroups(): string[];
392
398
  create(config: AnimationConfig): StageAnimation;
399
+ private _createInternal;
393
400
  /** Register an alias key pointing to an existing `StageAnimation` (does not overwrite explicit primary keys). */
394
401
  registerAlias(aliasKey: string, target: StageAnimation): void;
395
402
  /** Register a directional animation group (and optional alias keys such as bare `'survivor/walk'` & `'survivor_walk'`). */
package/dist/anims.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as AtlasClipRule, c as GenerateFrameNamesConfig, i as AtlasAutoAnimOptions, l as GenerateFrameNumbersConfig, n as AnimationFrameInput, o as CompiledAnimationFrame, r as AnimationManager, s as DirectionalAnimGroup, t as AnimationConfig, u as StageAnimation } from "./anims-xOSYNG79.js";
1
+ import { a as AtlasClipRule, c as GenerateFrameNamesConfig, i as AtlasAutoAnimOptions, l as GenerateFrameNumbersConfig, n as AnimationFrameInput, o as CompiledAnimationFrame, r as AnimationManager, s as DirectionalAnimGroup, t as AnimationConfig, u as StageAnimation } from "./anims-D9N8w6IM.js";
2
2
  export { AnimationConfig, AnimationFrameInput, AnimationManager, AtlasAutoAnimOptions, AtlasClipRule, CompiledAnimationFrame, DirectionalAnimGroup, GenerateFrameNamesConfig, GenerateFrameNumbersConfig, StageAnimation };
package/dist/anims.js CHANGED
@@ -203,7 +203,15 @@ var AnimationManager = class {
203
203
  return out;
204
204
  }
205
205
  create(config) {
206
+ return this._createInternal(config, false);
207
+ }
208
+ _createInternal(config, suppressCollisionWarn) {
206
209
  if (!config.frames || config.frames.length === 0) throw new Error(`Stage anims.create("${config.key}"): frames array must not be empty`);
210
+ if (!suppressCollisionWarn && !config.overwrite && this.anims.has(config.key)) {
211
+ const prevTex = this.anims.get(config.key).frames[0]?.textureKey ?? "unknown";
212
+ const nextTex = config.frames[0]?.key ?? config.defaultTextureKey ?? "unknown";
213
+ console.warn(`Stage anims.create("${config.key}"): overwriting existing clip from texture "${prevTex}" with "${nextTex}" (pass { overwrite: true } to silence)`);
214
+ }
207
215
  const count = config.frames.length;
208
216
  const frameRate = config.frameRate !== void 0 && config.frameRate > 0 ? config.frameRate : config.duration !== void 0 && config.duration > 0 ? count * 1e3 / config.duration : 10;
209
217
  const baseMsPerFrame = 1e3 / frameRate;
@@ -243,8 +251,12 @@ var AnimationManager = class {
243
251
  }
244
252
  /** Register a directional animation group (and optional alias keys such as bare `'survivor/walk'` & `'survivor_walk'`). */
245
253
  registerDirectionalGroup(group, aliases = []) {
254
+ const prevGroup = this.dirGroups.get(group.baseKey);
246
255
  this.dirGroups.set(group.baseKey, group);
247
- for (const a of aliases) if (!this.dirGroups.has(a)) this.dirGroups.set(a, group);
256
+ for (const a of aliases) {
257
+ const existing = this.dirGroups.get(a);
258
+ if (!existing || existing === prevGroup) this.dirGroups.set(a, group);
259
+ }
248
260
  }
249
261
  remove(key) {
250
262
  this.aliases.delete(key);
@@ -372,6 +384,22 @@ var AnimationManager = class {
372
384
  }
373
385
  const created = [];
374
386
  const atlasYaw = tex.atlasYaw ?? 0;
387
+ const nsPrefix = options.prefix ? options.prefix.replace(/\/+$/, "") : "";
388
+ const withNs = (k) => nsPrefix ? `${nsPrefix}/${k}` : k;
389
+ const overwrittenKeys = [];
390
+ let overwrittenFromTex = null;
391
+ const createClip = (cfg) => {
392
+ const existing = this.anims.get(cfg.key);
393
+ if (existing && !options.overwrite) {
394
+ overwrittenKeys.push(cfg.key);
395
+ if (!overwrittenFromTex) overwrittenFromTex = existing.frames[0]?.textureKey ?? "unknown";
396
+ }
397
+ const anim = this._createInternal(cfg, true);
398
+ if (existing) {
399
+ for (const [ak, target] of this.aliases.entries()) if (target === existing) this.aliases.set(ak, anim);
400
+ }
401
+ return anim;
402
+ };
375
403
  for (const b of buckets.values()) {
376
404
  const rule = resolveRule(b.actor, b.clip, b.baseActor);
377
405
  const repeat = rule?.repeat !== void 0 ? rule.repeat : options.defaultRepeat !== void 0 ? options.defaultRepeat : b.loopHint !== void 0 ? b.loopHint ? -1 : 0 : LOOP_CLIP_RE.test(b.clip) ? -1 : 0;
@@ -380,9 +408,8 @@ var AnimationManager = class {
380
408
  const canBareAlias = Boolean(bare && bare !== b.actor && (actorsByBase.get(bare)?.size ?? 0) === 1);
381
409
  if (b.byDir.size === 1 && b.byDir.has(null)) {
382
410
  const seq = b.byDir.get(null).sort((a, c) => a.frameIdx - c.frameIdx);
383
- const primaryKey = b.actor ? `${b.actor}/${b.clip}` : b.clip;
384
- const anim = this.create({
385
- key: primaryKey,
411
+ const anim = createClip({
412
+ key: withNs(b.actor ? `${b.actor}/${b.clip}` : b.clip),
386
413
  defaultTextureKey: textureKey,
387
414
  frames: seq.map((s) => ({
388
415
  key: textureKey,
@@ -392,13 +419,14 @@ var AnimationManager = class {
392
419
  duration: rule?.duration,
393
420
  repeat,
394
421
  yoyo: rule?.yoyo,
395
- events: rule?.events
422
+ events: rule?.events,
423
+ overwrite: options.overwrite
396
424
  });
397
425
  created.push(anim);
398
- if (b.actor) this.registerAlias(`${b.actor}_${b.clip}`, anim);
426
+ if (b.actor) this.registerAlias(withNs(`${b.actor}_${b.clip}`), anim);
399
427
  if (canBareAlias) {
400
- this.registerAlias(`${bare}/${b.clip}`, anim);
401
- this.registerAlias(`${bare}_${b.clip}`, anim);
428
+ this.registerAlias(withNs(`${bare}/${b.clip}`), anim);
429
+ this.registerAlias(withNs(`${bare}_${b.clip}`), anim);
402
430
  }
403
431
  continue;
404
432
  }
@@ -422,11 +450,10 @@ var AnimationManager = class {
422
450
  indexedDirs.sort((a, c) => a.dirIdx - c.dirIdx);
423
451
  const dirClips = [];
424
452
  for (const item of indexedDirs) {
425
- const prefixSlash = b.actor ? `${b.actor}/${b.clip}` : b.clip;
426
- const prefixUnder = b.actor ? `${b.actor}_${b.clip}` : b.clip;
427
- const primaryKey = `${prefixSlash}/d${item.dirIdx}`;
428
- const anim = this.create({
429
- key: primaryKey,
453
+ const prefixSlash = withNs(b.actor ? `${b.actor}/${b.clip}` : b.clip);
454
+ const prefixUnder = withNs(b.actor ? `${b.actor}_${b.clip}` : b.clip);
455
+ const anim = createClip({
456
+ key: `${prefixSlash}/d${item.dirIdx}`,
430
457
  defaultTextureKey: textureKey,
431
458
  frames: item.frames.map((s) => ({
432
459
  key: textureKey,
@@ -436,7 +463,8 @@ var AnimationManager = class {
436
463
  duration: rule?.duration,
437
464
  repeat,
438
465
  yoyo: rule?.yoyo,
439
- events: rule?.events
466
+ events: rule?.events,
467
+ overwrite: options.overwrite
440
468
  });
441
469
  created.push(anim);
442
470
  dirClips.push(anim);
@@ -447,21 +475,21 @@ var AnimationManager = class {
447
475
  this.registerAlias(`${prefixUnder}_${item.label}`, anim);
448
476
  }
449
477
  if (canBareAlias) {
450
- this.registerAlias(`${bare}/${b.clip}/d${item.dirIdx}`, anim);
451
- this.registerAlias(`${bare}/${b.clip}/${item.dirIdx}`, anim);
452
- this.registerAlias(`${bare}_${b.clip}_${item.dirIdx}`, anim);
478
+ this.registerAlias(withNs(`${bare}/${b.clip}/d${item.dirIdx}`), anim);
479
+ this.registerAlias(withNs(`${bare}/${b.clip}/${item.dirIdx}`), anim);
480
+ this.registerAlias(withNs(`${bare}_${b.clip}_${item.dirIdx}`), anim);
453
481
  }
454
482
  }
455
483
  if (dirClips.length > 0) {
456
- const baseSlash = b.actor ? `${b.actor}/${b.clip}` : b.clip;
457
- const baseUnder = b.actor ? `${b.actor}_${b.clip}` : b.clip;
484
+ const baseSlash = withNs(b.actor ? `${b.actor}/${b.clip}` : b.clip);
485
+ const baseUnder = withNs(b.actor ? `${b.actor}_${b.clip}` : b.clip);
458
486
  const aliases = [baseUnder];
459
- if (canBareAlias) aliases.push(`${bare}/${b.clip}`, `${bare}_${b.clip}`);
487
+ if (canBareAlias) aliases.push(withNs(`${bare}/${b.clip}`), withNs(`${bare}_${b.clip}`));
460
488
  this.registerAlias(baseSlash, dirClips[0]);
461
489
  this.registerAlias(baseUnder, dirClips[0]);
462
490
  if (canBareAlias) {
463
- this.registerAlias(`${bare}/${b.clip}`, dirClips[0]);
464
- this.registerAlias(`${bare}_${b.clip}`, dirClips[0]);
491
+ this.registerAlias(withNs(`${bare}/${b.clip}`), dirClips[0]);
492
+ this.registerAlias(withNs(`${bare}_${b.clip}`), dirClips[0]);
465
493
  }
466
494
  this.registerDirectionalGroup({
467
495
  baseKey: baseSlash,
@@ -474,6 +502,10 @@ var AnimationManager = class {
474
502
  }, aliases);
475
503
  }
476
504
  }
505
+ if (overwrittenKeys.length > 0 && !options.overwrite) {
506
+ const sample = overwrittenKeys.slice(0, 3).join(", ");
507
+ console.warn(`Stage anims.createFromAtlas("${textureKey}"): overwrote ${overwrittenKeys.length} existing animation key(s) from "${overwrittenFromTex ?? "unknown"}" (${sample}${overwrittenKeys.length > 3 ? ", ..." : ""}); pass { prefix } to namespace or { overwrite: true } to silence.`);
508
+ }
477
509
  return created;
478
510
  }
479
511
  };
@@ -1,4 +1,4 @@
1
- import { I as ScaleMode, M as Matrix2D, N as Rect2D, O as EventEmitter, P as RgbaColor, R as TintMode, S as TextureSource, T as BlendMode, U as WorldView2D, _ as SpriteSheetConfig, d as AtlasJsonLike, g as GlTextureHost, p as Frame, r as AnimationManager, u as StageAnimation, v as Texture, x as TextureManager, y as TextureImageOptions } from "./anims-xOSYNG79.js";
1
+ import { I as ScaleMode, M as Matrix2D, N as Rect2D, O as EventEmitter, P as RgbaColor, R as TintMode, S as TextureSource, T as BlendMode, U as WorldView2D, _ as SpriteSheetConfig, d as AtlasJsonLike, g as GlTextureHost, p as Frame, r as AnimationManager, u as StageAnimation, v as Texture, x as TextureManager, y as TextureImageOptions } from "./anims-D9N8w6IM.js";
2
2
  import { c as TweenManager, u as TweenStats } from "./tween-BiF1FUvc.js";
3
3
  interface CameraFollowOptions {
4
4
  /** Horizontal smoothing factor in `(0, 1]` (`1` = instant lock; default `1`). */
@@ -1,7 +1,7 @@
1
1
  import { _ as rgbToCss, a as EventEmitter, c as Scale, h as packColorAbgr, l as Scenes, m as createMatrix2D, o as FilterMode, p as WHITE_RGB, r as BlendModes, u as TintModes } from "./types-CXsCvp1p.js";
2
2
  import { AnimationManager } from "./anims.js";
3
3
  import { i as Camera, r as Renderer2D, t as RendererWebGpu } from "./renderer-webgpu-BZ3J971y.js";
4
- import { c as InstancedBatchObject, d as PanelObject, f as RectangleObject, g as TileSpriteObject, h as TextObject, i as DisplayList, l as MsdfIconObject, m as SpriteObject, n as Container, o as Graphics, p as ShapeBatchObject, r as CustomPassObject, s as ImageObject, t as BlitterObject, u as NineSliceObject } from "./display-CZb3yen0.js";
4
+ import { c as InstancedBatchObject, d as PanelObject, f as RectangleObject, g as TileSpriteObject, h as TextObject, i as DisplayList, l as MsdfIconObject, m as SpriteObject, n as Container, o as Graphics, p as ShapeBatchObject, r as CustomPassObject, s as ImageObject, t as BlitterObject, u as NineSliceObject } from "./display-DU4edtH-.js";
5
5
  import { TweenManager } from "./tween.js";
6
6
  import { StageKernel } from "./kernel.js";
7
7
  // src/texture.ts
@@ -365,12 +365,13 @@ var TextureManager = class {
365
365
  if (typeof root.scale === "number" && Number.isFinite(root.scale)) tex.atlasScale = root.scale;
366
366
  const rawFrames = root.frames ?? atlasData.frames;
367
367
  if (!rawFrames) return tex;
368
+ let probeCanvas = null;
368
369
  let probeCtx = null;
369
370
  const emptyRectCache = /* @__PURE__ */ new Map();
370
371
  const detectEmptyRect = (fx, fy, fw, fh, explicitEmpty) => {
371
372
  if (typeof explicitEmpty === "boolean") return explicitEmpty;
372
373
  if (fw <= 1 && fh <= 1) return true;
373
- if (fw > 4 || fh > 4) return false;
374
+ if (fw > 64 || fh > 64) return false;
374
375
  const rectKey = `${fx},${fy},${fw},${fh}`;
375
376
  const cached = emptyRectCache.get(rectKey);
376
377
  if (cached !== void 0) return cached;
@@ -378,10 +379,10 @@ var TextureManager = class {
378
379
  try {
379
380
  if (probeCtx === null) {
380
381
  if (this.doc && typeof this.doc.createElement === "function") {
381
- const pc = this.doc.createElement("canvas");
382
- pc.width = 4;
383
- pc.height = 4;
384
- probeCtx = pc.getContext("2d", { willReadFrequently: true }) ?? false;
382
+ probeCanvas = this.doc.createElement("canvas");
383
+ probeCanvas.width = 64;
384
+ probeCanvas.height = 64;
385
+ probeCtx = probeCanvas.getContext("2d", { willReadFrequently: true }) ?? false;
385
386
  } else probeCtx = false;
386
387
  }
387
388
  if (probeCtx) {
@@ -1,4 +1,4 @@
1
- import { E as StagePlugin, L as SceneDigestOptions, N as SceneDigest, f as SceneInput, n as EngineClockSnapshot, r as Game, u as Scene } from "./game-BbgtwqyW.js";
1
+ import { E as StagePlugin, L as SceneDigestOptions, N as SceneDigest, f as SceneInput, n as EngineClockSnapshot, r as Game, u as Scene } from "./game-B7w2sF5C.js";
2
2
  /** Minimal Canvas2D surface compatible with `@napi-rs/canvas`, `node-canvas`, and browser `<canvas>`. */
3
3
  export interface HeadlessCanvasLike {
4
4
  width: number;
package/dist/headless.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./types-CXsCvp1p.js";
2
- import { n as Game } from "./game-CUZbJLbR.js";
2
+ import { n as Game } from "./game-CnGm5bly.js";
3
3
  import { buildSceneDigest } from "./trace.js";
4
4
  // src/headless.ts
5
5
  function createVirtualDomHost(createCanvas, width, height) {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as WebGpuBootstrapResult, A as createInputRecorder, At as NineSliceObject, B as SceneDigestSurfaceEntry, Bt as SpriteAnimEventListener, C as RecordedInputEntry, Ct as EquipmentBinding, D as TimelineClickOptions, Dt as InstancedColumns, E as StagePlugin, Et as InstancedBatchObject, F as SceneDigestEngineSandbox, Ft as RectangleObject, G as InputConfig, Gt as TextStyleConfig, H as SceneDigestSurfaces, Ht as SpritePlayOptions, I as SceneDigestNode, It as SceneHostLike, J as Pointer, Jt as CameraFollowOptions, K as InputPlugin, Kt as TileSpriteObject, L as SceneDigestOptions, Lt as ShapeBatchColumns, M as createInputTimeline, Mt as PanelOpenSide, N as SceneDigest, Nt as PanelStyleConfig, O as TimelineDragOptions, Ot as MsdfIconConfig, P as SceneDigestActiveFocus, Pt as RectClipMask, Q as RequestWebGpuOptions, R as SceneDigestOverlayStats, Rt as ShapeBatchObject, S as InputTimelinePlugin, St as DisplaySemantics, T as StageKernel, Tt as ImageObject, U as buildSceneDigest, Ut as SyncAttachmentOptions, V as SceneDigestSurfaceSource, Vt as SpriteObject, W as sanitizeTrackToken, Wt as TextObject, X as RendererWebGpu, Xt as HiDpiScaleLike, Y as PointerSample, Yt as HiDpiConfigureOptions, Z as RendererWebGpuOptions, _ as ActionMap, _t as CustomPassOptions, a as GameLoop, at as RendererGlOptions, b as InputTargetSpec, bt as DisplayObject, c as LoaderPlugin, ct as StageRenderTarget, d as SceneCtor, dt as BlitterObject, et as WebGpuCanvasContextLike, f as SceneInput, ft as Bob$1, g as ViewportFitResult, gt as CustomPassObject, h as StageRenderer, ht as CustomPassCallback, i as GameConfig$1, it as RendererGl, j as createInputReplay, jt as PanelObject, k as TimelineKeyOptions, kt as MsdfIconObject, l as ScaleManager, lt as AnchorPose2D, m as SceneManager, mt as ContainerFiltersShim, n as EngineClockSnapshot, nt as requestWebGpuDevice, o as GameObjectFactory, ot as RendererStats, p as SceneLifecycleStats, pt as Container, q as KeyboardPlugin, qt as Camera, r as Game, rt as Renderer2D, s as JsonCache, st as Stage2DCustomImageHandler, t as EngineClock, tt as WebGpuDeviceLike, u as Scene, ut as BindEquipmentOptions, v as InputProvider, vt as DirectionalPlayOptions, w as StageInputEvent, wt as Graphics, x as InputTimelineOptions, xt as DisplayObjectType, y as InputRecorderPlugin, yt as DisplayList, z as SceneDigestSandbox, zt as ShapeBatchStyleDefaults } from "./game-BbgtwqyW.js";
2
- import { A as FilterModeValue, B as WEBGL, C as AUTO, D as CANVAS, E as BlendModes, F as Scale, G as packColorAbgr, H as WHITE_RGB, I as ScaleMode, K as parseColor, L as Scenes, M as Matrix2D, N as Rect2D, O as EventEmitter, P as RgbaColor, R as TintMode, S as TextureSource, T as BlendMode, U as WorldView2D, V as WEBGPU, W as createMatrix2D, _ as SpriteSheetConfig, a as AtlasClipRule, b as TextureImageSource, c as GenerateFrameNamesConfig, d as AtlasJsonLike, f as CanvasTexture, g as GlTextureHost, h as FrameExtraMeta, i as AtlasAutoAnimOptions, j as HEX_MASK, k as FilterMode, l as GenerateFrameNumbersConfig, m as FrameAnchorTuple, n as AnimationFrameInput, o as CompiledAnimationFrame, p as Frame, q as rgbToCss, r as AnimationManager, s as DirectionalAnimGroup, t as AnimationConfig, u as StageAnimation, v as Texture, w as BLACK_RGB, x as TextureManager, y as TextureImageOptions, z as TintModes } from "./anims-xOSYNG79.js";
1
+ import { $ as WebGpuBootstrapResult, A as createInputRecorder, At as NineSliceObject, B as SceneDigestSurfaceEntry, Bt as SpriteAnimEventListener, C as RecordedInputEntry, Ct as EquipmentBinding, D as TimelineClickOptions, Dt as InstancedColumns, E as StagePlugin, Et as InstancedBatchObject, F as SceneDigestEngineSandbox, Ft as RectangleObject, G as InputConfig, Gt as TextStyleConfig, H as SceneDigestSurfaces, Ht as SpritePlayOptions, I as SceneDigestNode, It as SceneHostLike, J as Pointer, Jt as CameraFollowOptions, K as InputPlugin, Kt as TileSpriteObject, L as SceneDigestOptions, Lt as ShapeBatchColumns, M as createInputTimeline, Mt as PanelOpenSide, N as SceneDigest, Nt as PanelStyleConfig, O as TimelineDragOptions, Ot as MsdfIconConfig, P as SceneDigestActiveFocus, Pt as RectClipMask, Q as RequestWebGpuOptions, R as SceneDigestOverlayStats, Rt as ShapeBatchObject, S as InputTimelinePlugin, St as DisplaySemantics, T as StageKernel, Tt as ImageObject, U as buildSceneDigest, Ut as SyncAttachmentOptions, V as SceneDigestSurfaceSource, Vt as SpriteObject, W as sanitizeTrackToken, Wt as TextObject, X as RendererWebGpu, Xt as HiDpiScaleLike, Y as PointerSample, Yt as HiDpiConfigureOptions, Z as RendererWebGpuOptions, _ as ActionMap, _t as CustomPassOptions, a as GameLoop, at as RendererGlOptions, b as InputTargetSpec, bt as DisplayObject, c as LoaderPlugin, ct as StageRenderTarget, d as SceneCtor, dt as BlitterObject, et as WebGpuCanvasContextLike, f as SceneInput, ft as Bob$1, g as ViewportFitResult, gt as CustomPassObject, h as StageRenderer, ht as CustomPassCallback, i as GameConfig$1, it as RendererGl, j as createInputReplay, jt as PanelObject, k as TimelineKeyOptions, kt as MsdfIconObject, l as ScaleManager, lt as AnchorPose2D, m as SceneManager, mt as ContainerFiltersShim, n as EngineClockSnapshot, nt as requestWebGpuDevice, o as GameObjectFactory, ot as RendererStats, p as SceneLifecycleStats, pt as Container, q as KeyboardPlugin, qt as Camera, r as Game, rt as Renderer2D, s as JsonCache, st as Stage2DCustomImageHandler, t as EngineClock, tt as WebGpuDeviceLike, u as Scene, ut as BindEquipmentOptions, v as InputProvider, vt as DirectionalPlayOptions, w as StageInputEvent, wt as Graphics, x as InputTimelineOptions, xt as DisplayObjectType, y as InputRecorderPlugin, yt as DisplayList, z as SceneDigestSandbox, zt as ShapeBatchStyleDefaults } from "./game-B7w2sF5C.js";
2
+ import { A as FilterModeValue, B as WEBGL, C as AUTO, D as CANVAS, E as BlendModes, F as Scale, G as packColorAbgr, H as WHITE_RGB, I as ScaleMode, K as parseColor, L as Scenes, M as Matrix2D, N as Rect2D, O as EventEmitter, P as RgbaColor, R as TintMode, S as TextureSource, T as BlendMode, U as WorldView2D, V as WEBGPU, W as createMatrix2D, _ as SpriteSheetConfig, a as AtlasClipRule, b as TextureImageSource, c as GenerateFrameNamesConfig, d as AtlasJsonLike, f as CanvasTexture, g as GlTextureHost, h as FrameExtraMeta, i as AtlasAutoAnimOptions, j as HEX_MASK, k as FilterMode, l as GenerateFrameNumbersConfig, m as FrameAnchorTuple, n as AnimationFrameInput, o as CompiledAnimationFrame, p as Frame, q as rgbToCss, r as AnimationManager, s as DirectionalAnimGroup, t as AnimationConfig, u as StageAnimation, v as Texture, w as BLACK_RGB, x as TextureManager, y as TextureImageOptions, z as TintModes } from "./anims-D9N8w6IM.js";
3
3
  import { FlexAlign, FlexContainerSpec, FlexDir, FlexItemRect, FlexItemSpec, FlexJustify, FlexPadding, FlexResult, WrapContainerSpec, WrapItemRect, WrapItemSpec, WrapJustify, WrapResult, computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
4
4
  import { a as SpringHandle, c as TweenManager, i as Easings, l as TweenOptions, n as EasingFn, o as SpringOptions, r as EasingName, s as TweenHandle, t as DisposableOwner, u as TweenStats } from "./tween-BiF1FUvc.js";
5
5
  import { JoystickDpad, JoystickDpadOptions, JoystickState, JoystickVector, JoystickViewport, JoystickZone, JoystickZonePredicate, JoystickZoneRect, VirtualJoystick, VirtualJoystickMode, VirtualJoystickOptions, VirtualJoystickStyle, clampJoystickOrigin, computeJoystickVector, isInJoystickZone, pullJoystickOrigin, quantizeJoystickDpad } from "./joystick.js";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as rgbToCss, a as EventEmitter, c as Scale, d as WEBGL, f as WEBGPU, g as parseColor, h as packColorAbgr, i as CANVAS, l as Scenes, m as createMatrix2D, n as BLACK_RGB, o as FilterMode, p as WHITE_RGB, r as BlendModes, s as HEX_MASK, t as AUTO, u as TintModes } from "./types-CXsCvp1p.js";
2
- import { _ as CanvasTexture, a as JsonCache, b as TextureManager, c as Scene, d as KeyboardPlugin, f as Pointer, g as SdfPanelBatcher, h as MsdfIconBatcher, i as GameObjectFactory, l as SceneManager, m as PixelAaBatcher, n as Game, o as LoaderPlugin, p as RendererGl, r as GameLoop, s as ScaleManager, t as EngineClock, u as InputPlugin, v as Frame, x as TextureSource, y as Texture } from "./game-CUZbJLbR.js";
2
+ import { _ as CanvasTexture, a as JsonCache, b as TextureManager, c as Scene, d as KeyboardPlugin, f as Pointer, g as SdfPanelBatcher, h as MsdfIconBatcher, i as GameObjectFactory, l as SceneManager, m as PixelAaBatcher, n as Game, o as LoaderPlugin, p as RendererGl, r as GameLoop, s as ScaleManager, t as EngineClock, u as InputPlugin, v as Frame, x as TextureSource, y as Texture } from "./game-CnGm5bly.js";
3
3
  import { AnimationManager } from "./anims.js";
4
4
  import { i as Camera, n as requestWebGpuDevice, r as Renderer2D, t as RendererWebGpu } from "./renderer-webgpu-BZ3J971y.js";
5
- import { a as DisplayObject, c as InstancedBatchObject, d as PanelObject, f as RectangleObject, g as TileSpriteObject, h as TextObject, i as DisplayList, l as MsdfIconObject, m as SpriteObject, n as Container, o as Graphics, p as ShapeBatchObject, r as CustomPassObject, s as ImageObject, t as BlitterObject, u as NineSliceObject } from "./display-CZb3yen0.js";
5
+ import { a as DisplayObject, c as InstancedBatchObject, d as PanelObject, f as RectangleObject, g as TileSpriteObject, h as TextObject, i as DisplayList, l as MsdfIconObject, m as SpriteObject, n as Container, o as Graphics, p as ShapeBatchObject, r as CustomPassObject, s as ImageObject, t as BlitterObject, u as NineSliceObject } from "./display-DU4edtH-.js";
6
6
  import { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline } from "./kernel.js";
7
7
  import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
8
8
  import { computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
@@ -1,4 +1,4 @@
1
- import { J as Pointer, jt as PanelObject, pt as Container, u as Scene } from "./game-BbgtwqyW.js";
1
+ import { J as Pointer, jt as PanelObject, pt as Container, u as Scene } from "./game-B7w2sF5C.js";
2
2
  export type VirtualJoystickMode = 'floating' | 'fixed';
3
3
  export interface JoystickVector {
4
4
  /** Normalized X axis in [-1, 1] after deadzone remapping. */
package/dist/kernel.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as createInputRecorder, C as RecordedInputEntry, D as TimelineClickOptions, E as StagePlugin, M as createInputTimeline, O as TimelineDragOptions, S as InputTimelinePlugin, T as StageKernel, _ as ActionMap, b as InputTargetSpec, j as createInputReplay, k as TimelineKeyOptions, v as InputProvider, w as StageInputEvent, x as InputTimelineOptions, y as InputRecorderPlugin } from "./game-BbgtwqyW.js";
1
+ import { A as createInputRecorder, C as RecordedInputEntry, D as TimelineClickOptions, E as StagePlugin, M as createInputTimeline, O as TimelineDragOptions, S as InputTimelinePlugin, T as StageKernel, _ as ActionMap, b as InputTargetSpec, j as createInputReplay, k as TimelineKeyOptions, v as InputProvider, w as StageInputEvent, x as InputTimelineOptions, y as InputRecorderPlugin } from "./game-B7w2sF5C.js";
2
2
  export { ActionMap, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline };
@@ -1,4 +1,4 @@
1
- import { It as SceneHostLike, Tt as ImageObject, bt as DisplayObject, gt as CustomPassObject, pt as Container } from "./game-BbgtwqyW.js";
1
+ import { It as SceneHostLike, Tt as ImageObject, bt as DisplayObject, gt as CustomPassObject, pt as Container } from "./game-B7w2sF5C.js";
2
2
  export type DayPhase = 'day' | 'dusk' | 'night';
3
3
  export interface DayNightConfig {
4
4
  dayLengthMs?: number;
package/dist/lighting.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { m as createMatrix2D, o as FilterMode, r as BlendModes } from "./types-CXsCvp1p.js";
2
- import { c as InstancedBatchObject } from "./display-CZb3yen0.js";
2
+ import { c as InstancedBatchObject } from "./display-DU4edtH-.js";
3
3
  // src/lighting.ts
4
4
  function lerpChannel(a, b, t) {
5
5
  return Math.round(a + (b - a) * t) & 255;
@@ -1,4 +1,4 @@
1
- import { It as SceneHostLike, bt as DisplayObject, pt as Container } from "./game-BbgtwqyW.js";
1
+ import { It as SceneHostLike, bt as DisplayObject, pt as Container } from "./game-B7w2sF5C.js";
2
2
  export interface Camera25DConfig {
3
3
  viewportWidth: number;
4
4
  viewportHeight: number;
@@ -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-BbgtwqyW.js";
1
+ import { $ as WebGpuBootstrapResult, Q as RequestWebGpuOptions, X as RendererWebGpu, Z as RendererWebGpuOptions, et as WebGpuCanvasContextLike, nt as requestWebGpuDevice, tt as WebGpuDeviceLike } from "./game-B7w2sF5C.js";
2
2
  export { RendererWebGpu, RendererWebGpuOptions, RequestWebGpuOptions, WebGpuBootstrapResult, WebGpuCanvasContextLike, WebGpuDeviceLike, requestWebGpuDevice };
package/dist/rig2d.d.ts CHANGED
@@ -1,5 +1,5 @@
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";
1
+ import { T as BlendMode } from "./anims-D9N8w6IM.js";
2
+ import { It as SceneHostLike, Tt as ImageObject, pt as Container, wt as Graphics } from "./game-B7w2sF5C.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 { It as SceneHostLike, dt as BlitterObject, pt as Container } from "./game-BbgtwqyW.js";
1
+ import { It as SceneHostLike, dt as BlitterObject, pt as Container } from "./game-B7w2sF5C.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-BbgtwqyW.js";
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-B7w2sF5C.js";
2
2
  export { SceneDigest, SceneDigestActiveFocus, SceneDigestEngineSandbox, SceneDigestNode, SceneDigestOptions, SceneDigestOverlayStats, SceneDigestSandbox, SceneDigestSurfaceEntry, SceneDigestSurfaceSource, SceneDigestSurfaces, buildSceneDigest, sanitizeTrackToken };
package/llms.txt CHANGED
@@ -7,7 +7,7 @@
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
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.0`).
10
+ - [Changelog](https://github.com/botiverse-play/stage/blob/main/CHANGELOG.md): Release history (`0.1.0` – `0.10.1`).
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holtjs/stage",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
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.",
@@ -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.10.0`, 21 subpaths).
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.1`, 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
 
@@ -1,6 +1,6 @@
1
1
  # `@holtjs/stage` Subpath API Quick Reference
2
2
 
3
- All symbols verified against `src/*.ts` (`@holtjs/stage@0.10.0`, 21 subpaths).
3
+ All symbols verified against `src/*.ts` (`@holtjs/stage@0.10.1`, 21 subpaths).
4
4
 
5
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()`)
@@ -10,8 +10,8 @@ All symbols verified against `src/*.ts` (`@holtjs/stage@0.10.0`, 21 subpaths).
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.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()`
13
+ ## `@holtjs/stage/anims` (~3.1 kB gz · zero DOM)
14
+ - `AnimationManager`: `.create(cfg)`, `.createFromAtlas(textureKey, { defaultFrameRate?, defaultRepeat?, clips?, inheritFrom?, prefix?, overwrite? })`, `.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)
@@ -985,6 +985,17 @@ var SpriteObject = class extends ImageObject {
985
985
  },
986
986
  sync: () => {
987
987
  if (!target.active || !this.active) return false;
988
+ target.x = this.x + offsetX;
989
+ target.y = this.y + offsetY;
990
+ target.flipX = this.flipX;
991
+ target.flipY = this.flipY;
992
+ target.scaleX = this.scaleX;
993
+ target.scaleY = this.scaleY;
994
+ target.rotation = this.rotation;
995
+ target.skewX = this.skewX;
996
+ target.skewY = this.skewY;
997
+ target.alpha = this.alpha * alphaMul;
998
+ if (zOffset !== false) target.setZIndex(this.zIndex + zOffset);
988
999
  if (!binding.enabled || !curPrefix || !this.visible) {
989
1000
  target.visible = false;
990
1001
  return false;
@@ -1007,17 +1018,6 @@ var SpriteObject = class extends ImageObject {
1007
1018
  return false;
1008
1019
  }
1009
1020
  target.visible = true;
1010
- target.x = this.x + offsetX;
1011
- target.y = this.y + offsetY;
1012
- target.flipX = this.flipX;
1013
- target.flipY = this.flipY;
1014
- target.scaleX = this.scaleX;
1015
- target.scaleY = this.scaleY;
1016
- target.rotation = this.rotation;
1017
- target.skewX = this.skewX;
1018
- target.skewY = this.skewY;
1019
- target.alpha = this.alpha * alphaMul;
1020
- if (zOffset !== false) target.setZIndex(this.zIndex + zOffset);
1021
1021
  return true;
1022
1022
  },
1023
1023
  destroy: () => {