@holtjs/stage 0.6.0 → 0.8.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 CHANGED
@@ -6,6 +6,30 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.0] - 2026-12-04
10
+
11
+ ### Added
12
+ - **Oriented 3D->2D Socket Poses (`[x, y, angleRad, zBias]`) & One-Call Weapon Sync (`getAnchorPose` & `syncAttachment`, `src/texture.ts`, `src/display.ts`)**:
13
+ - Extended `Frame` sockets to accept oriented 4-tuples `[x, y, angleRad, zBias]` (projected from 3D bone matrices via `@holtjs/craft/three` `charKit.handSocket`) alongside 2-tuples `[x, y]`.
14
+ - Added `ImageObject.getAnchorPose(name, space?)` transforming the 2D grip tangent vector through the exact `flip -> scale -> rotate -> parentContainer` Jacobian.
15
+ - Added `ImageObject.syncAttachment(child, anchorName, opts?)` aligning position, shaft rotation (`restAngle`), `O(2)` single-blade mirroring (`mirrorBlade: true` so axes/scythes never strike backwards when turning left), and front/back body occlusion (`zBias` via `setZIndex`).
16
+ - **Reactive `DisplayObject.zIndex` Setter (`src/display.ts`)**:
17
+ - Converted `DisplayObject.zIndex` into a reactive getter/setter that automatically marks `parentContainer._markZDirty(true)` on direct property assignment (`node.zIndex = ...`), ensuring dynamic 2.5D depth sorting in `mountStage25D` and custom `Container`s stays strictly ordered every frame.
18
+
19
+ ## [0.7.0] - 2026-12-04
20
+
21
+ ### Added
22
+ - **First-Class Atlas Pivots, Named Sockets (`anchors`) & `TextureManager.addAtlas` (`src/texture.ts`, `src/display.ts`)**:
23
+ - Extended `Frame` with exact pixel pivots (`customPivot`, `pixelPivotX`, `pixelPivotY`, `pivotX`, `pivotY`), named frame-space pixel sockets (`anchors`, `setAnchor()`, `getAnchor()`), `emissiveCenter` / `emissivePower`, and baker clip metadata (`actor`, `clip`, `dir`, `animFrameIndex`, `animLoop`), plus `Texture.atlasYaw`.
24
+ - Added `TextureManager.addAtlas(key, source, atlasData, opts?)` and `LoaderPlugin.atlas()` natively parsing `@holtjs/craft/three`, `@holtjs/craft/atlas`, and TexturePacker / Aseprite trimmed Hash & Array JSON.
25
+ - Updated `ImageObject` (and `SpriteObject`) so trimmed frames with `customPivot` automatically align `_displayOriginX` / `_displayOriginY` without float drift, mirror around their ground pivot `(ax, ay)` on `flipX` / `flipY` across WebGL2, WebGPU, and Canvas2D, and expose `getAnchor(name, 'local' | 'parent' | 'world')`.
26
+ - **`SpriteObject` (`scene.add.sprite`) & `AnimationManager` (`scene.anims` / `@holtjs/stage/anims`)**:
27
+ - Added `AnimationManager` (`create`, `createFromAtlas`, `generateFrameNames`, `generateFrameNumbers`, `resolveOrThrow`, `resolveDirectionalOrThrow`) auto-discovering 4/8-directional and non-directional clips from baked atlases and registering unambiguous bare actor aliases (e.g. `'chars/survivor'` -> `'survivor/walk'` & `'survivor_walk'`) with fail-fast diagnostics on unknown clip names.
28
+ - Added deterministic simulation-stepped `SpriteObject` (`play`, `playDirectional` with `Camera25D.yaw` + `atlasYaw` compensation and `preservePhase` stride continuity, `onAnimEvent` for `footstep`/`hit` callbacks, `pause`/`resume`/`stop`), advancing identically in `Game.step()` and `Game.stepSimOnly()` / `HeadlessStage.fastForward()`, and surfaced `type: 'Sprite'`, `anim`, and `frame` in zero-PII `buildSceneDigest()`.
29
+ - **Canvas2D Chunk-Surface Tilemap Caching, `Renderer2D` Frustum Culling & Zero-Alloc Headless Readback (`src/tilemap.ts`, `src/renderer-2d.ts`, `src/headless.ts`)**:
30
+ - `mountChunkedTilemap()` now automatically pre-composites all Dual-Grid layers of each `16×16` chunk onto a cached offscreen chunk canvas keyed by `chunk.version` on `CANVAS` / `createHeadlessStage` (collapsing thousands of per-frame rotated tile `drawImage` calls down to ~12 chunk blits; also added `mounted.update(bounds)` convenience overload).
31
+ - Added pure-JS 4-corner `isOffscreen` frustum culling (`stats().culled`) on `Renderer2D` before touching Canvas2D / Skia FFI, plus `HeadlessStage.toRgbaInto(out)` and `RecordFramesOptions.reuseFrameBuffer`.
32
+
9
33
  ## [0.6.0] - 2026-12-04
10
34
 
11
35
  ### Added
@@ -0,0 +1,391 @@
1
+ declare const AUTO = 0;
2
+ declare const CANVAS = 1;
3
+ declare const WEBGL = 2;
4
+ declare const WEBGPU = 3;
5
+ declare const BlendModes: {
6
+ readonly NORMAL: 0;
7
+ readonly ADD: 1;
8
+ readonly MULTIPLY: 2;
9
+ readonly SCREEN: 3;
10
+ };
11
+ type BlendMode = (typeof BlendModes)[keyof typeof BlendModes];
12
+ declare const TintModes: {
13
+ readonly MULTIPLY: 0;
14
+ readonly FILL: 1;
15
+ };
16
+ type TintMode = (typeof TintModes)[keyof typeof TintModes];
17
+ declare const FilterMode: {
18
+ readonly LINEAR: 0;
19
+ readonly NEAREST: 1;
20
+ };
21
+ type FilterModeValue = (typeof FilterMode)[keyof typeof FilterMode];
22
+ declare const Scale: {
23
+ readonly NONE: 0;
24
+ readonly FIT: 1;
25
+ readonly RESIZE: 2;
26
+ };
27
+ type ScaleMode = (typeof Scale)[keyof typeof Scale];
28
+ declare const Scenes: {
29
+ readonly PENDING: 0;
30
+ readonly INIT: 1;
31
+ readonly START: 2;
32
+ readonly LOADING: 3;
33
+ readonly CREATING: 4;
34
+ readonly RUNNING: 5;
35
+ readonly PAUSED: 6;
36
+ readonly SLEEPING: 7;
37
+ readonly SHUTDOWN: 8;
38
+ readonly DESTROYED: 9;
39
+ };
40
+ /** Canonical neutral white & black integers (kept here once for color-check cleanliness). */
41
+ declare const WHITE_RGB = 16777215;
42
+ declare const BLACK_RGB = 0;
43
+ declare const HEX_MASK = 16777215;
44
+ interface Rect2D {
45
+ x: number;
46
+ y: number;
47
+ width: number;
48
+ height: number;
49
+ left: number;
50
+ right: number;
51
+ top: number;
52
+ bottom: number;
53
+ }
54
+ interface WorldView2D {
55
+ x: number;
56
+ y: number;
57
+ width: number;
58
+ height: number;
59
+ right: number;
60
+ bottom: number;
61
+ }
62
+ interface Matrix2D {
63
+ a: number;
64
+ b: number;
65
+ c: number;
66
+ d: number;
67
+ tx: number;
68
+ ty: number;
69
+ scaleX: number;
70
+ scaleY: number;
71
+ }
72
+ interface RgbaColor {
73
+ r: number;
74
+ g: number;
75
+ b: number;
76
+ a: number;
77
+ }
78
+ declare function createMatrix2D(): Matrix2D;
79
+ /** Parse a CSS hex/rgb(a) string or 0xRRGGBB number into normalized [0..1] RGBA. */
80
+ declare function parseColor(input: string | number | null | undefined, fallbackAlpha?: number): RgbaColor;
81
+ /** Convert 0xRRGGBB + alpha [0..1] into a CSS rgba(...) string. */
82
+ declare function rgbToCss(color: number, alpha?: number): string;
83
+ /** Pack 0xRRGGBB + alpha [0..1] into little-endian ABGR Uint32 (matches GL UNSIGNED_BYTE vec4 r,g,b,a). */
84
+ declare function packColorAbgr(rgb: number, alpha: number): number;
85
+ /** Lightweight, allocation-conscious event emitter compatible with Phaser's EventEmitter surface. */
86
+ declare class EventEmitter {
87
+ private readonly map;
88
+ on(event: string, fn: (...args: any[]) => void, ctx?: unknown): this;
89
+ once(event: string, fn: (...args: any[]) => void, ctx?: unknown): this;
90
+ off(event: string, fn?: (...args: any[]) => void, ctx?: unknown): this;
91
+ emit(event: string, ...args: any[]): boolean;
92
+ removeAllListeners(event?: string): this;
93
+ }
94
+ type TextureImageSource = HTMLImageElement | HTMLCanvasElement | ImageBitmap;
95
+ interface SpriteSheetConfig {
96
+ frameWidth: number;
97
+ frameHeight: number;
98
+ margin?: number;
99
+ spacing?: number;
100
+ }
101
+ /** Frame-space socket tuple: `[x, y]` or oriented `[x, y, angleRad, zBias]` (`zBias = +1` front, `-1` behind). */
102
+ type FrameAnchorTuple = readonly [number, number] | readonly [number, number, number, number];
103
+ interface FrameExtraMeta {
104
+ /** Exact pixel pivot X from trimmed frame top-left `(0, 0)` (takes precedence over `pivotX` to avoid float drift). */
105
+ ax?: number;
106
+ /** Exact pixel pivot Y from trimmed frame top-left `(0, 0)` (takes precedence over `pivotY` to avoid float drift). */
107
+ ay?: number;
108
+ /** Normalized horizontal pivot `[0..1]` relative to `width`. */
109
+ pivotX?: number;
110
+ /** Normalized vertical pivot `[0..1]` relative to `height`. */
111
+ pivotY?: number;
112
+ /** Named frame-local pixel sockets relative to trimmed top-left `(0, 0)`: `[x, y]` or oriented `[x, y, angleRad, zBias]`. */
113
+ anchors?: Readonly<Record<string, FrameAnchorTuple>>;
114
+ /** Self-lit emissive centroid `[x, y]` in frame-local pixels (from `@holtjs/craft/three`). */
115
+ emissiveCenter?: readonly [number, number];
116
+ /** Normalized emissive coverage/intensity `[0..1]`. */
117
+ emissivePower?: number;
118
+ /** Optional character/actor identifier from offline baker metadata (e.g. `'chars/survivor'` or `'survivor'`). */
119
+ char?: string;
120
+ actor?: string;
121
+ /** Optional animation clip name from offline baker metadata (e.g. `'walk'`, `'idle'`, `'attack'`). */
122
+ clip?: string;
123
+ /** Optional discrete direction index (`0 .. dirs - 1`) or label (`'down'`, `'right'`, ...). */
124
+ dir?: number | string;
125
+ /** Optional 0-based animation frame index within `(char, clip, dir)`. */
126
+ frame?: number;
127
+ /** Optional total frame count in `(char, clip, dir)`. */
128
+ frames?: number;
129
+ /** Optional loop hint from offline baker (`true` for locomotion/idle, `false` for one-shot actions). */
130
+ loop?: boolean;
131
+ }
132
+ interface AtlasJsonLike {
133
+ readonly yaw?: number;
134
+ readonly pitch?: number;
135
+ readonly scale?: number;
136
+ readonly frames?: Record<string, any> | ReadonlyArray<any>;
137
+ readonly json?: {
138
+ readonly yaw?: number;
139
+ readonly pitch?: number;
140
+ readonly scale?: number;
141
+ readonly frames?: Record<string, any> | ReadonlyArray<any>;
142
+ };
143
+ }
144
+ interface TextureImageOptions {
145
+ filterMode?: FilterModeValue;
146
+ /** Default `true` for standard premultiplied sprites; set `false` for raw data textures such as MTSDF atlases. */
147
+ premultiplyAlpha?: boolean;
148
+ /** Internal flag for offscreen FBO render targets whose GPU storage is allocated via 9-arg `texImage2D(..., null)`. */
149
+ isRenderTarget?: boolean;
150
+ }
151
+ interface GlTextureHost {
152
+ readonly gl: WebGL2RenderingContext | WebGLRenderingContext | null;
153
+ readonly contextLost: boolean;
154
+ uploadTextureSource(src: TextureSource): void;
155
+ deleteTextureSource(src: TextureSource): void;
156
+ setTextureFilter(src: TextureSource): void;
157
+ }
158
+ declare class TextureSource {
159
+ private static nextId;
160
+ readonly id: number;
161
+ version: number;
162
+ readonly texture: Texture;
163
+ image: TextureImageSource;
164
+ width: number;
165
+ height: number;
166
+ resolution: number;
167
+ filterMode: FilterModeValue;
168
+ premultiplyAlpha: boolean;
169
+ glPremultiplyAlpha: boolean;
170
+ repeat: boolean;
171
+ glRepeat: boolean;
172
+ glTexture: WebGLTexture | null;
173
+ glWidth: number;
174
+ glHeight: number;
175
+ dirty: boolean;
176
+ readonly isRenderTarget: boolean;
177
+ private host;
178
+ constructor(texture: Texture, image: TextureImageSource, filterMode: FilterModeValue, host: GlTextureHost | null, premultiplyAlpha?: boolean, isRenderTarget?: boolean);
179
+ setFilter(mode: FilterModeValue): void;
180
+ setPremultiplyAlpha(on: boolean): void;
181
+ update(): void;
182
+ destroy(): void;
183
+ }
184
+ declare class Frame {
185
+ readonly texture: Texture;
186
+ readonly name: string | number;
187
+ readonly sourceIndex: number;
188
+ readonly source: TextureSource;
189
+ cutX: number;
190
+ cutY: number;
191
+ cutWidth: number;
192
+ cutHeight: number;
193
+ width: number;
194
+ height: number;
195
+ u0: number;
196
+ v0: number;
197
+ u1: number;
198
+ v1: number;
199
+ /** True when the atlas/baker specified an explicit per-frame pivot (`ax/ay` or `pivotX/pivotY`). */
200
+ customPivot: boolean;
201
+ pivotX: number;
202
+ pivotY: number;
203
+ pixelPivotX: number;
204
+ pixelPivotY: number;
205
+ /** Named frame-space pixel sockets relative to trimmed `(0, 0)`: `[x, y]` or oriented `[x, y, angleRad, zBias]`. */
206
+ anchors: Record<string, FrameAnchorTuple> | null;
207
+ emissiveCenter: readonly [number, number] | null;
208
+ emissivePower: number;
209
+ actor: string | null;
210
+ clip: string | null;
211
+ dir: number | string | null;
212
+ animFrameIndex: number | null;
213
+ animLoop: boolean | undefined;
214
+ constructor(texture: Texture, name: string | number, sourceIndex: number, x: number, y: number, w: number, h: number, meta?: FrameExtraMeta);
215
+ setSize(width: number, height: number, x?: number, y?: number): this;
216
+ /** Set normalized `[0..1]` per-frame pivot (marks `customPivot = true`). */
217
+ setPivot(pivotX: number, pivotY: number): this;
218
+ /** Set exact pixel pivot `(ax, ay)` from trimmed frame top-left `(0, 0)` (avoids float rounding drift). */
219
+ setPixelPivot(ax: number, ay: number): this;
220
+ /** Attach or update a named pixel socket `(x, y)` (with optional projected `angleRad` & front/back `zBias`). */
221
+ setAnchor(name: string, x: number, y: number, angleRad?: number, zBias?: number): this;
222
+ /** Read a named pixel socket `[x, y]` or `[x, y, angleRad, zBias]` (falls back to `emissiveCenter` when `name === 'emissive'`). */
223
+ getAnchor(name: string): FrameAnchorTuple | null;
224
+ applyMeta(meta: FrameExtraMeta): this;
225
+ updateUVs(): void;
226
+ }
227
+ declare class Texture {
228
+ readonly manager: TextureManager;
229
+ readonly key: string;
230
+ readonly source: TextureSource[];
231
+ readonly frames: Record<string, Frame>;
232
+ /** Optional isometric camera azimuth (`yaw` in radians, e.g. `Math.PI / 4` from `@holtjs/craft/three`) used by `SpriteObject.playDirectional()`. */
233
+ atlasYaw: number | null;
234
+ atlasPitch: number | null;
235
+ atlasScale: number | null;
236
+ constructor(manager: TextureManager, key: string, image: TextureImageSource, filterMode: FilterModeValue, host: GlTextureHost | null, premultiplyAlpha?: boolean, isRenderTarget?: boolean);
237
+ add(name: string | number, sourceIndex: number, x: number, y: number, width: number, height: number, meta?: FrameExtraMeta): Frame;
238
+ has(name: string | number): boolean;
239
+ get(name?: string | number): Frame;
240
+ remove(name: string | number): boolean;
241
+ setFilter(mode: FilterModeValue): this;
242
+ setPremultiplyAlpha(on: boolean): this;
243
+ getSourceImage(sourceIndex?: number): TextureImageSource;
244
+ destroy(): void;
245
+ }
246
+ declare class CanvasTexture extends Texture {
247
+ readonly canvas: HTMLCanvasElement;
248
+ readonly context: CanvasRenderingContext2D;
249
+ constructor(manager: TextureManager, key: string, canvas: HTMLCanvasElement, filterMode: FilterModeValue, host: GlTextureHost | null);
250
+ getContext(): CanvasRenderingContext2D;
251
+ refresh(): this;
252
+ }
253
+ declare class TextureManager {
254
+ readonly list: Record<string, Texture>;
255
+ private defaultFilter;
256
+ private host;
257
+ private readonly doc;
258
+ constructor(pixelArt: boolean, host: GlTextureHost | null, doc?: Document);
259
+ private initBuiltins;
260
+ exists(key: string): boolean;
261
+ get(key: string): Texture;
262
+ addImage(key: string, source: TextureImageSource, options?: TextureImageOptions): Texture | null;
263
+ addCanvas(key: string, canvas: HTMLCanvasElement): CanvasTexture | null;
264
+ createCanvas(key: string, width: number, height: number): CanvasTexture | null;
265
+ addSpriteSheet(key: string, source: TextureImageSource, config: SpriteSheetConfig): Texture | null;
266
+ /**
267
+ * Register a packed sprite atlas (`@holtjs/craft/three`, `@holtjs/craft/atlas`, or TexturePacker / Aseprite JSON Hash & Array)
268
+ * preserving per-frame trimmed pivots (`ax/ay` or `pivot`), named sockets (`anchors`), `emissiveCenter`, and `atlasYaw`!
269
+ */
270
+ addAtlas(key: string, source: TextureImageSource, atlasData: AtlasJsonLike, options?: TextureImageOptions): Texture | null;
271
+ remove(key: string): boolean;
272
+ invalidateAllGl(): void;
273
+ destroy(): void;
274
+ }
275
+ interface AnimationFrameInput {
276
+ readonly key?: string;
277
+ readonly frame: string | number;
278
+ /** Optional explicit duration override for this specific frame in milliseconds. */
279
+ readonly duration?: number;
280
+ /** Optional event(s) emitted immediately when playback enters or crosses this frame. */
281
+ readonly events?: string | readonly string[];
282
+ }
283
+ interface CompiledAnimationFrame {
284
+ readonly index: number;
285
+ readonly textureKey: string;
286
+ readonly frameName: string | number;
287
+ readonly durationMs: number;
288
+ /** Cumulative start timestamp in ms within one forward pass `[0 .. totalDurationMs)`. */
289
+ readonly offsetMs: number;
290
+ readonly events: readonly string[];
291
+ }
292
+ interface AnimationConfig {
293
+ readonly key: string;
294
+ readonly frames: ReadonlyArray<AnimationFrameInput>;
295
+ /** Default texture key when individual frame entries omit `key`. */
296
+ readonly defaultTextureKey?: string;
297
+ /** Frames per second (default `10` unless `duration` is specified). */
298
+ readonly frameRate?: number;
299
+ /** Total forward pass duration in milliseconds (used when `frameRate` is omitted). */
300
+ readonly duration?: number;
301
+ /** Number of repeats (`-1` = infinite loop, `0` = play once, `N > 0` = play `1 + N` times; default `0`). */
302
+ readonly repeat?: number;
303
+ /** Ping-pong back from last frame to frame 0 before completing/repeating (default `false`). */
304
+ readonly yoyo?: boolean;
305
+ /** Declarative map from 0-based frame index to event name(s), e.g. `{ 1: 'footstep', 4: 'footstep' }`. */
306
+ readonly events?: Readonly<Record<number, string | readonly string[]>>;
307
+ }
308
+ interface StageAnimation {
309
+ readonly key: string;
310
+ readonly frames: ReadonlyArray<CompiledAnimationFrame>;
311
+ readonly frameRate: number;
312
+ readonly msPerFrame: number;
313
+ readonly totalDurationMs: number;
314
+ readonly repeat: number;
315
+ readonly yoyo: boolean;
316
+ }
317
+ interface GenerateFrameNamesConfig {
318
+ readonly prefix?: string;
319
+ readonly start?: number;
320
+ readonly end?: number;
321
+ readonly suffix?: string;
322
+ readonly zeroPad?: number;
323
+ readonly frames?: ReadonlyArray<string | number>;
324
+ }
325
+ interface GenerateFrameNumbersConfig {
326
+ readonly start?: number;
327
+ readonly end?: number;
328
+ readonly frames?: readonly number[];
329
+ }
330
+ interface AtlasClipRule {
331
+ readonly frameRate?: number;
332
+ readonly duration?: number;
333
+ /** `-1` for loop, `0` for one-shot, `N > 0` for N repeats. */
334
+ readonly repeat?: number;
335
+ readonly yoyo?: boolean;
336
+ /** Frame-index -> event name(s), e.g. `{ 1: 'footstep', 4: 'footstep' }`. */
337
+ readonly events?: Readonly<Record<number, string | readonly string[]>>;
338
+ }
339
+ interface AtlasAutoAnimOptions {
340
+ /** Default playback rate in Hz when a clip rule omits `frameRate` (default `10`). */
341
+ readonly defaultFrameRate?: number;
342
+ /** Default `repeat` when neither clip rule nor baker `frame.animLoop` specifies loop behavior (`undefined` infers `-1` for idle/walk/run/move/fly/swim/burn, `0` otherwise). */
343
+ readonly defaultRepeat?: number;
344
+ /** Per-clip or per-`actor/clip` overrides, e.g. `{ walk: { frameRate: 10, events: { 1: 'footstep', 4: 'footstep' } } }`. */
345
+ readonly clips?: Readonly<Record<string, AtlasClipRule>>;
346
+ }
347
+ interface DirectionalAnimGroup {
348
+ readonly baseKey: string;
349
+ readonly actor: string;
350
+ readonly clip: string;
351
+ readonly textureKey: string;
352
+ /** Ordered animation clips for discrete directions `0 .. directions - 1`. */
353
+ readonly dirClips: ReadonlyArray<StageAnimation>;
354
+ readonly directions: number;
355
+ /** Isometric camera yaw baked into the atlas (`Math.PI / 4` for `craft/three` & `craft/hd3d`, `0` for cardinal sheets). */
356
+ readonly atlasYaw: number;
357
+ }
358
+ declare class AnimationManager {
359
+ private readonly textures;
360
+ private readonly anims;
361
+ private readonly aliases;
362
+ private readonly dirGroups;
363
+ constructor(textures: TextureManager);
364
+ exists(key: string): boolean;
365
+ get(key: string): StageAnimation | null;
366
+ /** Resolve an animation by key or throw a fail-fast diagnostic listing valid animations. */
367
+ resolveOrThrow(key: string | StageAnimation): StageAnimation;
368
+ getDirectionalGroup(baseKey: string): DirectionalAnimGroup | null;
369
+ /** Resolve a directional clip group (`'survivor/walk'` or `'survivor_walk'`) or throw a fail-fast diagnostic. */
370
+ resolveDirectionalOrThrow(baseKey: string): DirectionalAnimGroup;
371
+ listKeys(): string[];
372
+ listDirectionalGroups(): string[];
373
+ create(config: AnimationConfig): StageAnimation;
374
+ /** Register an alias key pointing to an existing `StageAnimation` (does not overwrite explicit primary keys). */
375
+ registerAlias(aliasKey: string, target: StageAnimation): void;
376
+ /** Register a directional animation group (and optional alias keys such as bare `'survivor/walk'` & `'survivor_walk'`). */
377
+ registerDirectionalGroup(group: DirectionalAnimGroup, aliases?: readonly string[]): void;
378
+ remove(key: string): boolean;
379
+ clear(): void;
380
+ generateFrameNames(textureKey: string, config?: GenerateFrameNamesConfig): AnimationFrameInput[];
381
+ generateFrameNumbers(textureKey: string, config?: GenerateFrameNumbersConfig): AnimationFrameInput[];
382
+ /**
383
+ * Auto-discover and compile all animations (both 4/8-directional character clips and non-directional prop strips)
384
+ * directly from an atlas texture registered via `textures.addAtlas` or `registerThreeAtlasOnStage`!
385
+ *
386
+ * Automatically registers bare actor aliases (e.g. `chars/survivor` -> `survivor/walk` AND `survivor_walk`)
387
+ * whenever the basename is unambiguous across the atlas, eliminating manual frame-table indexing bugs.
388
+ */
389
+ createFromAtlas(textureKey: string, options?: AtlasAutoAnimOptions): StageAnimation[];
390
+ }
391
+ export { FilterModeValue as A, WEBGL as B, AUTO as C, CANVAS as D, BlendModes as E, Scale as F, packColorAbgr as G, WHITE_RGB as H, ScaleMode as I, parseColor as K, Scenes as L, Matrix2D as M, Rect2D as N, EventEmitter as O, RgbaColor as P, TintMode as R, TextureSource as S, BlendMode as T, WorldView2D as U, WEBGPU as V, createMatrix2D as W, SpriteSheetConfig as _, AtlasClipRule as a, TextureImageSource as b, GenerateFrameNamesConfig as c, AtlasJsonLike as d, CanvasTexture as f, GlTextureHost as g, FrameExtraMeta as h, AtlasAutoAnimOptions as i, HEX_MASK as j, FilterMode as k, GenerateFrameNumbersConfig as l, FrameAnchorTuple as m, AnimationFrameInput as n, CompiledAnimationFrame as o, Frame as p, rgbToCss as q, AnimationManager as r, DirectionalAnimGroup as s, AnimationConfig as t, StageAnimation as u, Texture as v, BLACK_RGB as w, TextureManager as x, TextureImageOptions as y, TintModes as z };
@@ -0,0 +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-ClNi6zZQ.js";
2
+ export { AnimationConfig, AnimationFrameInput, AnimationManager, AtlasAutoAnimOptions, AtlasClipRule, CompiledAnimationFrame, DirectionalAnimGroup, GenerateFrameNamesConfig, GenerateFrameNumbersConfig, StageAnimation };