@holtjs/stage 0.6.0 → 0.7.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 +14 -0
- package/dist/anims-CS0rfUIz.d.ts +389 -0
- package/dist/anims.d.ts +2 -0
- package/dist/anims.js +436 -0
- package/dist/{game-Blm49zGH.d.ts → game-3L9wS-Bv.d.ts} +112 -202
- package/dist/{game-Ds-cn2YI.js → game-BnSWR44q.js} +179 -5
- package/dist/headless.d.ts +5 -1
- package/dist/headless.js +18 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +5 -3
- package/dist/joystick.d.ts +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/lighting.d.ts +1 -1
- package/dist/projection.d.ts +1 -1
- package/dist/{renderer-webgpu-DJVQHR70.js → renderer-webgpu-alSDj9RR.js} +410 -29
- package/dist/renderer-webgpu.d.ts +1 -1
- package/dist/renderer-webgpu.js +1 -1
- package/dist/rig2d.d.ts +2 -1
- package/dist/tilemap.d.ts +14 -3
- package/dist/tilemap.js +84 -10
- package/dist/trace.d.ts +1 -1
- package/dist/trace.js +7 -1
- package/package.json +5 -1
- package/skills/stage/SKILL.md +23 -7
- package/skills/stage/references/subpaths.md +11 -7
|
@@ -1,202 +1,5 @@
|
|
|
1
|
+
import { D as EventEmitter, F as ScaleMode, H as WorldView2D, L as TintMode, M as Rect2D, N as RgbaColor, _ as Texture, b as TextureManager, d as AtlasJsonLike, g as SpriteSheetConfig, h as GlTextureHost, j as Matrix2D, p as Frame, r as AnimationManager, u as StageAnimation, v as TextureImageOptions, w as BlendMode, x as TextureSource } from "./anims-CS0rfUIz.js";
|
|
1
2
|
import { c as TweenManager, u as TweenStats } from "./tween-BiF1FUvc.js";
|
|
2
|
-
declare const AUTO = 0;
|
|
3
|
-
declare const CANVAS = 1;
|
|
4
|
-
declare const WEBGL = 2;
|
|
5
|
-
declare const WEBGPU = 3;
|
|
6
|
-
declare const BlendModes: {
|
|
7
|
-
readonly NORMAL: 0;
|
|
8
|
-
readonly ADD: 1;
|
|
9
|
-
readonly MULTIPLY: 2;
|
|
10
|
-
readonly SCREEN: 3;
|
|
11
|
-
};
|
|
12
|
-
type BlendMode = (typeof BlendModes)[keyof typeof BlendModes];
|
|
13
|
-
declare const TintModes: {
|
|
14
|
-
readonly MULTIPLY: 0;
|
|
15
|
-
readonly FILL: 1;
|
|
16
|
-
};
|
|
17
|
-
type TintMode = (typeof TintModes)[keyof typeof TintModes];
|
|
18
|
-
declare const FilterMode: {
|
|
19
|
-
readonly LINEAR: 0;
|
|
20
|
-
readonly NEAREST: 1;
|
|
21
|
-
};
|
|
22
|
-
type FilterModeValue = (typeof FilterMode)[keyof typeof FilterMode];
|
|
23
|
-
declare const Scale: {
|
|
24
|
-
readonly NONE: 0;
|
|
25
|
-
readonly FIT: 1;
|
|
26
|
-
readonly RESIZE: 2;
|
|
27
|
-
};
|
|
28
|
-
type ScaleMode = (typeof Scale)[keyof typeof Scale];
|
|
29
|
-
declare const Scenes: {
|
|
30
|
-
readonly PENDING: 0;
|
|
31
|
-
readonly INIT: 1;
|
|
32
|
-
readonly START: 2;
|
|
33
|
-
readonly LOADING: 3;
|
|
34
|
-
readonly CREATING: 4;
|
|
35
|
-
readonly RUNNING: 5;
|
|
36
|
-
readonly PAUSED: 6;
|
|
37
|
-
readonly SLEEPING: 7;
|
|
38
|
-
readonly SHUTDOWN: 8;
|
|
39
|
-
readonly DESTROYED: 9;
|
|
40
|
-
};
|
|
41
|
-
/** Canonical neutral white & black integers (kept here once for color-check cleanliness). */
|
|
42
|
-
declare const WHITE_RGB = 16777215;
|
|
43
|
-
declare const BLACK_RGB = 0;
|
|
44
|
-
declare const HEX_MASK = 16777215;
|
|
45
|
-
interface Rect2D {
|
|
46
|
-
x: number;
|
|
47
|
-
y: number;
|
|
48
|
-
width: number;
|
|
49
|
-
height: number;
|
|
50
|
-
left: number;
|
|
51
|
-
right: number;
|
|
52
|
-
top: number;
|
|
53
|
-
bottom: number;
|
|
54
|
-
}
|
|
55
|
-
interface WorldView2D {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
width: number;
|
|
59
|
-
height: number;
|
|
60
|
-
right: number;
|
|
61
|
-
bottom: number;
|
|
62
|
-
}
|
|
63
|
-
interface Matrix2D {
|
|
64
|
-
a: number;
|
|
65
|
-
b: number;
|
|
66
|
-
c: number;
|
|
67
|
-
d: number;
|
|
68
|
-
tx: number;
|
|
69
|
-
ty: number;
|
|
70
|
-
scaleX: number;
|
|
71
|
-
scaleY: number;
|
|
72
|
-
}
|
|
73
|
-
interface RgbaColor {
|
|
74
|
-
r: number;
|
|
75
|
-
g: number;
|
|
76
|
-
b: number;
|
|
77
|
-
a: number;
|
|
78
|
-
}
|
|
79
|
-
declare function createMatrix2D(): Matrix2D;
|
|
80
|
-
/** Parse a CSS hex/rgb(a) string or 0xRRGGBB number into normalized [0..1] RGBA. */
|
|
81
|
-
declare function parseColor(input: string | number | null | undefined, fallbackAlpha?: number): RgbaColor;
|
|
82
|
-
/** Convert 0xRRGGBB + alpha [0..1] into a CSS rgba(...) string. */
|
|
83
|
-
declare function rgbToCss(color: number, alpha?: number): string;
|
|
84
|
-
/** Pack 0xRRGGBB + alpha [0..1] into little-endian ABGR Uint32 (matches GL UNSIGNED_BYTE vec4 r,g,b,a). */
|
|
85
|
-
declare function packColorAbgr(rgb: number, alpha: number): number;
|
|
86
|
-
/** Lightweight, allocation-conscious event emitter compatible with Phaser's EventEmitter surface. */
|
|
87
|
-
declare class EventEmitter {
|
|
88
|
-
private readonly map;
|
|
89
|
-
on(event: string, fn: (...args: any[]) => void, ctx?: unknown): this;
|
|
90
|
-
once(event: string, fn: (...args: any[]) => void, ctx?: unknown): this;
|
|
91
|
-
off(event: string, fn?: (...args: any[]) => void, ctx?: unknown): this;
|
|
92
|
-
emit(event: string, ...args: any[]): boolean;
|
|
93
|
-
removeAllListeners(event?: string): this;
|
|
94
|
-
}
|
|
95
|
-
type TextureImageSource = HTMLImageElement | HTMLCanvasElement | ImageBitmap;
|
|
96
|
-
interface SpriteSheetConfig {
|
|
97
|
-
frameWidth: number;
|
|
98
|
-
frameHeight: number;
|
|
99
|
-
margin?: number;
|
|
100
|
-
spacing?: number;
|
|
101
|
-
}
|
|
102
|
-
interface TextureImageOptions {
|
|
103
|
-
filterMode?: FilterModeValue;
|
|
104
|
-
/** Default `true` for standard premultiplied sprites; set `false` for raw data textures such as MTSDF atlases. */
|
|
105
|
-
premultiplyAlpha?: boolean;
|
|
106
|
-
/** Internal flag for offscreen FBO render targets whose GPU storage is allocated via 9-arg `texImage2D(..., null)`. */
|
|
107
|
-
isRenderTarget?: boolean;
|
|
108
|
-
}
|
|
109
|
-
interface GlTextureHost {
|
|
110
|
-
readonly gl: WebGL2RenderingContext | WebGLRenderingContext | null;
|
|
111
|
-
readonly contextLost: boolean;
|
|
112
|
-
uploadTextureSource(src: TextureSource): void;
|
|
113
|
-
deleteTextureSource(src: TextureSource): void;
|
|
114
|
-
setTextureFilter(src: TextureSource): void;
|
|
115
|
-
}
|
|
116
|
-
declare class TextureSource {
|
|
117
|
-
private static nextId;
|
|
118
|
-
readonly id: number;
|
|
119
|
-
version: number;
|
|
120
|
-
readonly texture: Texture;
|
|
121
|
-
image: TextureImageSource;
|
|
122
|
-
width: number;
|
|
123
|
-
height: number;
|
|
124
|
-
resolution: number;
|
|
125
|
-
filterMode: FilterModeValue;
|
|
126
|
-
premultiplyAlpha: boolean;
|
|
127
|
-
glPremultiplyAlpha: boolean;
|
|
128
|
-
repeat: boolean;
|
|
129
|
-
glRepeat: boolean;
|
|
130
|
-
glTexture: WebGLTexture | null;
|
|
131
|
-
glWidth: number;
|
|
132
|
-
glHeight: number;
|
|
133
|
-
dirty: boolean;
|
|
134
|
-
readonly isRenderTarget: boolean;
|
|
135
|
-
private host;
|
|
136
|
-
constructor(texture: Texture, image: TextureImageSource, filterMode: FilterModeValue, host: GlTextureHost | null, premultiplyAlpha?: boolean, isRenderTarget?: boolean);
|
|
137
|
-
setFilter(mode: FilterModeValue): void;
|
|
138
|
-
setPremultiplyAlpha(on: boolean): void;
|
|
139
|
-
update(): void;
|
|
140
|
-
destroy(): void;
|
|
141
|
-
}
|
|
142
|
-
declare class Frame {
|
|
143
|
-
readonly texture: Texture;
|
|
144
|
-
readonly name: string | number;
|
|
145
|
-
readonly sourceIndex: number;
|
|
146
|
-
readonly source: TextureSource;
|
|
147
|
-
cutX: number;
|
|
148
|
-
cutY: number;
|
|
149
|
-
cutWidth: number;
|
|
150
|
-
cutHeight: number;
|
|
151
|
-
width: number;
|
|
152
|
-
height: number;
|
|
153
|
-
u0: number;
|
|
154
|
-
v0: number;
|
|
155
|
-
u1: number;
|
|
156
|
-
v1: number;
|
|
157
|
-
constructor(texture: Texture, name: string | number, sourceIndex: number, x: number, y: number, w: number, h: number);
|
|
158
|
-
setSize(width: number, height: number, x?: number, y?: number): this;
|
|
159
|
-
updateUVs(): void;
|
|
160
|
-
}
|
|
161
|
-
declare class Texture {
|
|
162
|
-
readonly manager: TextureManager;
|
|
163
|
-
readonly key: string;
|
|
164
|
-
readonly source: TextureSource[];
|
|
165
|
-
readonly frames: Record<string, Frame>;
|
|
166
|
-
constructor(manager: TextureManager, key: string, image: TextureImageSource, filterMode: FilterModeValue, host: GlTextureHost | null, premultiplyAlpha?: boolean, isRenderTarget?: boolean);
|
|
167
|
-
add(name: string | number, sourceIndex: number, x: number, y: number, width: number, height: number): Frame;
|
|
168
|
-
has(name: string | number): boolean;
|
|
169
|
-
get(name?: string | number): Frame;
|
|
170
|
-
remove(name: string | number): boolean;
|
|
171
|
-
setFilter(mode: FilterModeValue): this;
|
|
172
|
-
setPremultiplyAlpha(on: boolean): this;
|
|
173
|
-
getSourceImage(sourceIndex?: number): TextureImageSource;
|
|
174
|
-
destroy(): void;
|
|
175
|
-
}
|
|
176
|
-
declare class CanvasTexture extends Texture {
|
|
177
|
-
readonly canvas: HTMLCanvasElement;
|
|
178
|
-
readonly context: CanvasRenderingContext2D;
|
|
179
|
-
constructor(manager: TextureManager, key: string, canvas: HTMLCanvasElement, filterMode: FilterModeValue, host: GlTextureHost | null);
|
|
180
|
-
getContext(): CanvasRenderingContext2D;
|
|
181
|
-
refresh(): this;
|
|
182
|
-
}
|
|
183
|
-
declare class TextureManager {
|
|
184
|
-
readonly list: Record<string, Texture>;
|
|
185
|
-
private defaultFilter;
|
|
186
|
-
private host;
|
|
187
|
-
private readonly doc;
|
|
188
|
-
constructor(pixelArt: boolean, host: GlTextureHost | null, doc?: Document);
|
|
189
|
-
private initBuiltins;
|
|
190
|
-
exists(key: string): boolean;
|
|
191
|
-
get(key: string): Texture;
|
|
192
|
-
addImage(key: string, source: TextureImageSource, options?: TextureImageOptions): Texture | null;
|
|
193
|
-
addCanvas(key: string, canvas: HTMLCanvasElement): CanvasTexture | null;
|
|
194
|
-
createCanvas(key: string, width: number, height: number): CanvasTexture | null;
|
|
195
|
-
addSpriteSheet(key: string, source: TextureImageSource, config: SpriteSheetConfig): Texture | null;
|
|
196
|
-
remove(key: string): boolean;
|
|
197
|
-
invalidateAllGl(): void;
|
|
198
|
-
destroy(): void;
|
|
199
|
-
}
|
|
200
3
|
interface CameraFollowOptions {
|
|
201
4
|
/** Horizontal smoothing factor in `(0, 1]` (`1` = instant lock; default `1`). */
|
|
202
5
|
lerpX?: number;
|
|
@@ -353,7 +156,7 @@ declare class Camera {
|
|
|
353
156
|
/** Recompute `worldView` and world->canvas `matrixCombined`. */
|
|
354
157
|
syncMetrics(): void;
|
|
355
158
|
}
|
|
356
|
-
type DisplayObjectType = 'Image' | 'NineSlice' | 'TileSprite' | 'Rectangle' | 'Panel' | 'MsdfIcon' | 'Text' | 'Graphics' | 'Blitter' | 'InstancedBatch' | 'ShapeBatch' | 'Container' | 'CustomPass';
|
|
159
|
+
type DisplayObjectType = 'Image' | 'Sprite' | 'NineSlice' | 'TileSprite' | 'Rectangle' | 'Panel' | 'MsdfIcon' | 'Text' | 'Graphics' | 'Blitter' | 'InstancedBatch' | 'ShapeBatch' | 'Container' | 'CustomPass';
|
|
357
160
|
type SceneHostLike = Scene;
|
|
358
161
|
declare class DisplayList {
|
|
359
162
|
readonly list: DisplayObject[];
|
|
@@ -407,7 +210,7 @@ declare abstract class DisplayObject extends EventEmitter {
|
|
|
407
210
|
scrollFactorX: number;
|
|
408
211
|
scrollFactorY: number;
|
|
409
212
|
parentContainer: Container | null;
|
|
410
|
-
|
|
213
|
+
customOrigin: boolean;
|
|
411
214
|
protected _displayOriginX: number;
|
|
412
215
|
protected _displayOriginY: number;
|
|
413
216
|
private disposers;
|
|
@@ -472,15 +275,105 @@ declare class ImageObject extends DisplayObject {
|
|
|
472
275
|
cropW: number;
|
|
473
276
|
cropH: number;
|
|
474
277
|
readonly customRenderNodes: Record<string, any>;
|
|
475
|
-
constructor(scene: SceneHostLike, x: number, y: number, key: string, frame?: string | number);
|
|
278
|
+
constructor(scene: SceneHostLike, x: number, y: number, key: string, frame?: string | number, nodeType?: DisplayObjectType);
|
|
279
|
+
get displayOriginX(): number;
|
|
280
|
+
get displayOriginY(): number;
|
|
281
|
+
protected _syncFrameOrigin(): void;
|
|
282
|
+
/** Clear any manual `setOrigin()` override so per-frame baked pivots (`ax/ay` or `pivotX/pivotY`) drive alignment automatically. */
|
|
283
|
+
useFramePivot(): this;
|
|
476
284
|
setTexture(key: string, frame?: string | number): this;
|
|
477
285
|
setFrame(frame: string | number): this;
|
|
286
|
+
/**
|
|
287
|
+
* Compute the exact transformed coordinates of a named per-frame pixel socket (e.g. `'hand'`, `'head'`, `'emissive'`)
|
|
288
|
+
* accounting for trimmed `displayOrigin`, `flipX`/`flipY`, `scaleX`/`scaleY`, `rotation`, and ancestor `Container`s.
|
|
289
|
+
*/
|
|
290
|
+
getAnchor(name: string, space?: 'local' | 'parent' | 'world', out?: {
|
|
291
|
+
x: number;
|
|
292
|
+
y: number;
|
|
293
|
+
}): {
|
|
294
|
+
x: number;
|
|
295
|
+
y: number;
|
|
296
|
+
} | null;
|
|
478
297
|
setTint(color: number): this;
|
|
479
298
|
setTintMode(mode: TintMode): this;
|
|
480
299
|
clearTint(): this;
|
|
481
300
|
setPixelAA(on?: boolean): this;
|
|
482
301
|
setCrop(x?: number, y?: number, w?: number, h?: number): this;
|
|
483
302
|
}
|
|
303
|
+
interface SpritePlayOptions {
|
|
304
|
+
/** Keep current animation running untouched when already playing the requested key (default `false`, or pass boolean shorthand `sprite.play(key, true)`). */
|
|
305
|
+
readonly ignoreIfPlaying?: boolean;
|
|
306
|
+
/** Zero-based frame index to start on (default `0`). */
|
|
307
|
+
readonly startFrame?: number;
|
|
308
|
+
/** Carry over normalized gait cycle progress `[0..1)` from the currently playing animation so direction turns never reset to frame 0! */
|
|
309
|
+
readonly preservePhase?: boolean;
|
|
310
|
+
/** Playback speed multiplier (default `1`). */
|
|
311
|
+
readonly timeScale?: number;
|
|
312
|
+
/** Optional override for `anim.repeat` (`-1` loop, `0` once, `N > 0` repeats). */
|
|
313
|
+
readonly repeat?: number;
|
|
314
|
+
}
|
|
315
|
+
interface DirectionalPlayOptions {
|
|
316
|
+
/** Active `Camera25D.yaw` in radians so character facing automatically compensates for rotatable 2.5D camera spin (`default = 0`). */
|
|
317
|
+
readonly cameraYaw?: number;
|
|
318
|
+
/** Override baked `atlasYaw` in radians (defaults to `group.atlasYaw`, e.g. `Math.PI / 4` from `@holtjs/craft/three`). */
|
|
319
|
+
readonly atlasYaw?: number;
|
|
320
|
+
/** Preserve walk-cycle phase when switching between directions of the same `baseKey` (default `true`). */
|
|
321
|
+
readonly preservePhase?: boolean;
|
|
322
|
+
/** Playback speed multiplier (default `1`). */
|
|
323
|
+
readonly timeScale?: number;
|
|
324
|
+
/** Optional override for `anim.repeat`. */
|
|
325
|
+
readonly repeat?: number;
|
|
326
|
+
}
|
|
327
|
+
type SpriteAnimEventListener = (eventName: string, animKey: string, frameIndex: number, frameName: string | number) => void;
|
|
328
|
+
/**
|
|
329
|
+
* First-class animated 2D / 2.5D sprite (`scene.add.sprite(x, y, key, frame)`).
|
|
330
|
+
* - Automatically aligns per-frame trimmed pivots (`ax/ay`) & transforms named sockets (`getAnchor('hand')`)
|
|
331
|
+
* - Deterministic simulation-stepped clip playback (`play`, `playDirectional`, `stop`, `pause`, `resume`)
|
|
332
|
+
* - Phase-preserving 4/8-directional locomotion (`playDirectional`) aligned with `Camera25D` & `@holtjs/craft`
|
|
333
|
+
* - Exact frame-crossing event callbacks (`onAnimEvent` for `footstep`, `hit`, etc.)
|
|
334
|
+
*/
|
|
335
|
+
declare class SpriteObject extends ImageObject {
|
|
336
|
+
private _anim;
|
|
337
|
+
private _frameIdx;
|
|
338
|
+
private _frameElapsedMs;
|
|
339
|
+
private _forward;
|
|
340
|
+
private _repeatsLeft;
|
|
341
|
+
private _playing;
|
|
342
|
+
private _paused;
|
|
343
|
+
private _timeScale;
|
|
344
|
+
private _activeDirBase;
|
|
345
|
+
private _activeDirIndex;
|
|
346
|
+
private readonly _animListeners;
|
|
347
|
+
constructor(scene: SceneHostLike, x: number, y: number, key: string, frame?: string | number);
|
|
348
|
+
get currentAnim(): StageAnimation | null;
|
|
349
|
+
get currentAnimKey(): string | null;
|
|
350
|
+
get currentFrameIndex(): number;
|
|
351
|
+
get currentDirection(): number;
|
|
352
|
+
get isPlaying(): boolean;
|
|
353
|
+
get timeScale(): number;
|
|
354
|
+
setTimeScale(scale: number): this;
|
|
355
|
+
onAnimEvent(fn: SpriteAnimEventListener): () => void;
|
|
356
|
+
/** Normalized progress `[0..1)` through the current forward pass of the active animation. */
|
|
357
|
+
get cycleProgress(): number;
|
|
358
|
+
/** Play a registered animation clip by key (or `StageAnimation` object). Fails fast if `key` does not exist! */
|
|
359
|
+
play(keyOrAnim: string | StageAnimation, opts?: SpritePlayOptions | boolean): this;
|
|
360
|
+
/**
|
|
361
|
+
* Play a 4- or 8-directional animation group (e.g. `'survivor/walk'` or `'zombie/attack'`) quantized by
|
|
362
|
+
* world movement angle `headingRad = Math.atan2(vy, vx)` and optional `Camera25D.yaw`!
|
|
363
|
+
*
|
|
364
|
+
* Automatically preserves stride phase when turning between directions of the same clip (`walk/d0 -> walk/d1`)
|
|
365
|
+
* so characters never freeze on frame 0 or stutter mid-step!
|
|
366
|
+
*/
|
|
367
|
+
playDirectional(baseKey: string, headingRad: number, opts?: DirectionalPlayOptions): this;
|
|
368
|
+
pause(): this;
|
|
369
|
+
resume(): this;
|
|
370
|
+
stop(): this;
|
|
371
|
+
/** Internal deterministic simulation step invoked by `Scene._stepAnimations(dt)`. */
|
|
372
|
+
_stepAnim(deltaMs: number): void;
|
|
373
|
+
private _applyAnimFrame;
|
|
374
|
+
private _finishAnim;
|
|
375
|
+
destroy(fromScene?: boolean): void;
|
|
376
|
+
}
|
|
484
377
|
declare class NineSliceObject extends DisplayObject {
|
|
485
378
|
texture: Texture;
|
|
486
379
|
frame: Frame;
|
|
@@ -1127,11 +1020,14 @@ declare class Renderer2D extends EventEmitter {
|
|
|
1127
1020
|
private tintCtx;
|
|
1128
1021
|
private readonly tintCache;
|
|
1129
1022
|
private readonly maskWorldMat;
|
|
1023
|
+
private readonly rootScrollMat;
|
|
1024
|
+
private readonly matPool;
|
|
1130
1025
|
private readonly pathCache;
|
|
1131
1026
|
private curDrawCalls;
|
|
1132
1027
|
private curFlushes;
|
|
1133
1028
|
private curQuads;
|
|
1134
1029
|
private curTris;
|
|
1030
|
+
private curCulled;
|
|
1135
1031
|
private curSdfPanels;
|
|
1136
1032
|
private curMsdfIcons;
|
|
1137
1033
|
private readonly lastStats;
|
|
@@ -1153,6 +1049,8 @@ declare class Renderer2D extends EventEmitter {
|
|
|
1153
1049
|
};
|
|
1154
1050
|
resize(width: number, height: number): void;
|
|
1155
1051
|
private getTintedSource;
|
|
1052
|
+
private isOffscreen;
|
|
1053
|
+
private mulMat;
|
|
1156
1054
|
private renderImage;
|
|
1157
1055
|
private renderNineSlice;
|
|
1158
1056
|
private renderTileSprite;
|
|
@@ -1399,6 +1297,10 @@ interface SceneDigestNode {
|
|
|
1399
1297
|
depth: number;
|
|
1400
1298
|
alpha: number;
|
|
1401
1299
|
bounds: [number, number, number, number];
|
|
1300
|
+
/** Active animation clip key when `type === 'Sprite'` (sanitized token). */
|
|
1301
|
+
anim?: string | null;
|
|
1302
|
+
/** Current texture frame name when `type === 'Sprite'` or `'Image'` (sanitized token). */
|
|
1303
|
+
frame?: string | null;
|
|
1402
1304
|
}
|
|
1403
1305
|
interface SceneDigestOverlayStats {
|
|
1404
1306
|
popovers: number;
|
|
@@ -1784,6 +1686,7 @@ declare class LoaderPlugin extends EventEmitter {
|
|
|
1784
1686
|
setCORS(value: string | null): this;
|
|
1785
1687
|
image(key: string, url: string, options?: TextureImageOptions): this;
|
|
1786
1688
|
spritesheet(key: string, url: string, config: SpriteSheetConfig): this;
|
|
1689
|
+
atlas(key: string, imageUrl: string, atlasData: AtlasJsonLike, options?: TextureImageOptions): this;
|
|
1787
1690
|
get hasQueued(): boolean;
|
|
1788
1691
|
pendingKeys(): string[];
|
|
1789
1692
|
cancel(): void;
|
|
@@ -1803,6 +1706,7 @@ declare class GameObjectFactory {
|
|
|
1803
1706
|
constructor(scene: Scene, addToList: boolean);
|
|
1804
1707
|
private register;
|
|
1805
1708
|
image(x: number, y: number, key: string, frame?: string | number): ImageObject;
|
|
1709
|
+
sprite(x: number, y: number, key: string, frame?: string | number): SpriteObject;
|
|
1806
1710
|
nineslice(x: number, y: number, key: string, frame: string | number | undefined, width: number, height: number, left: number, right: number, top: number, bottom: number): NineSliceObject;
|
|
1807
1711
|
tileSprite(x: number, y: number, width: number, height: number, key: string, frame?: string | number): TileSpriteObject;
|
|
1808
1712
|
rectangle(x: number, y: number, width: number, height: number, fillColor?: number, fillAlpha?: number): RectangleObject;
|
|
@@ -1863,6 +1767,7 @@ declare class Scene {
|
|
|
1863
1767
|
readonly events: EventEmitter;
|
|
1864
1768
|
/** Deterministic EngineClock-driven tween & spring manager (auto-stepped in `Game.step()`). */
|
|
1865
1769
|
readonly tweens: TweenManager;
|
|
1770
|
+
private readonly _animatedSprites;
|
|
1866
1771
|
private _nodesCreated;
|
|
1867
1772
|
private _nodesDestroyed;
|
|
1868
1773
|
private _disposersRan;
|
|
@@ -1883,6 +1788,7 @@ declare class Scene {
|
|
|
1883
1788
|
clock: EngineClock;
|
|
1884
1789
|
renderer: StageRenderer;
|
|
1885
1790
|
textures: TextureManager;
|
|
1791
|
+
anims: AnimationManager;
|
|
1886
1792
|
scale: ScaleManager;
|
|
1887
1793
|
input: InputPlugin;
|
|
1888
1794
|
load: LoaderPlugin;
|
|
@@ -1916,6 +1822,9 @@ declare class Scene {
|
|
|
1916
1822
|
lifecycleStats(): SceneLifecycleStats;
|
|
1917
1823
|
/** Lightweight active/completed/cancelled tween & spring counters for `sceneDigest()` and `perf()`. */
|
|
1918
1824
|
tweenStats(): TweenStats;
|
|
1825
|
+
_registerAnimatedSprite(sprite: SpriteObject): void;
|
|
1826
|
+
_unregisterAnimatedSprite(sprite: SpriteObject): void;
|
|
1827
|
+
_stepAnimations(deltaMs: number): void;
|
|
1919
1828
|
_invalidateTextGl(): void;
|
|
1920
1829
|
_destroy(): void;
|
|
1921
1830
|
}
|
|
@@ -1956,6 +1865,7 @@ declare class Game {
|
|
|
1956
1865
|
readonly canvas: HTMLCanvasElement;
|
|
1957
1866
|
readonly renderer: StageRenderer;
|
|
1958
1867
|
readonly textures: TextureManager;
|
|
1868
|
+
readonly anims: AnimationManager;
|
|
1959
1869
|
readonly scale: ScaleManager;
|
|
1960
1870
|
readonly input: InputPlugin;
|
|
1961
1871
|
readonly cache: {
|
|
@@ -1980,4 +1890,4 @@ declare class Game {
|
|
|
1980
1890
|
step(time: number, delta: number): void;
|
|
1981
1891
|
destroy(removeCanvas?: boolean): void;
|
|
1982
1892
|
}
|
|
1983
|
-
export { WebGpuBootstrapResult as $,
|
|
1893
|
+
export { WebGpuBootstrapResult as $, createInputRecorder as A, PanelStyleConfig as At, SceneDigestSurfaceEntry as B, TextObject as Bt, RecordedInputEntry as C, InstancedBatchObject as Ct, TimelineClickOptions as D, NineSliceObject as Dt, StagePlugin as E, MsdfIconObject as Et, SceneDigestEngineSandbox as F, ShapeBatchObject as Ft, InputConfig as G, HiDpiConfigureOptions as Gt, SceneDigestSurfaces as H, TileSpriteObject as Ht, SceneDigestNode as I, ShapeBatchStyleDefaults as It, Pointer as J, InputPlugin as K, HiDpiScaleLike as Kt, SceneDigestOptions as L, SpriteAnimEventListener as Lt, createInputTimeline as M, RectangleObject as Mt, SceneDigest as N, SceneHostLike as Nt, TimelineDragOptions as O, PanelObject as Ot, SceneDigestActiveFocus as P, ShapeBatchColumns as Pt, RequestWebGpuOptions as Q, SceneDigestOverlayStats as R, SpriteObject as Rt, InputTimelinePlugin as S, ImageObject as St, StageKernel as T, MsdfIconConfig as Tt, buildSceneDigest as U, Camera as Ut, SceneDigestSurfaceSource as V, TextStyleConfig as Vt, sanitizeTrackToken as W, CameraFollowOptions as Wt, RendererWebGpu as X, PointerSample as Y, RendererWebGpuOptions as Z, ActionMap as _, DisplayList as _t, GameLoop as a, RendererGlOptions as at, InputTargetSpec as b, DisplaySemantics as bt, LoaderPlugin as c, StageRenderTarget as ct, SceneCtor as d, Container as dt, WebGpuCanvasContextLike as et, SceneInput as f, ContainerFiltersShim as ft, ViewportFitResult as g, DirectionalPlayOptions as gt, StageRenderer as h, CustomPassOptions as ht, GameConfig as i, RendererGl as it, createInputReplay as j, RectClipMask as jt, TimelineKeyOptions as k, PanelOpenSide as kt, ScaleManager as l, BlitterObject as lt, SceneManager as m, CustomPassObject as mt, EngineClockSnapshot as n, requestWebGpuDevice as nt, GameObjectFactory as o, RendererStats as ot, SceneLifecycleStats as p, CustomPassCallback as pt, KeyboardPlugin as q, Game as r, Renderer2D as rt, JsonCache as s, Stage2DCustomImageHandler as st, EngineClock as t, WebGpuDeviceLike as tt, Scene as u, Bob as ut, InputProvider as v, DisplayObject as vt, StageInputEvent as w, InstancedColumns as wt, InputTimelineOptions as x, Graphics as xt, InputRecorderPlugin as y, DisplayObjectType as yt, SceneDigestSandbox as z, SpritePlayOptions as zt };
|