@holtjs/stage 0.10.2 → 0.11.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 +29 -0
- package/dist/{anims-D9N8w6IM.d.ts → anims-BYBzSNXO.d.ts} +8 -0
- package/dist/anims.d.ts +1 -1
- package/dist/coroutine-DLgJumtD.d.ts +73 -0
- package/dist/coroutine.d.ts +2 -0
- package/dist/coroutine.js +322 -0
- package/dist/{display-DU4edtH-.js → display-CuyQc8oE.js} +223 -1
- package/dist/ecs.d.ts +87 -6
- package/dist/ecs.js +172 -6
- package/dist/flex.d.ts +185 -1
- package/dist/flex.js +353 -1
- package/dist/{game-BnozPxF8.js → game-2dS3Qsrn.js} +60 -3
- package/dist/{game-B_hIy548.d.ts → game-COsuqGzC.d.ts} +506 -2
- package/dist/headless.d.ts +77 -2
- package/dist/headless.js +203 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.js +6 -5
- package/dist/joystick.d.ts +1 -1
- package/dist/kernel.d.ts +3 -2
- package/dist/kernel.js +15 -1
- package/dist/lighting.d.ts +1 -1
- package/dist/lighting.js +1 -1
- package/dist/projection.d.ts +1 -1
- package/dist/{renderer-webgpu-CHw-NNh2.js → renderer-webgpu-CHJxmCvR.js} +109 -29
- package/dist/renderer-webgpu.d.ts +1 -1
- package/dist/renderer-webgpu.js +1 -1
- package/dist/rig2d.d.ts +2 -2
- package/dist/tilemap.d.ts +2 -169
- package/dist/tilemap.js +29 -1
- package/dist/trace.d.ts +1 -1
- package/dist/world.d.ts +2 -183
- package/dist/world.js +140 -1
- package/package.json +5 -1
package/dist/headless.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as StagePlugin,
|
|
1
|
+
import { E as StagePlugin, Tt as SceneDigest, f as SceneInput, kt as SceneDigestOptions, n as EngineClockSnapshot, r as Game, u as Scene } from "./game-COsuqGzC.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;
|
|
@@ -93,6 +93,8 @@ export interface HeadlessStage {
|
|
|
93
93
|
digest(options?: SceneDigestOptions): SceneDigest;
|
|
94
94
|
/** Step and stream raw RGBA frames (e.g. into `ffmpeg`) at deterministic `fps`. */
|
|
95
95
|
recordFrames(options: RecordFramesOptions): Promise<EngineClockSnapshot>;
|
|
96
|
+
/** Stream deterministic raw RGBA8888 frames directly into `ffmpeg` (`-f rawvideo -pix_fmt rgba`, zero per-frame PNG/JPEG encode) and optional `.wav` audio. */
|
|
97
|
+
encodeVideo(options: EncodeVideoWithFfmpegOptions): Promise<EncodeVideoResult>;
|
|
96
98
|
/** Destroy the headless stage and release resources. */
|
|
97
99
|
destroy(): void;
|
|
98
100
|
}
|
|
@@ -155,4 +157,77 @@ export interface AudioTimeline {
|
|
|
155
157
|
* Deterministic stereo audio timeline mixer for pairing `@holtjs/stage/audio` procedural foley &
|
|
156
158
|
* chiptune cues with 60 FPS headless video renders. Exports ready-to-mux stereo 16-bit `.wav` bytes.
|
|
157
159
|
*/
|
|
158
|
-
export declare function createAudioTimeline(options?: AudioTimelineOptions): AudioTimeline;
|
|
160
|
+
export declare function createAudioTimeline(options?: AudioTimelineOptions): AudioTimeline;
|
|
161
|
+
export interface FfmpegRawVideoArgsOptions {
|
|
162
|
+
readonly width: number;
|
|
163
|
+
readonly height: number;
|
|
164
|
+
readonly fps: number;
|
|
165
|
+
readonly outputPath: string;
|
|
166
|
+
/** Optional path to a `.wav` audio file (e.g. written from `AudioTimeline.toWav()`). */
|
|
167
|
+
readonly audioWavPath?: string;
|
|
168
|
+
/** Video codec (default `'libx264'`). */
|
|
169
|
+
readonly videoCodec?: string;
|
|
170
|
+
/** Encoder preset (default `'veryfast'`). */
|
|
171
|
+
readonly preset?: string;
|
|
172
|
+
/** Constant Rate Factor quality `0..51` (default `19`). */
|
|
173
|
+
readonly crf?: number;
|
|
174
|
+
/** Output pixel format for universal player compatibility (default `'yuv420p'`). */
|
|
175
|
+
readonly outputPixelFormat?: string;
|
|
176
|
+
/** Audio codec when `audioWavPath` is supplied (default `'aac'`). */
|
|
177
|
+
readonly audioCodec?: string;
|
|
178
|
+
/** Audio bitrate when `audioWavPath` is supplied (default `'160k'`). */
|
|
179
|
+
readonly audioBitrate?: string;
|
|
180
|
+
/** Extra CLI flags appended before `-movflags +faststart <outputPath>`. */
|
|
181
|
+
readonly extraArgs?: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
export interface EncodeVideoWithFfmpegOptions {
|
|
184
|
+
/** Destination video file path (e.g. `'out.mp4'`). */
|
|
185
|
+
readonly outputPath: string;
|
|
186
|
+
/** Total frames to render (`frames` or `durationMs` required). */
|
|
187
|
+
readonly frames?: number;
|
|
188
|
+
/** Total duration in milliseconds at `stage.fps` (used if `frames` is omitted). */
|
|
189
|
+
readonly durationMs?: number;
|
|
190
|
+
/** Optional `AudioTimeline`, stereo `.wav` `Uint8Array`, or `.wav` file path muxed into the output video. */
|
|
191
|
+
readonly audio?: AudioTimeline | Uint8Array | string;
|
|
192
|
+
/** Custom `ffmpeg` executable path (default `'ffmpeg'`). */
|
|
193
|
+
readonly ffmpegPath?: string;
|
|
194
|
+
/** Video codec (default `'libx264'`). */
|
|
195
|
+
readonly videoCodec?: string;
|
|
196
|
+
/** Encoder preset (default `'veryfast'`). */
|
|
197
|
+
readonly preset?: string;
|
|
198
|
+
/** Constant Rate Factor quality `0..51` (default `19`). */
|
|
199
|
+
readonly crf?: number;
|
|
200
|
+
/** Output pixel format (default `'yuv420p'`). */
|
|
201
|
+
readonly outputPixelFormat?: string;
|
|
202
|
+
/** Audio codec when `audio` is provided (default `'aac'`). */
|
|
203
|
+
readonly audioCodec?: string;
|
|
204
|
+
/** Audio bitrate when `audio` is provided (default `'160k'`). */
|
|
205
|
+
readonly audioBitrate?: string;
|
|
206
|
+
/** Extra CLI flags appended before `-movflags +faststart <outputPath>`. */
|
|
207
|
+
readonly extraArgs?: readonly string[];
|
|
208
|
+
/** Capture a zero-PII `SceneDigest` every N frames (`0` = disabled; default `0`). */
|
|
209
|
+
readonly digestEvery?: number;
|
|
210
|
+
readonly digestOptions?: SceneDigestOptions;
|
|
211
|
+
/** Optional per-frame hook invoked after stepping each frame before piping raw RGBA8888 to `ffmpeg`. */
|
|
212
|
+
readonly onFrame?: (frame: HeadlessRecordedFrame) => void | Promise<void>;
|
|
213
|
+
}
|
|
214
|
+
export interface EncodeVideoResult {
|
|
215
|
+
readonly outputPath: string;
|
|
216
|
+
readonly frames: number;
|
|
217
|
+
readonly width: number;
|
|
218
|
+
readonly height: number;
|
|
219
|
+
readonly fps: number;
|
|
220
|
+
readonly durationMs: number;
|
|
221
|
+
readonly clock: EngineClockSnapshot;
|
|
222
|
+
readonly digests: SceneDigest[];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Build deterministic `ffmpeg` CLI arguments that consume raw `RGBA8888` frames from `stdin` (`pipe:0`),
|
|
226
|
+
* bypassing per-frame PNG/JPEG `image2pipe` CPU encoding overhead (~33 ms/frame saved at 1280x720!).
|
|
227
|
+
*/
|
|
228
|
+
export declare function buildFfmpegRawVideoArgs(options: FfmpegRawVideoArgsOptions): string[];
|
|
229
|
+
/**
|
|
230
|
+
* Step a `HeadlessStage` in Node.js or Bun and stream raw `RGBA8888` frames (`-f rawvideo -pix_fmt rgba`)
|
|
231
|
+
* directly into `ffmpeg` stdin with backpressure handling and optional stereo `.wav` audio muxing.
|
|
232
|
+
*/
|
|
233
|
+
export declare function encodeVideoWithFfmpeg(stage: HeadlessStage, options: EncodeVideoWithFfmpegOptions): Promise<EncodeVideoResult>;
|
package/dist/headless.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./types-CXsCvp1p.js";
|
|
2
|
-
import { n as Game } from "./game-
|
|
2
|
+
import { n as Game } from "./game-2dS3Qsrn.js";
|
|
3
3
|
import { buildSceneDigest } from "./trace.js";
|
|
4
4
|
// src/headless.ts
|
|
5
5
|
function createVirtualDomHost(createCanvas, width, height) {
|
|
@@ -163,24 +163,25 @@ function createHeadlessStage(options) {
|
|
|
163
163
|
const recordFrames = async (recOpts) => {
|
|
164
164
|
const totalFrames = recOpts.frames !== void 0 ? Math.max(1, Math.floor(recOpts.frames)) : Math.max(1, Math.round((recOpts.durationMs ?? 1e3) / 1e3 * fps));
|
|
165
165
|
const digestEvery = Math.max(0, Math.floor(recOpts.digestEvery ?? 0));
|
|
166
|
-
|
|
166
|
+
let sharedRgba = recOpts.reuseFrameBuffer ? new Uint8Array((rootCanvas.width || width) * (rootCanvas.height || height) * 4) : null;
|
|
167
167
|
for (let i = 0; i < totalFrames; i++) {
|
|
168
168
|
if (i > 0 || game.clock.frameSeq === 0) {
|
|
169
169
|
simCursorMs += dt;
|
|
170
170
|
game.step(simCursorMs, dt);
|
|
171
171
|
}
|
|
172
172
|
const snapDigest = digestEvery > 0 && i % digestEvery === 0 ? digest(recOpts.digestOptions) : void 0;
|
|
173
|
+
if (sharedRgba) sharedRgba = toRgbaInto(sharedRgba);
|
|
173
174
|
await recOpts.onFrame({
|
|
174
175
|
index: i,
|
|
175
176
|
frameSeq: game.clock.frameSeq,
|
|
176
177
|
simTimeMs: Math.round(simCursorMs),
|
|
177
|
-
rgba: sharedRgba
|
|
178
|
+
rgba: sharedRgba ?? toRgba(),
|
|
178
179
|
digest: snapDigest
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
return game.clock.snapshot();
|
|
182
183
|
};
|
|
183
|
-
|
|
184
|
+
const self = {
|
|
184
185
|
game,
|
|
185
186
|
scene: primaryScene,
|
|
186
187
|
canvas: rootCanvas,
|
|
@@ -229,8 +230,10 @@ function createHeadlessStage(options) {
|
|
|
229
230
|
toPng,
|
|
230
231
|
digest,
|
|
231
232
|
recordFrames,
|
|
233
|
+
encodeVideo: (encOpts) => encodeVideoWithFfmpeg(self, encOpts),
|
|
232
234
|
destroy: () => game.destroy(false)
|
|
233
235
|
};
|
|
236
|
+
return self;
|
|
234
237
|
}
|
|
235
238
|
/**
|
|
236
239
|
* Step a `HeadlessStage` across target keyframes and composite a single multi-panel
|
|
@@ -373,4 +376,199 @@ function createAudioTimeline(options = {}) {
|
|
|
373
376
|
toWav
|
|
374
377
|
};
|
|
375
378
|
}
|
|
376
|
-
|
|
379
|
+
/**
|
|
380
|
+
* Build deterministic `ffmpeg` CLI arguments that consume raw `RGBA8888` frames from `stdin` (`pipe:0`),
|
|
381
|
+
* bypassing per-frame PNG/JPEG `image2pipe` CPU encoding overhead (~33 ms/frame saved at 1280x720!).
|
|
382
|
+
*/
|
|
383
|
+
function buildFfmpegRawVideoArgs(options) {
|
|
384
|
+
const w = Math.max(1, Math.round(options.width));
|
|
385
|
+
const h = Math.max(1, Math.round(options.height));
|
|
386
|
+
const fps = Math.max(1, Math.round(options.fps));
|
|
387
|
+
const args = [
|
|
388
|
+
"-y",
|
|
389
|
+
"-f",
|
|
390
|
+
"rawvideo",
|
|
391
|
+
"-pix_fmt",
|
|
392
|
+
"rgba",
|
|
393
|
+
"-s",
|
|
394
|
+
`${w}x${h}`,
|
|
395
|
+
"-r",
|
|
396
|
+
String(fps),
|
|
397
|
+
"-i",
|
|
398
|
+
"pipe:0"
|
|
399
|
+
];
|
|
400
|
+
if (options.audioWavPath) args.push("-i", options.audioWavPath);
|
|
401
|
+
args.push("-c:v", options.videoCodec ?? "libx264", "-preset", options.preset ?? "veryfast", "-crf", String(options.crf ?? 19), "-pix_fmt", options.outputPixelFormat ?? "yuv420p");
|
|
402
|
+
if (options.audioWavPath) args.push("-c:a", options.audioCodec ?? "aac", "-b:a", options.audioBitrate ?? "160k", "-shortest");
|
|
403
|
+
if (options.extraArgs && options.extraArgs.length > 0) args.push(...options.extraArgs);
|
|
404
|
+
args.push("-movflags", "+faststart", options.outputPath);
|
|
405
|
+
return args;
|
|
406
|
+
}
|
|
407
|
+
const dynamicImportModule = (specifier) => import(
|
|
408
|
+
/* @vite-ignore */
|
|
409
|
+
specifier
|
|
410
|
+
);
|
|
411
|
+
/**
|
|
412
|
+
* Step a `HeadlessStage` in Node.js or Bun and stream raw `RGBA8888` frames (`-f rawvideo -pix_fmt rgba`)
|
|
413
|
+
* directly into `ffmpeg` stdin with backpressure handling and optional stereo `.wav` audio muxing.
|
|
414
|
+
*/
|
|
415
|
+
async function encodeVideoWithFfmpeg(stage, options) {
|
|
416
|
+
const [cp, fs, os, path] = await Promise.all([
|
|
417
|
+
dynamicImportModule("node:child_process"),
|
|
418
|
+
dynamicImportModule("node:fs"),
|
|
419
|
+
dynamicImportModule("node:os"),
|
|
420
|
+
dynamicImportModule("node:path")
|
|
421
|
+
]);
|
|
422
|
+
const totalFrames = options.frames !== void 0 ? Math.max(1, Math.floor(options.frames)) : Math.max(1, Math.round((options.durationMs ?? 1e3) / 1e3 * stage.fps));
|
|
423
|
+
const durationMs = totalFrames / stage.fps * 1e3;
|
|
424
|
+
const cw = stage.canvas.width || stage.width;
|
|
425
|
+
const ch = stage.canvas.height || stage.height;
|
|
426
|
+
let tempWavPath = null;
|
|
427
|
+
let audioWavPath;
|
|
428
|
+
if (typeof options.audio === "string") audioWavPath = options.audio;
|
|
429
|
+
else if (options.audio) {
|
|
430
|
+
const wavBytes = options.audio instanceof Uint8Array ? options.audio : options.audio.toWav(durationMs);
|
|
431
|
+
tempWavPath = path.join(os.tmpdir(), `holt-stage-audio-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.wav`);
|
|
432
|
+
fs.writeFileSync(tempWavPath, wavBytes);
|
|
433
|
+
audioWavPath = tempWavPath;
|
|
434
|
+
}
|
|
435
|
+
const ffArgs = buildFfmpegRawVideoArgs({
|
|
436
|
+
width: cw,
|
|
437
|
+
height: ch,
|
|
438
|
+
fps: stage.fps,
|
|
439
|
+
outputPath: options.outputPath,
|
|
440
|
+
audioWavPath,
|
|
441
|
+
videoCodec: options.videoCodec,
|
|
442
|
+
preset: options.preset,
|
|
443
|
+
crf: options.crf,
|
|
444
|
+
outputPixelFormat: options.outputPixelFormat,
|
|
445
|
+
audioCodec: options.audioCodec,
|
|
446
|
+
audioBitrate: options.audioBitrate,
|
|
447
|
+
extraArgs: options.extraArgs
|
|
448
|
+
});
|
|
449
|
+
const ffmpegBin = options.ffmpegPath ?? "ffmpeg";
|
|
450
|
+
const ff = cp.spawn(ffmpegBin, ffArgs, { stdio: [
|
|
451
|
+
"pipe",
|
|
452
|
+
"ignore",
|
|
453
|
+
"pipe"
|
|
454
|
+
] });
|
|
455
|
+
let stderrLog = "";
|
|
456
|
+
let spawnError = null;
|
|
457
|
+
let stdinError = null;
|
|
458
|
+
let closed = false;
|
|
459
|
+
let closedCode = null;
|
|
460
|
+
ff.stderr.on("data", (chunk) => {
|
|
461
|
+
stderrLog += chunk.toString();
|
|
462
|
+
});
|
|
463
|
+
ff.on("error", (err) => {
|
|
464
|
+
spawnError = err;
|
|
465
|
+
});
|
|
466
|
+
ff.stdin.on("error", (err) => {
|
|
467
|
+
stdinError = err;
|
|
468
|
+
});
|
|
469
|
+
const closePromise = new Promise((resolve) => {
|
|
470
|
+
ff.on("close", (code) => {
|
|
471
|
+
closed = true;
|
|
472
|
+
closedCode = code;
|
|
473
|
+
resolve(code);
|
|
474
|
+
});
|
|
475
|
+
ff.on("error", () => {
|
|
476
|
+
closed = true;
|
|
477
|
+
resolve(null);
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
const digests = [];
|
|
481
|
+
try {
|
|
482
|
+
await new Promise((resolve, reject) => {
|
|
483
|
+
if (spawnError) {
|
|
484
|
+
reject(spawnError);
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
const onSpawn = () => {
|
|
488
|
+
ff.removeListener("error", onErr);
|
|
489
|
+
resolve();
|
|
490
|
+
};
|
|
491
|
+
const onErr = (err) => {
|
|
492
|
+
ff.removeListener("spawn", onSpawn);
|
|
493
|
+
reject(err);
|
|
494
|
+
};
|
|
495
|
+
ff.once("spawn", onSpawn);
|
|
496
|
+
ff.once("error", onErr);
|
|
497
|
+
});
|
|
498
|
+
const waitDrainOrExit = () => new Promise((resolve, reject) => {
|
|
499
|
+
if (spawnError) {
|
|
500
|
+
reject(spawnError);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
if (stdinError) {
|
|
504
|
+
reject(stdinError);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (closed) {
|
|
508
|
+
reject(/* @__PURE__ */ new Error(`encodeVideoWithFfmpeg: ffmpeg exited early with code ${String(closedCode)}:\n${stderrLog}`));
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
const cleanup = () => {
|
|
512
|
+
ff.stdin.removeListener("drain", onDrain);
|
|
513
|
+
ff.stdin.removeListener("error", onPipeErr);
|
|
514
|
+
ff.removeListener("error", onProcErr);
|
|
515
|
+
ff.removeListener("close", onProcClose);
|
|
516
|
+
};
|
|
517
|
+
const onDrain = () => {
|
|
518
|
+
cleanup();
|
|
519
|
+
resolve();
|
|
520
|
+
};
|
|
521
|
+
const onPipeErr = (err) => {
|
|
522
|
+
cleanup();
|
|
523
|
+
reject(err);
|
|
524
|
+
};
|
|
525
|
+
const onProcErr = (err) => {
|
|
526
|
+
cleanup();
|
|
527
|
+
reject(err);
|
|
528
|
+
};
|
|
529
|
+
const onProcClose = (code) => {
|
|
530
|
+
cleanup();
|
|
531
|
+
reject(/* @__PURE__ */ new Error(`encodeVideoWithFfmpeg: ffmpeg exited early with code ${String(code)}:\n${stderrLog}`));
|
|
532
|
+
};
|
|
533
|
+
ff.stdin.once("drain", onDrain);
|
|
534
|
+
ff.stdin.on("error", onPipeErr);
|
|
535
|
+
ff.once("error", onProcErr);
|
|
536
|
+
ff.once("close", onProcClose);
|
|
537
|
+
});
|
|
538
|
+
const clock = await stage.recordFrames({
|
|
539
|
+
frames: totalFrames,
|
|
540
|
+
digestEvery: options.digestEvery,
|
|
541
|
+
digestOptions: options.digestOptions,
|
|
542
|
+
onFrame: async (frame) => {
|
|
543
|
+
if (frame.digest) digests.push(frame.digest);
|
|
544
|
+
if (options.onFrame) await options.onFrame(frame);
|
|
545
|
+
if (spawnError) throw spawnError;
|
|
546
|
+
if (stdinError) throw stdinError;
|
|
547
|
+
if (closed) throw new Error(`encodeVideoWithFfmpeg: ffmpeg exited early with code ${String(closedCode)}:\n${stderrLog}`);
|
|
548
|
+
if (!ff.stdin.write(frame.rgba)) await waitDrainOrExit();
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
ff.stdin.end();
|
|
552
|
+
const exitCode = await closePromise;
|
|
553
|
+
if (spawnError) throw spawnError;
|
|
554
|
+
if (exitCode !== 0) throw new Error(`encodeVideoWithFfmpeg: ffmpeg exited with code ${String(exitCode)}:\n${stderrLog}`);
|
|
555
|
+
return {
|
|
556
|
+
outputPath: options.outputPath,
|
|
557
|
+
frames: totalFrames,
|
|
558
|
+
width: cw,
|
|
559
|
+
height: ch,
|
|
560
|
+
fps: stage.fps,
|
|
561
|
+
durationMs,
|
|
562
|
+
clock,
|
|
563
|
+
digests
|
|
564
|
+
};
|
|
565
|
+
} finally {
|
|
566
|
+
try {
|
|
567
|
+
ff.stdin.end();
|
|
568
|
+
} catch {}
|
|
569
|
+
if (tempWavPath) try {
|
|
570
|
+
fs.rmSync(tempWavPath, { force: true });
|
|
571
|
+
} catch {}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
export { buildFfmpegRawVideoArgs, createAudioTimeline, createHeadlessStage, encodeVideoWithFfmpeg, renderStoryboard };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
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-
|
|
3
|
-
import { FlexAlign, FlexContainerSpec, FlexDir, FlexItemRect, FlexItemSpec, FlexJustify, FlexPadding, FlexResult, WrapContainerSpec, WrapItemRect, WrapItemSpec, WrapJustify, WrapResult, computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
|
|
1
|
+
import { $t as Stage2DCustomImageHandler, A as createInputRecorder, An as RectClipMask, At as SceneDigestOverlayStats, Bn as TextObject, Bt as Pointer, C as RecordedInputEntry, Cn as InstancedColumns, D as TimelineClickOptions, Dn as PanelObject, Dt as SceneDigestEngineSandbox, E as StagePlugin, En as NineSliceObject, Et as SceneDigestActiveFocus, Fn as ShapeBatchStyleDefaults, Ft as buildSceneDigest, Gn as HiDpiConfigureOptions, Gt as WebGpuBootstrapResult, Hn as TileSpriteObject, Ht as RendererWebGpu, In as SpriteAnimEventListener, It as sanitizeTrackToken, Jt as requestWebGpuDevice, Kn as HiDpiScaleLike, Kt as WebGpuCanvasContextLike, Ln as SpriteObject, Lt as InputConfig, M as createInputTimeline, Mn as SceneHostLike, Mt as SceneDigestSurfaceEntry, Nn as ShapeBatchColumns, Nt as SceneDigestSurfaceSource, O as TimelineDragOptions, On as PanelOpenSide, Ot as SceneDigestNode, Pn as ShapeBatchObject, Pt as SceneDigestSurfaces, Qt as RendererStats, Rn as SpritePlayOptions, Rt as InputPlugin, S as InputTimelinePlugin, Sn as InstancedBatchObject, T as StageKernel, Tn as MsdfIconObject, Tt as SceneDigest, Un as Camera, Ut as RendererWebGpuOptions, Vn as TextStyleConfig, Vt as PointerSample, Wn as CameraFollowOptions, Wt as RequestWebGpuOptions, Xt as RendererGl, Yt as Renderer2D, Zt as RendererGlOptions, _ as ActionMap, _n as DrawStreamOptions, a as GameLoop, an as Container, b as InputTargetSpec, bn as Graphics, c as LoaderPlugin, cn as CustomPassObject, d as SceneCtor, dn as DisplayList, en as StageRenderTarget, f as SceneInput, fn as DisplayObject, g as ViewportFitResult, gn as DrawStreamObject, h as StageRenderer, hn as DrawStreamBulkView, i as GameConfig$1, in as Bob$1, j as createInputReplay, jn as RectangleObject, jt as SceneDigestSandbox, k as TimelineKeyOptions, kn as PanelStyleConfig, kt as SceneDigestOptions, l as ScaleManager, ln as CustomPassOptions, m as SceneManager, mn as DisplaySemantics, n as EngineClockSnapshot, nn as BindEquipmentOptions, o as GameObjectFactory, on as ContainerFiltersShim, p as SceneLifecycleStats, pn as DisplayObjectType, qt as WebGpuDeviceLike, r as Game, rn as BlitterObject, s as JsonCache, sn as CustomPassCallback, t as EngineClock, tn as AnchorPose2D, u as Scene, un as DirectionalPlayOptions, v as InputProvider, vn as DrawStreamSpriteOptions, w as StageInputEvent, wn as MsdfIconConfig, x as InputTimelineOptions, xn as ImageObject, y as InputRecorderPlugin, yn as EquipmentBinding, zn as SyncAttachmentOptions, zt as KeyboardPlugin } from "./game-COsuqGzC.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-BYBzSNXO.js";
|
|
3
|
+
import { FlattenedFlexNode, FlattenedFlexTree, FlexAlign, FlexContainerSpec, FlexDir, FlexIconSpec, FlexItemRect, FlexItemSpec, FlexJustify, FlexNodeSpec, FlexPadding, FlexPanelStyle, FlexResult, FlexTextSpec, MountFlexUiOptions, MountedFlexUi, WrapContainerSpec, WrapItemRect, WrapItemSpec, WrapJustify, WrapResult, computeFlexLayout, computeWrapLayout, flattenFlexTree, mountFlexUi, 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
|
+
import { a as ScriptOptions, i as ScriptHandle, o as ScriptScheduler, r as ScriptContext, s as ScriptStats, t as CoroutineGenerator } from "./coroutine-DLgJumtD.js";
|
|
5
6
|
import { JoystickDpad, JoystickDpadOptions, JoystickState, JoystickVector, JoystickViewport, JoystickZone, JoystickZonePredicate, JoystickZoneRect, VirtualJoystick, VirtualJoystickMode, VirtualJoystickOptions, VirtualJoystickStyle, clampJoystickOrigin, computeJoystickVector, isInJoystickZone, pullJoystickOrigin, quantizeJoystickDpad } from "./joystick.js";
|
|
6
7
|
import { SURFACE_BAND, SurfaceBand, SurfaceBandName, SurfaceBarrier, SurfaceCancelContext, SurfaceCancelDispatchResult, SurfaceCancelResult, SurfaceDomEntry, SurfaceFocusContext, SurfaceFocusDispatchResult, SurfaceFocusResult, SurfaceKeyContext, SurfaceKeyDispatchResult, SurfaceKeyResult, SurfaceNodeInfo, SurfaceNodeInput, SurfaceScope, SurfaceTree, computeSurfaceDomZ, createSurfaceTree, resolveSurfacePriority, surfacePriorityToDomZ } from "./surfaces.js";
|
|
7
8
|
export declare class SdfPanelBatcher {
|
|
@@ -331,4 +332,4 @@ export declare const Stage: {
|
|
|
331
332
|
};
|
|
332
333
|
};
|
|
333
334
|
};
|
|
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 };
|
|
335
|
+
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 CoroutineGenerator, type CustomPassCallback, CustomPassObject, type CustomPassOptions, type DirectionalAnimGroup, type DirectionalPlayOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type DrawStreamBulkView, DrawStreamObject, type DrawStreamOptions, type DrawStreamSpriteOptions, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, type EquipmentBinding, EventEmitter, FilterMode, type FilterModeValue, type FlattenedFlexNode, type FlattenedFlexTree, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexIconSpec, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexNodeSpec, type FlexPadding, type FlexPanelStyle, type FlexResult, type FlexTextSpec, 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 MountFlexUiOptions, type MountedFlexUi, 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 ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, 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, flattenFlexTree, isInJoystickZone, mountFlexUi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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-
|
|
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-2dS3Qsrn.js";
|
|
3
3
|
import { AnimationManager } from "./anims.js";
|
|
4
|
-
import { i as Camera, n as requestWebGpuDevice, r as Renderer2D, t as RendererWebGpu } from "./renderer-webgpu-
|
|
5
|
-
import { a as DisplayObject, c as
|
|
4
|
+
import { i as Camera, n as requestWebGpuDevice, r as Renderer2D, t as RendererWebGpu } from "./renderer-webgpu-CHJxmCvR.js";
|
|
5
|
+
import { _ as TileSpriteObject, a as DisplayObject, c as ImageObject, d as NineSliceObject, f as PanelObject, g as TextObject, h as SpriteObject, i as DisplayList, l as InstancedBatchObject, m as ShapeBatchObject, n as Container, o as DrawStreamObject, p as RectangleObject, r as CustomPassObject, s as Graphics, t as BlitterObject, u as MsdfIconObject } from "./display-CuyQc8oE.js";
|
|
6
6
|
import { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline } from "./kernel.js";
|
|
7
7
|
import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
|
|
8
|
-
import { computeFlexLayout, computeWrapLayout, resolvePadding } from "./flex.js";
|
|
8
|
+
import { computeFlexLayout, computeWrapLayout, flattenFlexTree, mountFlexUi, resolvePadding } from "./flex.js";
|
|
9
9
|
import { Easings, TweenManager } from "./tween.js";
|
|
10
|
+
import { ScriptScheduler } from "./coroutine.js";
|
|
10
11
|
import { VirtualJoystick, clampJoystickOrigin, computeJoystickVector, isInJoystickZone, pullJoystickOrigin, quantizeJoystickDpad } from "./joystick.js";
|
|
11
12
|
import { SURFACE_BAND, computeSurfaceDomZ, createSurfaceTree, resolveSurfacePriority, surfacePriorityToDomZ } from "./surfaces.js";
|
|
12
13
|
// src/index.ts
|
|
@@ -50,4 +51,4 @@ const Stage2D = {
|
|
|
50
51
|
Display: { Canvas: { CanvasPool: { enableSmoothing() {} } } }
|
|
51
52
|
};
|
|
52
53
|
const Stage = Stage2D;
|
|
53
|
-
export { AUTO, ActionMap, AnimationManager, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, InstancedBatchObject, JsonCache, KeyboardPlugin, LoaderPlugin, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, RendererWebGpu, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, SdfPanelBatcher, ShapeBatchObject, SpriteObject, Stage, Stage as default, Stage2D, StageKernel, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WEBGPU, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, isInJoystickZone, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
|
54
|
+
export { AUTO, ActionMap, AnimationManager, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, DrawStreamObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, InstancedBatchObject, JsonCache, KeyboardPlugin, LoaderPlugin, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, RendererWebGpu, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, ScriptScheduler, SdfPanelBatcher, ShapeBatchObject, SpriteObject, Stage, Stage as default, Stage2D, StageKernel, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WEBGPU, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, flattenFlexTree, isInJoystickZone, mountFlexUi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
|
package/dist/joystick.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Pointer, Dn as PanelObject, an as Container, u as Scene } from "./game-COsuqGzC.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,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { a as ScriptOptions, i as ScriptHandle, o as ScriptScheduler, r as ScriptContext, s as ScriptStats, t as CoroutineGenerator } from "./coroutine-DLgJumtD.js";
|
|
2
|
+
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-COsuqGzC.js";
|
|
3
|
+
export { ActionMap, type CoroutineGenerator, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, type ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline };
|
package/dist/kernel.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
|
|
2
2
|
import { Easings } from "./tween.js";
|
|
3
|
+
import { ScriptScheduler } from "./coroutine.js";
|
|
3
4
|
// src/kernel.ts
|
|
4
5
|
/** Godot-inspired semantic action map binding logical game verbs (`'jump'`, `'interact'`) to key codes. */
|
|
5
6
|
var ActionMap = class {
|
|
@@ -58,6 +59,7 @@ var StageKernel = class {
|
|
|
58
59
|
providerOrder = [];
|
|
59
60
|
inputListeners = [];
|
|
60
61
|
inputGuard = null;
|
|
62
|
+
boundCatalog = null;
|
|
61
63
|
disposed = false;
|
|
62
64
|
constructor(game) {
|
|
63
65
|
this.game = game;
|
|
@@ -68,6 +70,18 @@ var StageKernel = class {
|
|
|
68
70
|
this.inputGuard = guard;
|
|
69
71
|
return this;
|
|
70
72
|
}
|
|
73
|
+
/** Bind a `WorldCatalogRuntime` so Vite/Bun HMR or AI balance harnesses can hot-reload via `kernel.reloadCatalog()`. */
|
|
74
|
+
bindCatalog(catalogRuntime) {
|
|
75
|
+
this.boundCatalog = catalogRuntime;
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
/** Hot-reload the bound `WorldCatalogRuntime` in-place without resetting live scene/world state! */
|
|
79
|
+
reloadCatalog(nextCatalog) {
|
|
80
|
+
if (!this.boundCatalog) throw new Error("StageKernel.reloadCatalog: no WorldCatalogRuntime bound (call kernel.bindCatalog(runtime) first)");
|
|
81
|
+
const diff = this.boundCatalog.reload(nextCatalog);
|
|
82
|
+
this.game.events.emit("catalogreloaded", diff, this.boundCatalog.catalog);
|
|
83
|
+
return diff;
|
|
84
|
+
}
|
|
71
85
|
/** Subscribe to every normalized `StageInputEvent` flowing through the kernel (used by recorders/mods). */
|
|
72
86
|
onInput(listener) {
|
|
73
87
|
this.inputListeners.push(listener);
|
|
@@ -640,4 +654,4 @@ function createInputReplay(log, id = "stage.input-replay") {
|
|
|
640
654
|
};
|
|
641
655
|
return replay;
|
|
642
656
|
}
|
|
643
|
-
export { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline };
|
|
657
|
+
export { ActionMap, ScriptScheduler, StageKernel, createInputRecorder, createInputReplay, createInputTimeline };
|
package/dist/lighting.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mn as SceneHostLike, an as Container, cn as CustomPassObject, fn as DisplayObject, xn as ImageObject } from "./game-COsuqGzC.js";
|
|
2
2
|
export type DayPhase = 'day' | 'dusk' | 'night';
|
|
3
3
|
export interface DayNightConfig {
|
|
4
4
|
dayLengthMs?: number;
|
package/dist/lighting.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as createMatrix2D, o as FilterMode, r as BlendModes } from "./types-CXsCvp1p.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as InstancedBatchObject } from "./display-CuyQc8oE.js";
|
|
3
3
|
// src/lighting.ts
|
|
4
4
|
function lerpChannel(a, b, t) {
|
|
5
5
|
return Math.round(a + (b - a) * t) & 255;
|
package/dist/projection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mn as SceneHostLike, an as Container, fn as DisplayObject } from "./game-COsuqGzC.js";
|
|
2
2
|
export interface Camera25DConfig {
|
|
3
3
|
viewportWidth: number;
|
|
4
4
|
viewportHeight: number;
|