@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.
@@ -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-ClNi6zZQ.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-xOSYNG79.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`). */
@@ -193,6 +193,8 @@ declare abstract class DisplayObject extends EventEmitter {
193
193
  scaleX: number;
194
194
  scaleY: number;
195
195
  rotation: number;
196
+ skewX: number;
197
+ skewY: number;
196
198
  alpha: number;
197
199
  depth: number;
198
200
  private _zIndex;
@@ -231,6 +233,8 @@ declare abstract class DisplayObject extends EventEmitter {
231
233
  setScale(sx: number, sy?: number): this;
232
234
  setRotation(rad: number): this;
233
235
  setAngle(deg: number): this;
236
+ /** Set 2D angular shear in radians (`skewX` tilts the Y axis, `skewY` tilts the X axis; completes full 6-DOF affine `Matrix2D`). */
237
+ setSkew(sx: number, sy?: number): this;
234
238
  setAlpha(a: number): this;
235
239
  setDepth(d: number): this;
236
240
  get zIndex(): number;
@@ -297,17 +301,18 @@ declare class ImageObject extends DisplayObject {
297
301
  y: number;
298
302
  } | null;
299
303
  /**
300
- * Read the full transformed 2D pose (`x`, `y`, `rotation`, `zBias`, `hasAngle`) of an oriented socket
301
- * (`[x, y, angleRad, zBias]` from `@holtjs/craft/three` `charKit.handSocket`), transforming the 2D grip
302
- * tangent vector through the exact `flip -> scale -> rotate -> parentContainer` Jacobian!
304
+ * Read the full transformed 2D pose (`x`, `y`, `rotation`, `zBias`, `hasAngle`, plus 2x2 projected basis `ux, uy, vx, vy`
305
+ * when baked via `@holtjs/craft/three` `charKit.handBasisSocket`) transforming tangent/basis vectors through the exact
306
+ * `flip -> scale -> rotate/skew -> parentContainer` Jacobian!
303
307
  */
304
308
  getAnchorPose(name: string, space?: 'local' | 'parent' | 'world', out?: AnchorPose2D): AnchorPose2D | null;
305
309
  /**
306
310
  * Align an equipped weapon/tool `DisplayObject` (`axe`, `spear`, `torch`, `shield`) to a named socket (`'hand'`) in one call:
307
- * - Sets `child.x` & `child.y` to the transformed socket position
308
- * - Rotates `child.rotation` so `restAngle` (default `-Math.PI / 2` = upright sprite) aligns with the socket's projected 2D shaft angle
309
- * - Mirrors asymmetric blades (`mirrorBlade: true`) across the shaft axis via `O(2)` reflection when aiming left (`cos < 0`) so single-bladed axes never strike backwards!
310
- * - Applies `zBias` (`+1` in front of body, `-1` behind body) via `child.setZIndex(baseZIndex + zBias)`
311
+ * - When the socket provides a 2x2 projected 3D basis (`handBasisSocket`), solves the exact 6-DOF affine matrix
312
+ * (`scaleX`, `scaleY`, `rotation`, `skewY`) capturing shaft perspective foreshortening (`||u|| < 1`), `45°/30°`
313
+ * non-orthogonal isometric blade shear (`u · v != 0`), automatic chirality blade reflection, and per-clip wrist angles (`clipAngles`)!
314
+ * - Falls back cleanly to rigid `rotation` + `O(2)` `mirrorBlade` when given a 4-tuple `[x, y, angleRad, zBias]`.
315
+ * - Applies `zBias` (`+1` in front of body, `-1` behind body) via `child.setZIndex(baseZIndex + zBias)`.
311
316
  */
312
317
  syncAttachment(child: DisplayObject, anchorName: string, opts?: SyncAttachmentOptions): boolean;
313
318
  setTint(color: number): this;
@@ -319,12 +324,22 @@ declare class ImageObject extends DisplayObject {
319
324
  interface AnchorPose2D {
320
325
  x: number;
321
326
  y: number;
322
- /** Transformed 2D aim/shaft angle in radians (`[-PI, PI]`), accounting for `flipX`, `flipY`, `rotation`, and ancestor `Container`s. */
327
+ /** Transformed 2D aim/shaft angle in radians (`[-PI, PI]`), accounting for `flipX`, `flipY`, `rotation`, `skew`, and ancestor `Container`s. */
323
328
  rotation: number;
324
329
  /** Front/back occlusion hint (`+1` in front of body, `-1` behind body). */
325
330
  zBias: number;
326
- /** True when the baked frame socket included an explicit 3D->2D projected angle (`[x, y, angleRad, zBias]`). */
331
+ /** True when the baked frame socket included an explicit 3D->2D projected angle (`>= 4` elements). */
327
332
  hasAngle: boolean;
333
+ /** True when the baked frame socket included a full 2x2 projected 3D->2D basis (`8-tuple` from `@holtjs/craft/three` `handBasisSocket`). */
334
+ hasBasis?: boolean;
335
+ /** Transformed 2D projected shaft basis `(ux, uy)` (`hypot(ux, uy)` encodes perspective/orthographic foreshortening!). */
336
+ ux?: number;
337
+ uy?: number;
338
+ /** Transformed 2D projected blade/transverse basis `(vx, vy)` (`u · v != 0` encodes `45°/30°` isometric shear!). */
339
+ vx?: number;
340
+ vy?: number;
341
+ /** Projected shaft foreshortening length `hypot(ux, uy)`. */
342
+ foreshorten?: number;
328
343
  }
329
344
  interface SyncAttachmentOptions {
330
345
  /**
@@ -332,15 +347,47 @@ interface SyncAttachmentOptions {
332
347
  * Default `-Math.PI / 2` (pointing straight UP `-Y`, matching upright weapons/tools baked along `+Y` in `@holtjs/craft/three`).
333
348
  */
334
349
  readonly restAngle?: number;
335
- /** Additional additive angle offset in radians (automatically negated when `mirrorBlade` mirrors leftward aims). */
350
+ /** Additional additive wrist/grip angle offset in radians (in 2x2 basis mode, rotates inside the 3D grip plane before projection!). */
336
351
  readonly angleOffset?: number;
337
- /** Mirror asymmetric blades (axes, scythes, pistols) across their shaft axis when aiming left (`cos < 0`). Default `true`. */
352
+ /** Per-clip wrist/grip angle offsets in radians (e.g. `{ walk: 0.66, idle: 0.66, thrust: 0 }` so spears carry tilted 38° and thrust flat!). */
353
+ readonly clipAngles?: Readonly<Record<string, number>>;
354
+ /** Explicit clip name override when looking up `clipAngles` (defaults to `this.frame.clip` or `SpriteObject.currentAnimKey`). */
355
+ readonly clip?: string;
356
+ /** Base sprite scale (`1` default, or e.g. `0.5` for 2x supersampled sprites) applied before 2x2 foreshortening & shear. */
357
+ readonly baseScale?: number | readonly [number, number];
358
+ /** Enable full 6-DOF affine foreshortening + isometric shear when the socket carries an 8-tuple basis (`default = true`). */
359
+ readonly affineBasis?: boolean;
360
+ /** Minimum foreshortening clamp `[0.02..1]` preventing edge-on 2D sprites from collapsing to 0 width (`default = 0.22`). */
361
+ readonly minForeshorten?: number;
362
+ /** Mirror asymmetric blades (axes, scythes, pistols) across their shaft axis when aiming left (`cos < 0`) in 4-tuple rigid mode (`default = true`). */
338
363
  readonly mirrorBlade?: boolean;
339
364
  /** Coordinate space used to align `child` (`'local' | 'parent' | 'world'`; default `'parent'`). */
340
365
  readonly space?: 'local' | 'parent' | 'world';
341
366
  /** Base `zIndex` around which `pose.zBias` (`+1` front / `-1` behind) is applied (`default = this.zIndex`; `false` skips `zIndex`). */
342
367
  readonly baseZIndex?: number | false;
343
368
  }
369
+ interface BindEquipmentOptions {
370
+ /** Optional explicit texture key when equipment frames live in a separate atlas from `target.texture`. */
371
+ readonly textureKey?: string;
372
+ /** Relative `zIndex` offset applied over the host sprite (`default = 1` so depth-holdout equipment layers above the body; `false` skips `zIndex`). */
373
+ readonly zOffset?: number | false;
374
+ /** Optional position offset `(offsetX, offsetY)` in parent space (`default = 0, 0`). */
375
+ readonly offsetX?: number;
376
+ readonly offsetY?: number;
377
+ /** Optional multiplicative alpha (`default = 1`). */
378
+ readonly alpha?: number;
379
+ }
380
+ interface EquipmentBinding {
381
+ readonly target: ImageObject;
382
+ prefix: string | null;
383
+ enabled: boolean;
384
+ /** O(1) hot-swap to another baked equipment prefix (e.g. `'equip/axe'` -> `'equip/spear'`), or `null` to unequip/hide! */
385
+ setPrefix(nextPrefix: string | null, textureKey?: string): this;
386
+ /** Immediately re-synchronize frame, `ax/ay` pivot, `flipX`, transform, and visibility with the host `SpriteObject`. */
387
+ sync(): boolean;
388
+ /** Unbind and remove from automatic per-step synchronization. */
389
+ destroy(): void;
390
+ }
344
391
  interface SpritePlayOptions {
345
392
  /** Keep current animation running untouched when already playing the requested key (default `false`, or pass boolean shorthand `sprite.play(key, true)`). */
346
393
  readonly ignoreIfPlaying?: boolean;
@@ -358,7 +405,9 @@ interface DirectionalPlayOptions {
358
405
  readonly cameraYaw?: number;
359
406
  /** Override baked `atlasYaw` in radians (defaults to `group.atlasYaw`, e.g. `Math.PI / 4` from `@holtjs/craft/three`). */
360
407
  readonly atlasYaw?: number;
361
- /** Preserve walk-cycle phase when switching between directions of the same `baseKey` (default `true`). */
408
+ /** Zero-based frame index to start on (`default = 0` when starting a new clip; when explicitly set, overrides `preservePhase` and restarts even on the same direction). */
409
+ readonly startFrame?: number;
410
+ /** Preserve walk-cycle phase when switching between directions of the same `baseKey` (`default = true` unless `startFrame` is explicitly set). */
362
411
  readonly preservePhase?: boolean;
363
412
  /** Playback speed multiplier (default `1`). */
364
413
  readonly timeScale?: number;
@@ -385,6 +434,7 @@ declare class SpriteObject extends ImageObject {
385
434
  private _activeDirBase;
386
435
  private _activeDirIndex;
387
436
  private readonly _animListeners;
437
+ private readonly _equipmentBindings;
388
438
  constructor(scene: SceneHostLike, x: number, y: number, key: string, frame?: string | number);
389
439
  get currentAnim(): StageAnimation | null;
390
440
  get currentAnimKey(): string | null;
@@ -413,6 +463,18 @@ declare class SpriteObject extends ImageObject {
413
463
  _stepAnim(deltaMs: number): void;
414
464
  private _applyAnimFrame;
415
465
  private _finishAnim;
466
+ setFrame(frame: string | number): this;
467
+ /**
468
+ * Bind a 3D depth-holdout equipment `ImageObject` / `SpriteObject` (baked via `@holtjs/craft/three` `baker.bakeEquipment`)
469
+ * in exact lockstep with this character sprite:
470
+ * - Automatically resolves `<prefix>/<clip>/d<dir>/f<frame>` on every animation frame & direction turn
471
+ * - Aligns ground-origin `ax/ay` pivots (`useFramePivot()`), `x/y`, `flipX/flipY`, `scale`, `rotation`, `skew`, and `zIndex + zOffset`
472
+ * - Automatically hides `1x1` fully-occluded frames (`0` wasted GPU/Canvas2D draw calls or stray 2.5D shadows!)
473
+ * - Supports O(1) hot-swapping via `binding.setPrefix('equip/axe')` or `binding.setPrefix(null)` (unequip)
474
+ */
475
+ bindEquipment(target: ImageObject, prefix: string | null, opts?: BindEquipmentOptions): EquipmentBinding;
476
+ /** Internal synchronization hook invoked on frame changes, post-update, and pre-render. */
477
+ _syncEquipment(): void;
416
478
  destroy(fromScene?: boolean): void;
417
479
  }
418
480
  declare class NineSliceObject extends DisplayObject {
@@ -1809,6 +1871,7 @@ declare class Scene {
1809
1871
  /** Deterministic EngineClock-driven tween & spring manager (auto-stepped in `Game.step()`). */
1810
1872
  readonly tweens: TweenManager;
1811
1873
  private readonly _animatedSprites;
1874
+ private readonly _equippedSprites;
1812
1875
  private _nodesCreated;
1813
1876
  private _nodesDestroyed;
1814
1877
  private _disposersRan;
@@ -1866,6 +1929,9 @@ declare class Scene {
1866
1929
  _registerAnimatedSprite(sprite: SpriteObject): void;
1867
1930
  _unregisterAnimatedSprite(sprite: SpriteObject): void;
1868
1931
  _stepAnimations(deltaMs: number): void;
1932
+ _registerEquippedSprite(sprite: SpriteObject): void;
1933
+ _unregisterEquippedSprite(sprite: SpriteObject): void;
1934
+ _syncEquipmentBindings(): void;
1869
1935
  _invalidateTextGl(): void;
1870
1936
  _destroy(): void;
1871
1937
  }
@@ -1931,4 +1997,4 @@ declare class Game {
1931
1997
  step(time: number, delta: number): void;
1932
1998
  destroy(removeCanvas?: boolean): void;
1933
1999
  }
1934
- export { WebGpuBootstrapResult as $, createInputRecorder as A, PanelOpenSide as At, SceneDigestSurfaceEntry as B, SpritePlayOptions as Bt, RecordedInputEntry as C, ImageObject as Ct, TimelineClickOptions as D, MsdfIconObject as Dt, StagePlugin as E, MsdfIconConfig as Et, SceneDigestEngineSandbox as F, ShapeBatchColumns as Ft, InputConfig as G, Camera as Gt, SceneDigestSurfaces as H, TextObject as Ht, SceneDigestNode as I, ShapeBatchObject as It, Pointer as J, HiDpiScaleLike as Jt, InputPlugin as K, CameraFollowOptions as Kt, SceneDigestOptions as L, ShapeBatchStyleDefaults as Lt, createInputTimeline as M, RectClipMask as Mt, SceneDigest as N, RectangleObject as Nt, TimelineDragOptions as O, NineSliceObject as Ot, SceneDigestActiveFocus as P, SceneHostLike as Pt, RequestWebGpuOptions as Q, SceneDigestOverlayStats as R, SpriteAnimEventListener as Rt, InputTimelinePlugin as S, Graphics as St, StageKernel as T, InstancedColumns as Tt, buildSceneDigest as U, TextStyleConfig as Ut, SceneDigestSurfaceSource as V, SyncAttachmentOptions as Vt, sanitizeTrackToken as W, TileSpriteObject as Wt, RendererWebGpu as X, PointerSample as Y, RendererWebGpuOptions as Z, ActionMap as _, DirectionalPlayOptions as _t, GameLoop as a, RendererGlOptions as at, InputTargetSpec as b, DisplayObjectType as bt, LoaderPlugin as c, StageRenderTarget as ct, SceneCtor as d, Bob as dt, WebGpuCanvasContextLike as et, SceneInput as f, Container as ft, ViewportFitResult as g, CustomPassOptions as gt, StageRenderer as h, CustomPassObject as ht, GameConfig as i, RendererGl as it, createInputReplay as j, PanelStyleConfig as jt, TimelineKeyOptions as k, PanelObject as kt, ScaleManager as l, AnchorPose2D as lt, SceneManager as m, CustomPassCallback as mt, EngineClockSnapshot as n, requestWebGpuDevice as nt, GameObjectFactory as o, RendererStats as ot, SceneLifecycleStats as p, ContainerFiltersShim as pt, KeyboardPlugin as q, HiDpiConfigureOptions as qt, Game as r, Renderer2D as rt, JsonCache as s, Stage2DCustomImageHandler as st, EngineClock as t, WebGpuDeviceLike as tt, Scene as u, BlitterObject as ut, InputProvider as v, DisplayList as vt, StageInputEvent as w, InstancedBatchObject as wt, InputTimelineOptions as x, DisplaySemantics as xt, InputRecorderPlugin as y, DisplayObject as yt, SceneDigestSandbox as z, SpriteObject as zt };
2000
+ export { WebGpuBootstrapResult as $, createInputRecorder as A, NineSliceObject as At, SceneDigestSurfaceEntry as B, SpriteAnimEventListener as Bt, RecordedInputEntry as C, EquipmentBinding as Ct, TimelineClickOptions as D, InstancedColumns as Dt, StagePlugin as E, InstancedBatchObject as Et, SceneDigestEngineSandbox as F, RectangleObject as Ft, InputConfig as G, TextStyleConfig as Gt, SceneDigestSurfaces as H, SpritePlayOptions as Ht, SceneDigestNode as I, SceneHostLike as It, Pointer as J, CameraFollowOptions as Jt, InputPlugin as K, TileSpriteObject as Kt, SceneDigestOptions as L, ShapeBatchColumns as Lt, createInputTimeline as M, PanelOpenSide as Mt, SceneDigest as N, PanelStyleConfig as Nt, TimelineDragOptions as O, MsdfIconConfig as Ot, SceneDigestActiveFocus as P, RectClipMask as Pt, RequestWebGpuOptions as Q, SceneDigestOverlayStats as R, ShapeBatchObject as Rt, InputTimelinePlugin as S, DisplaySemantics as St, StageKernel as T, ImageObject as Tt, buildSceneDigest as U, SyncAttachmentOptions as Ut, SceneDigestSurfaceSource as V, SpriteObject as Vt, sanitizeTrackToken as W, TextObject as Wt, RendererWebGpu as X, HiDpiScaleLike as Xt, PointerSample as Y, HiDpiConfigureOptions as Yt, RendererWebGpuOptions as Z, ActionMap as _, CustomPassOptions as _t, GameLoop as a, RendererGlOptions as at, InputTargetSpec as b, DisplayObject as bt, LoaderPlugin as c, StageRenderTarget as ct, SceneCtor as d, BlitterObject as dt, WebGpuCanvasContextLike as et, SceneInput as f, Bob as ft, ViewportFitResult as g, CustomPassObject as gt, StageRenderer as h, CustomPassCallback as ht, GameConfig as i, RendererGl as it, createInputReplay as j, PanelObject as jt, TimelineKeyOptions as k, MsdfIconObject as kt, ScaleManager as l, AnchorPose2D as lt, SceneManager as m, ContainerFiltersShim as mt, EngineClockSnapshot as n, requestWebGpuDevice as nt, GameObjectFactory as o, RendererStats as ot, SceneLifecycleStats as p, Container as pt, KeyboardPlugin as q, Camera as qt, Game as r, Renderer2D as rt, JsonCache as s, Stage2DCustomImageHandler as st, EngineClock as t, WebGpuDeviceLike as tt, Scene as u, BindEquipmentOptions as ut, InputProvider as v, DirectionalPlayOptions as vt, StageInputEvent as w, Graphics as wt, InputTimelineOptions as x, DisplayObjectType as xt, InputRecorderPlugin as y, DisplayList as yt, SceneDigestSandbox as z, ShapeBatchStyleDefaults as zt };
@@ -1,6 +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
- import { _ as SpriteObject, a as Container, b as Camera, d as InstancedBatchObject, f as MsdfIconObject, g as ShapeBatchObject, h as RectangleObject, i as BlitterObject, l as Graphics, m as PanelObject, o as CustomPassObject, p as NineSliceObject, r as Renderer2D, s as DisplayList, t as RendererWebGpu, u as ImageObject, v as TextObject, y as TileSpriteObject } from "./renderer-webgpu-BXU-ZDIp.js";
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
5
  import { TweenManager } from "./tween.js";
5
6
  import { StageKernel } from "./kernel.js";
6
7
  // src/texture.ts
@@ -97,10 +98,13 @@ var Frame = class {
97
98
  emissiveCenter = null;
98
99
  emissivePower = 0;
99
100
  actor = null;
101
+ baseActor = null;
100
102
  clip = null;
101
103
  dir = null;
102
104
  animFrameIndex = null;
103
105
  animLoop = void 0;
106
+ /** True when the frame contains zero visible pixels (`1x1` cell, `<=4x4` all-transparent placeholder, or explicit `empty: true`). */
107
+ empty = false;
104
108
  constructor(texture, name, sourceIndex, x, y, w, h, meta) {
105
109
  this.texture = texture;
106
110
  this.name = name;
@@ -116,6 +120,7 @@ var Frame = class {
116
120
  this.cutHeight = height;
117
121
  this.width = width;
118
122
  this.height = height;
123
+ if (width <= 0 || height <= 0) this.empty = true;
119
124
  if (!this.customPivot) {
120
125
  this.pixelPivotX = width * this.pivotX;
121
126
  this.pixelPivotY = height * this.pivotY;
@@ -141,12 +146,22 @@ var Frame = class {
141
146
  this.pivotY = this.height > 0 ? ay / this.height : .5;
142
147
  return this;
143
148
  }
144
- /** Attach or update a named pixel socket `(x, y)` (with optional projected `angleRad` & front/back `zBias`). */
145
- setAnchor(name, x, y, angleRad, zBias) {
149
+ /** Attach or update a named pixel socket `(x, y)` (with optional `angleRad`, `zBias`, and 2x2 projected basis `[ux, uy, vx, vy]`). */
150
+ setAnchor(name, x, y, angleRad, zBias, ux, uy, vx, vy) {
146
151
  if (!this.anchors) this.anchors = Object.create(null);
147
152
  if (typeof angleRad === "number" && Number.isFinite(angleRad)) {
148
153
  const zb = typeof zBias === "number" && Number.isFinite(zBias) ? zBias >= 0 ? 1 : -1 : 1;
149
- this.anchors[name] = [
154
+ if (typeof ux === "number" && Number.isFinite(ux) && typeof uy === "number" && Number.isFinite(uy) && typeof vx === "number" && Number.isFinite(vx) && typeof vy === "number" && Number.isFinite(vy)) this.anchors[name] = [
155
+ x,
156
+ y,
157
+ angleRad,
158
+ zb,
159
+ ux,
160
+ uy,
161
+ vx,
162
+ vy
163
+ ];
164
+ else this.anchors[name] = [
150
165
  x,
151
166
  y,
152
167
  angleRad,
@@ -165,16 +180,20 @@ var Frame = class {
165
180
  if (typeof meta.ax === "number" && typeof meta.ay === "number") this.setPixelPivot(meta.ax, meta.ay);
166
181
  else if (typeof meta.pivotX === "number" || typeof meta.pivotY === "number") this.setPivot(meta.pivotX ?? .5, meta.pivotY ?? .5);
167
182
  if (meta.anchors) {
168
- for (const [k, pt] of Object.entries(meta.anchors)) if (Array.isArray(pt) && pt.length >= 2) this.setAnchor(k, Number(pt[0]) || 0, Number(pt[1]) || 0, pt.length >= 3 && typeof pt[2] === "number" ? Number(pt[2]) : void 0, pt.length >= 4 && typeof pt[3] === "number" ? Number(pt[3]) : void 0);
183
+ for (const [k, pt] of Object.entries(meta.anchors)) if (Array.isArray(pt) && pt.length >= 2) this.setAnchor(k, Number(pt[0]) || 0, Number(pt[1]) || 0, pt.length >= 3 && typeof pt[2] === "number" ? Number(pt[2]) : void 0, pt.length >= 4 && typeof pt[3] === "number" ? Number(pt[3]) : void 0, pt.length >= 8 && typeof pt[4] === "number" ? Number(pt[4]) : void 0, pt.length >= 8 && typeof pt[5] === "number" ? Number(pt[5]) : void 0, pt.length >= 8 && typeof pt[6] === "number" ? Number(pt[6]) : void 0, pt.length >= 8 && typeof pt[7] === "number" ? Number(pt[7]) : void 0);
169
184
  }
170
185
  if (Array.isArray(meta.emissiveCenter) && meta.emissiveCenter.length >= 2) this.emissiveCenter = [Number(meta.emissiveCenter[0]) || 0, Number(meta.emissiveCenter[1]) || 0];
171
186
  if (typeof meta.emissivePower === "number") this.emissivePower = meta.emissivePower;
172
187
  const actor = meta.actor ?? meta.char;
173
188
  if (typeof actor === "string" && actor.length > 0) this.actor = actor;
189
+ const baseActor = meta.baseActor ?? meta.baseChar;
190
+ if (typeof baseActor === "string" && baseActor.length > 0) this.baseActor = baseActor;
174
191
  if (typeof meta.clip === "string" && meta.clip.length > 0) this.clip = meta.clip;
175
192
  if (typeof meta.dir === "number" || typeof meta.dir === "string") this.dir = meta.dir;
176
193
  if (typeof meta.frame === "number" && Number.isFinite(meta.frame)) this.animFrameIndex = meta.frame;
177
194
  if (typeof meta.loop === "boolean") this.animLoop = meta.loop;
195
+ if (typeof meta.empty === "boolean") this.empty = meta.empty;
196
+ else if (this.cutWidth <= 1 && this.cutHeight <= 1) this.empty = true;
178
197
  return this;
179
198
  }
180
199
  updateUVs() {
@@ -346,6 +365,42 @@ var TextureManager = class {
346
365
  if (typeof root.scale === "number" && Number.isFinite(root.scale)) tex.atlasScale = root.scale;
347
366
  const rawFrames = root.frames ?? atlasData.frames;
348
367
  if (!rawFrames) return tex;
368
+ let probeCtx = null;
369
+ const emptyRectCache = /* @__PURE__ */ new Map();
370
+ const detectEmptyRect = (fx, fy, fw, fh, explicitEmpty) => {
371
+ if (typeof explicitEmpty === "boolean") return explicitEmpty;
372
+ if (fw <= 1 && fh <= 1) return true;
373
+ if (fw > 4 || fh > 4) return false;
374
+ const rectKey = `${fx},${fy},${fw},${fh}`;
375
+ const cached = emptyRectCache.get(rectKey);
376
+ if (cached !== void 0) return cached;
377
+ let isEmpty = false;
378
+ try {
379
+ if (probeCtx === null) {
380
+ 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;
385
+ } else probeCtx = false;
386
+ }
387
+ if (probeCtx) {
388
+ probeCtx.clearRect(0, 0, fw, fh);
389
+ probeCtx.drawImage(source, fx, fy, fw, fh, 0, 0, fw, fh);
390
+ const data = probeCtx.getImageData(0, 0, fw, fh).data;
391
+ let allZero = true;
392
+ for (let i = 3; i < data.length; i += 4) if (data[i] !== 0) {
393
+ allZero = false;
394
+ break;
395
+ }
396
+ isEmpty = allZero;
397
+ }
398
+ } catch {
399
+ isEmpty = false;
400
+ }
401
+ emptyRectCache.set(rectKey, isEmpty);
402
+ return isEmpty;
403
+ };
349
404
  const addEntry = (frameName, entry) => {
350
405
  if (!entry || typeof entry !== "object") return;
351
406
  if (entry.frame && typeof entry.frame === "object" && typeof entry.frame.w === "number") {
@@ -354,7 +409,11 @@ var TextureManager = class {
354
409
  const fy = Number(fr.y) || 0;
355
410
  const fw = Number(fr.w) || 0;
356
411
  const fh = Number(fr.h) || 0;
357
- const meta = {};
412
+ const meta = {
413
+ baseChar: entry.baseChar,
414
+ baseActor: entry.baseActor,
415
+ empty: detectEmptyRect(fx, fy, fw, fh, entry.empty)
416
+ };
358
417
  if (entry.pivot && typeof entry.pivot.x === "number" && typeof entry.pivot.y === "number") {
359
418
  const px = Number(entry.pivot.x);
360
419
  const py = Number(entry.pivot.y);
@@ -384,11 +443,14 @@ var TextureManager = class {
384
443
  emissivePower: entry.emissivePower,
385
444
  char: entry.char,
386
445
  actor: entry.actor,
446
+ baseChar: entry.baseChar,
447
+ baseActor: entry.baseActor,
387
448
  clip: entry.clip,
388
449
  dir: entry.dir,
389
450
  frame: typeof entry.frame === "number" ? entry.frame : void 0,
390
451
  frames: entry.frames,
391
- loop: entry.loop
452
+ loop: entry.loop,
453
+ empty: detectEmptyRect(fx, fy, fw, fh, entry.empty)
392
454
  });
393
455
  };
394
456
  if (Array.isArray(rawFrames)) for (let i = 0; i < rawFrames.length; i++) {
@@ -1632,19 +1694,26 @@ function compileShader(gl, type, src) {
1632
1694
  function isPow2(v) {
1633
1695
  return v > 0 && (v & v - 1) === 0;
1634
1696
  }
1635
- function multiplyMat(parent, x, y, sx, sy, rot, out) {
1697
+ function multiplyMat(parent, x, y, sx, sy, rot, out, skewX = 0, skewY = 0) {
1636
1698
  let la, lb, lc, ld;
1637
- if (rot === 0) {
1638
- la = sx;
1639
- lb = 0;
1640
- lc = 0;
1641
- ld = sy;
1699
+ if (skewX === 0 && skewY === 0) {
1700
+ if (rot === 0) {
1701
+ la = sx;
1702
+ lb = 0;
1703
+ lc = 0;
1704
+ ld = sy;
1705
+ } else {
1706
+ const cs = Math.cos(rot), sn = Math.sin(rot);
1707
+ la = cs * sx;
1708
+ lb = sn * sx;
1709
+ lc = -sn * sy;
1710
+ ld = cs * sy;
1711
+ }
1642
1712
  } else {
1643
- const cs = Math.cos(rot), sn = Math.sin(rot);
1644
- la = cs * sx;
1645
- lb = sn * sx;
1646
- lc = -sn * sy;
1647
- ld = cs * sy;
1713
+ la = Math.cos(rot + skewY) * sx;
1714
+ lb = Math.sin(rot + skewY) * sx;
1715
+ lc = -Math.sin(rot - skewX) * sy;
1716
+ ld = Math.cos(rot - skewX) * sy;
1648
1717
  }
1649
1718
  out.a = parent.a * la + parent.c * lb;
1650
1719
  out.b = parent.b * la + parent.d * lb;
@@ -2354,7 +2423,7 @@ var RendererGl = class extends EventEmitter {
2354
2423
  const gl = opts.context ?? canvas.getContext("webgl2", attrs) ?? canvas.getContext("webgl", attrs);
2355
2424
  if (!gl) throw new Error("Stage2D: WebGL context unavailable");
2356
2425
  this.gl = gl;
2357
- this.isWebGL2 = typeof WebGL2RenderingContext !== "undefined" && typeof gl.createVertexArray === "function";
2426
+ this.isWebGL2 = typeof gl.createVertexArray === "function" && typeof gl.bindVertexArray === "function" && typeof gl.createSampler === "function";
2358
2427
  const hwUnits = Number(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)) || 8;
2359
2428
  this.maxTextures = Math.max(1, Math.min(16, hwUnits));
2360
2429
  this.batchMaxUnits = Math.max(1, Math.min(BATCH_MAX_UNITS, this.maxTextures));
@@ -2430,6 +2499,7 @@ var RendererGl = class extends EventEmitter {
2430
2499
  }
2431
2500
  /** Mark program/VAO/VBO state dirty after an external CustomPass without wiping the shared texture-unit cache. */
2432
2501
  invalidateProgramState() {
2502
+ if (this.isWebGL2 && typeof this.gl.bindVertexArray === "function") this.gl.bindVertexArray(null);
2433
2503
  this.batchStateBound = false;
2434
2504
  this.activeProgram = null;
2435
2505
  this.boundVao = null;
@@ -4053,10 +4123,10 @@ var RendererGl = class extends EventEmitter {
4053
4123
  }
4054
4124
  }
4055
4125
  let m;
4056
- if (obj.x === 0 && obj.y === 0 && obj.scaleX === 1 && obj.scaleY === 1 && obj.rotation === 0) m = baseMat;
4126
+ if (obj.x === 0 && obj.y === 0 && obj.scaleX === 1 && obj.scaleY === 1 && obj.rotation === 0 && obj.skewX === 0 && obj.skewY === 0) m = baseMat;
4057
4127
  else {
4058
4128
  if (depth >= this.matPool.length) this.matPool.push(createMatrix2D());
4059
- m = multiplyMat(baseMat, obj.x, obj.y, obj.scaleX, obj.scaleY, obj.rotation, this.matPool[depth]);
4129
+ m = multiplyMat(baseMat, obj.x, obj.y, obj.scaleX, obj.scaleY, obj.rotation, this.matPool[depth], obj.skewX, obj.skewY);
4060
4130
  }
4061
4131
  switch (obj.type) {
4062
4132
  case "Image":
@@ -4122,6 +4192,7 @@ var RendererGl = class extends EventEmitter {
4122
4192
  case "CustomPass": {
4123
4193
  const pass = obj;
4124
4194
  this.flushAll();
4195
+ this.invalidateProgramState();
4125
4196
  pass.onRender(pass, this, camera);
4126
4197
  if (pass.restoreState) this.restoreState();
4127
4198
  else this.invalidateProgramState();
@@ -5215,6 +5286,7 @@ var Scene = class {
5215
5286
  /** Deterministic EngineClock-driven tween & spring manager (auto-stepped in `Game.step()`). */
5216
5287
  tweens = new TweenManager();
5217
5288
  _animatedSprites = /* @__PURE__ */ new Set();
5289
+ _equippedSprites = /* @__PURE__ */ new Set();
5218
5290
  _nodesCreated = 0;
5219
5291
  _nodesDestroyed = 0;
5220
5292
  _disposersRan = 0;
@@ -5308,6 +5380,17 @@ var Scene = class {
5308
5380
  for (const s of this._animatedSprites) if (s.active) s._stepAnim(deltaMs);
5309
5381
  else this._animatedSprites.delete(s);
5310
5382
  }
5383
+ _registerEquippedSprite(sprite) {
5384
+ this._equippedSprites.add(sprite);
5385
+ }
5386
+ _unregisterEquippedSprite(sprite) {
5387
+ this._equippedSprites.delete(sprite);
5388
+ }
5389
+ _syncEquipmentBindings() {
5390
+ if (this._equippedSprites.size === 0) return;
5391
+ for (const s of this._equippedSprites) if (s.active) s._syncEquipment();
5392
+ else this._equippedSprites.delete(s);
5393
+ }
5311
5394
  _invalidateTextGl() {
5312
5395
  const walk = (list) => {
5313
5396
  for (let i = 0; i < list.length; i++) {
@@ -5333,6 +5416,7 @@ var Scene = class {
5333
5416
  snap[i].destroy(true);
5334
5417
  } catch {}
5335
5418
  this._animatedSprites.clear();
5419
+ this._equippedSprites.clear();
5336
5420
  this.tweens.clear();
5337
5421
  }
5338
5422
  };
@@ -5595,6 +5679,7 @@ var Game = class {
5595
5679
  sc.update?.(time, delta);
5596
5680
  this.kernel._updateScene(sc, time, delta);
5597
5681
  sc.cameras.main.stepFollow(this.clock.lastDeltaMs);
5682
+ sc._syncEquipmentBindings();
5598
5683
  sc.events.emit("update", time, delta);
5599
5684
  sc.events.emit("postupdate", time, delta);
5600
5685
  }
@@ -5616,6 +5701,7 @@ var Game = class {
5616
5701
  const sc = scenes[i];
5617
5702
  if (sc.sys.settings.status === Scenes.RUNNING) {
5618
5703
  sc.preRender?.(time, lastDt);
5704
+ sc._syncEquipmentBindings();
5619
5705
  this.kernel._prerenderScene(sc, this.renderer, time, lastDt);
5620
5706
  sc.events.emit("prerender", this.renderer, time, lastDt);
5621
5707
  this.renderer.render(sc._displayList, sc.cameras.main);
@@ -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-CEa0m4eX.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-BbgtwqyW.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-D46nY-B2.js";
2
+ import { n as Game } from "./game-CUZbJLbR.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 PanelOpenSide, B as SceneDigestSurfaceEntry, Bt as SpritePlayOptions, C as RecordedInputEntry, Ct as ImageObject, D as TimelineClickOptions, Dt as MsdfIconObject, E as StagePlugin, Et as MsdfIconConfig, F as SceneDigestEngineSandbox, Ft as ShapeBatchColumns, G as InputConfig, Gt as Camera, H as SceneDigestSurfaces, Ht as TextObject, I as SceneDigestNode, It as ShapeBatchObject, J as Pointer, Jt as HiDpiScaleLike, K as InputPlugin, Kt as CameraFollowOptions, L as SceneDigestOptions, Lt as ShapeBatchStyleDefaults, M as createInputTimeline, Mt as RectClipMask, N as SceneDigest, Nt as RectangleObject, O as TimelineDragOptions, Ot as NineSliceObject, P as SceneDigestActiveFocus, Pt as SceneHostLike, Q as RequestWebGpuOptions, R as SceneDigestOverlayStats, Rt as SpriteAnimEventListener, S as InputTimelinePlugin, St as Graphics, T as StageKernel, Tt as InstancedColumns, U as buildSceneDigest, Ut as TextStyleConfig, V as SceneDigestSurfaceSource, Vt as SyncAttachmentOptions, W as sanitizeTrackToken, Wt as TileSpriteObject, X as RendererWebGpu, Y as PointerSample, Z as RendererWebGpuOptions, _ as ActionMap, _t as DirectionalPlayOptions, a as GameLoop, at as RendererGlOptions, b as InputTargetSpec, bt as DisplayObjectType, c as LoaderPlugin, ct as StageRenderTarget, d as SceneCtor, dt as Bob$1, et as WebGpuCanvasContextLike, f as SceneInput, ft as Container, g as ViewportFitResult, gt as CustomPassOptions, h as StageRenderer, ht as CustomPassObject, i as GameConfig$1, it as RendererGl, j as createInputReplay, jt as PanelStyleConfig, k as TimelineKeyOptions, kt as PanelObject, l as ScaleManager, lt as AnchorPose2D, m as SceneManager, mt as CustomPassCallback, n as EngineClockSnapshot, nt as requestWebGpuDevice, o as GameObjectFactory, ot as RendererStats, p as SceneLifecycleStats, pt as ContainerFiltersShim, q as KeyboardPlugin, qt as HiDpiConfigureOptions, r as Game, rt as Renderer2D, s as JsonCache, st as Stage2DCustomImageHandler, t as EngineClock, tt as WebGpuDeviceLike, u as Scene, ut as BlitterObject, v as InputProvider, vt as DisplayList, w as StageInputEvent, wt as InstancedBatchObject, x as InputTimelineOptions, xt as DisplaySemantics, y as InputRecorderPlugin, yt as DisplayObject, z as SceneDigestSandbox, zt as SpriteObject } from "./game-CEa0m4eX.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-ClNi6zZQ.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-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";
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";
@@ -331,4 +331,4 @@ export declare const Stage: {
331
331
  };
332
332
  };
333
333
  };
334
- export { AUTO, ActionMap, type AnchorPose2D, type AnimationConfig, type AnimationFrameInput, AnimationManager, type AtlasAutoAnimOptions, type AtlasClipRule, type AtlasJsonLike, BLACK_RGB, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, type CameraFollowOptions, CanvasTexture, type CompiledAnimationFrame, Container, type ContainerFiltersShim, type CustomPassCallback, CustomPassObject, type CustomPassOptions, type DirectionalAnimGroup, type DirectionalPlayOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, EventEmitter, FilterMode, type FilterModeValue, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexPadding, type FlexResult, Frame, type FrameAnchorTuple, type FrameExtraMeta, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GenerateFrameNamesConfig, type GenerateFrameNumbersConfig, type GlTextureHost, Graphics, HEX_MASK, type HiDpiConfigureOptions, type HiDpiScaleLike, ImageObject, type InputConfig, InputPlugin, type InputProvider, type InputRecorderPlugin, type InputTargetSpec, type InputTimelineOptions, type InputTimelinePlugin, InstancedBatchObject, type InstancedColumns, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, type Matrix2D, type MsdfIconConfig, MsdfIconObject, NineSliceObject, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type RecordedInputEntry, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, RendererWebGpu, type RendererWebGpuOptions, type RequestWebGpuOptions, type RgbaColor, SURFACE_BAND, Scale, ScaleManager, type ScaleMode, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type ShapeBatchColumns, ShapeBatchObject, type ShapeBatchStyleDefaults, type SpringHandle, type SpringOptions, type SpriteAnimEventListener, SpriteObject, type SpritePlayOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageAnimation, type StageInputEvent, StageKernel, type StagePlugin, type StageRenderTarget, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, type SyncAttachmentOptions, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TimelineClickOptions, type TimelineDragOptions, type TimelineKeyOptions, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, type ViewportFitResult, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WEBGPU, WHITE_RGB, type WebGpuBootstrapResult, type WebGpuCanvasContextLike, type WebGpuDeviceLike, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
334
+ export { AUTO, ActionMap, type AnchorPose2D, type AnimationConfig, type AnimationFrameInput, AnimationManager, type AtlasAutoAnimOptions, type AtlasClipRule, type AtlasJsonLike, BLACK_RGB, type BindEquipmentOptions, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, type CameraFollowOptions, CanvasTexture, type CompiledAnimationFrame, Container, type ContainerFiltersShim, type CustomPassCallback, CustomPassObject, type CustomPassOptions, type DirectionalAnimGroup, type DirectionalPlayOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, type EquipmentBinding, EventEmitter, FilterMode, type FilterModeValue, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexPadding, type FlexResult, Frame, type FrameAnchorTuple, type FrameExtraMeta, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GenerateFrameNamesConfig, type GenerateFrameNumbersConfig, type GlTextureHost, Graphics, HEX_MASK, type HiDpiConfigureOptions, type HiDpiScaleLike, ImageObject, type InputConfig, InputPlugin, type InputProvider, type InputRecorderPlugin, type InputTargetSpec, type InputTimelineOptions, type InputTimelinePlugin, InstancedBatchObject, type InstancedColumns, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, type Matrix2D, type MsdfIconConfig, MsdfIconObject, NineSliceObject, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type RecordedInputEntry, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, RendererWebGpu, type RendererWebGpuOptions, type RequestWebGpuOptions, type RgbaColor, SURFACE_BAND, Scale, ScaleManager, type ScaleMode, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type ShapeBatchColumns, ShapeBatchObject, type ShapeBatchStyleDefaults, type SpringHandle, type SpringOptions, type SpriteAnimEventListener, SpriteObject, type SpritePlayOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageAnimation, type StageInputEvent, StageKernel, type StagePlugin, type StageRenderTarget, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, type SyncAttachmentOptions, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TimelineClickOptions, type TimelineDragOptions, type TimelineKeyOptions, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, type ViewportFitResult, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WEBGPU, WHITE_RGB, type WebGpuBootstrapResult, type WebGpuCanvasContextLike, type WebGpuDeviceLike, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
package/dist/index.js CHANGED
@@ -1,7 +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-D46nY-B2.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";
3
3
  import { AnimationManager } from "./anims.js";
4
- import { _ as SpriteObject, a as Container, b as Camera, c as DisplayObject, d as InstancedBatchObject, f as MsdfIconObject, g as ShapeBatchObject, h as RectangleObject, i as BlitterObject, l as Graphics, m as PanelObject, n as requestWebGpuDevice, o as CustomPassObject, p as NineSliceObject, r as Renderer2D, s as DisplayList, t as RendererWebGpu, u as ImageObject, v as TextObject, y as TileSpriteObject } from "./renderer-webgpu-BXU-ZDIp.js";
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
6
  import { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline } from "./kernel.js";
6
7
  import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
7
8
  import { computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
@@ -1,4 +1,4 @@
1
- import { J as Pointer, ft as Container, kt as PanelObject, u as Scene } from "./game-CEa0m4eX.js";
1
+ import { J as Pointer, jt as PanelObject, pt as Container, u as Scene } from "./game-BbgtwqyW.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-CEa0m4eX.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-BbgtwqyW.js";
2
2
  export { ActionMap, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline };