@ignifx/editor-host 0.16.0 → 0.17.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/dist/index.d.ts +41 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +275 -79
- package/dist/index.js.map +1 -1
- package/dist/sprite-game-view.js +132 -0
- package/dist/sprite-game-view.js.map +1 -0
- package/package.json +10 -10
- package/skills/editor-host/SKILL.md +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -301,9 +301,9 @@ export type HostKind = (typeof HostKind)[keyof typeof HostKind];
|
|
|
301
301
|
* The play controls send `"heartbeat"`, `"playControls"`, `"logRelay"` and `"queryRuntime"`, plus
|
|
302
302
|
* `"screenshot"` when the game has a canvas and `"sendInput"` when it has `app.input`. The scene
|
|
303
303
|
* host sends `"heartbeat"` and whichever of `"gizmos"`, `"screenshot"`, `"viewMode2d"`,
|
|
304
|
-
* `"pick2d"`, `"gameView"`, `"
|
|
305
|
-
* `"spriteAnimation"` it supports; every
|
|
306
|
-
* 0.3 scene host.
|
|
304
|
+
* `"pick2d"`, `"gameView"`, `"gameViewOnDemand"`, `"gameViewSize"`, `"gameView2d"`, `"thumbnails"`,
|
|
305
|
+
* `"grid"`, `"tilemapCells"`, `"editorLines"` and `"spriteAnimation"` it supports; every
|
|
306
|
+
* `SceneMethod` not tied to one of them is required of a 0.3 scene host.
|
|
307
307
|
*
|
|
308
308
|
* @public
|
|
309
309
|
*/
|
|
@@ -364,6 +364,24 @@ export declare const HostCapability: {
|
|
|
364
364
|
* 0.3); without it, the host answers both with `RpcErrorCode.methodNotFound`.
|
|
365
365
|
*/
|
|
366
366
|
readonly gameView: "gameView";
|
|
367
|
+
/**
|
|
368
|
+
* The scene host's `gameViewFrame` renders on demand: it does not wait for an animation frame,
|
|
369
|
+
* which a hidden host (a `visibility: hidden` iframe, a background tab) never gets, so it answers
|
|
370
|
+
* at full rate while hidden. Additive in 0.3; without it, a hidden host answers slowly or not
|
|
371
|
+
* at all.
|
|
372
|
+
*/
|
|
373
|
+
readonly gameViewOnDemand: "gameViewOnDemand";
|
|
374
|
+
/**
|
|
375
|
+
* The scene host's `gameViewFrame` takes `width` and `height`, resizing the view first. Additive
|
|
376
|
+
* in 0.3; without it, send `setGameView` to resize.
|
|
377
|
+
*/
|
|
378
|
+
readonly gameViewSize: "gameViewSize";
|
|
379
|
+
/**
|
|
380
|
+
* The scene host's `gameViewFrame` renders a document whose main camera is a `Camera2D`
|
|
381
|
+
* (`@ignifx/2d`): its sprites through that camera, at the view's size. Additive in 0.3; without
|
|
382
|
+
* it, such a document answers `dataUrl: null`.
|
|
383
|
+
*/
|
|
384
|
+
readonly gameView2d: "gameView2d";
|
|
367
385
|
/**
|
|
368
386
|
* The scene host answers `renderThumbnail`: a model or prefab asset rendered on its own
|
|
369
387
|
* (`RenderViewMethod`). From engine ask E8 (additive in 0.3); without it, the host answers it with
|
|
@@ -1859,9 +1877,10 @@ interface SetTilemapCellsParams {
|
|
|
1859
1877
|
/**
|
|
1860
1878
|
* The tilemap document's asset address, as a `Tilemap`'s `map` reference names it
|
|
1861
1879
|
* (`"levels/level-1.tilemap.json"`). Every `Tilemap` of the open scene loaded from it is written.
|
|
1880
|
+
* At most 256 code units.
|
|
1862
1881
|
*/
|
|
1863
1882
|
readonly asset: string;
|
|
1864
|
-
/** The layer: its name in the document, or its index (`0` at the back). */
|
|
1883
|
+
/** The layer: its name in the document (at most 256 code units), or its index (`0` at the back). */
|
|
1865
1884
|
readonly layer: string | number;
|
|
1866
1885
|
/**
|
|
1867
1886
|
* Flat `[index, tile, index, tile, …]` pairs, in the file's order: `index` is row-major with the
|
|
@@ -2537,8 +2556,8 @@ export declare function isSetGridParams(value: unknown): value is SetGridParams;
|
|
|
2537
2556
|
* Checks the parameters of `setTilemapCells`.
|
|
2538
2557
|
*
|
|
2539
2558
|
* @param value - The received `params`.
|
|
2540
|
-
* @returns True for a non-empty `asset
|
|
2541
|
-
* {@link TILEMAP_CELLS_MAX_NUMBERS} non-negative integers.
|
|
2559
|
+
* @returns True for a non-empty `asset` and a layer name or index, each name at most 256 code
|
|
2560
|
+
* units, and an even-length list of at most {@link TILEMAP_CELLS_MAX_NUMBERS} non-negative integers.
|
|
2542
2561
|
*
|
|
2543
2562
|
* @public
|
|
2544
2563
|
*/
|
|
@@ -3173,7 +3192,9 @@ export declare function isSendInputResult(value: unknown): value is SendInputRes
|
|
|
3173
3192
|
* @remarks
|
|
3174
3193
|
* A host lists `HostCapability.gameView` when it answers the first two and
|
|
3175
3194
|
* `HostCapability.thumbnails` when it answers the third; one that does not answers
|
|
3176
|
-
* `RpcErrorCode.methodNotFound`. Additive in 0.3.
|
|
3195
|
+
* `RpcErrorCode.methodNotFound`. Additive in 0.3. `HostCapability.gameViewOnDemand`,
|
|
3196
|
+
* `HostCapability.gameViewSize` and `HostCapability.gameView2d` mark what a newer host's
|
|
3197
|
+
* `gameViewFrame` does beyond that.
|
|
3177
3198
|
*
|
|
3178
3199
|
* @public
|
|
3179
3200
|
*/
|
|
@@ -3184,6 +3205,10 @@ export declare const RenderViewMethod: {
|
|
|
3184
3205
|
* Renders the open scene through its own main camera, the one the game would use, and answers
|
|
3185
3206
|
* the image: {@link GameViewFrameResult}. Fails with `RpcErrorCode.noScene` while no scene is
|
|
3186
3207
|
* open and `RpcErrorCode.invalidRequest` while the game view is off.
|
|
3208
|
+
*
|
|
3209
|
+
* A host with `HostCapability.gameViewOnDemand` answers without waiting for an animation frame
|
|
3210
|
+
* (a hidden host gets none); one with `HostCapability.gameViewSize` takes the image size in the
|
|
3211
|
+
* request; one with `HostCapability.gameView2d` renders a `Camera2D` document camera too.
|
|
3187
3212
|
*/
|
|
3188
3213
|
readonly gameViewFrame: "gameViewFrame";
|
|
3189
3214
|
/** Renders one model or prefab asset on its own and answers the image: {@link ThumbnailResult}. */
|
|
@@ -3258,6 +3283,14 @@ interface GameViewFrameParams {
|
|
|
3258
3283
|
readonly format: ScreenshotFormat;
|
|
3259
3284
|
/** The JPEG quality, from 0 to 1; the host's default (0.9) when absent. Ignored for PNG. */
|
|
3260
3285
|
readonly quality?: number;
|
|
3286
|
+
/**
|
|
3287
|
+
* The image width in pixels, 1 to {@link GAME_VIEW_MAX_SIZE}: the view resizes to it first, as
|
|
3288
|
+
* `setGameView` would, so the frame has the Game panel's aspect. Absent to keep the current one.
|
|
3289
|
+
* Needs `HostCapability.gameViewSize`; an older host ignores it and answers its own size.
|
|
3290
|
+
*/
|
|
3291
|
+
readonly width?: number;
|
|
3292
|
+
/** The image height in pixels, as {@link GameViewFrameParams.width}. */
|
|
3293
|
+
readonly height?: number;
|
|
3261
3294
|
}
|
|
3262
3295
|
/**
|
|
3263
3296
|
* The answer to `gameViewFrame`.
|
|
@@ -3355,7 +3388,7 @@ export declare function isGameViewState(value: unknown): value is GameViewState;
|
|
|
3355
3388
|
* Checks the parameters of `gameViewFrame`.
|
|
3356
3389
|
*
|
|
3357
3390
|
* @param value - The received `params`.
|
|
3358
|
-
* @returns True for a known format
|
|
3391
|
+
* @returns True for a known format, a quality from 0 to 1 and sizes in range when given.
|
|
3359
3392
|
*
|
|
3360
3393
|
* @public
|
|
3361
3394
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/protocol/connect.ts","../src/protocol/rpc.ts","../src/protocol/version.ts","../src/protocol/handshake.ts","../src/protocol/heartbeat.ts","../src/protocol/scene-file.ts","../src/protocol/scene-ops.ts","../src/protocol/scene.ts","../src/protocol/play.ts","../src/protocol/render-views.ts","../src/channel.ts","../src/scene/asset-reload.ts","../src/host.ts","../src/play-controls.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;qBA0Ba;;;;;;;UAQI;;WAEN,aAAa;;;;;;;;;;;wBAYR,uBAAuB,iBAAiB,SAAS;;;;;;;;;;;;qBCpCpD;;;;;;KAOD;;;;;;;;;;qBAWC;;WAEX;;WAEA;;WAEA;;WAE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BAAsB;;;;;;;WAOtB,kCAAkC;;WAElC,mBAAmB;;WAEnB,WAAW;;WAEX,SAAS;;WAET;;;;;;WAMA;;WAEA;;WAEA,gBAAgB;;;;;;;UAQV;;WAEN,KAAK;;WAEL,WAAW;;;;;WAKX,aAAa;;WAEb;;WAEA;;;;;;;;;;;;;;;;;;EAkBT,aAAa,QAAQ,oBAAoB;;EAEzC;;GAEC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqDY,gBAAgB,SAAS,oBAAoB,QAAQ;;;;;;;;UC5H1D;;WAEN;;WAEA;;WAEA;;WAEA,gBAAgB;;;;;;;UAQV;;WAEN;;EAET;;GAEC,OAAO;;;;;;;;UASO;;WAEN;;;;;;;;;EAST,OAAO,KAAK,MAAM;;EAElB;;GAEC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2XM,wBAAwB,KAAK,KAAK,SAAS,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCvE,4BAA4B,SAAS,4BAA4B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/protocol/connect.ts","../src/protocol/rpc.ts","../src/protocol/version.ts","../src/protocol/handshake.ts","../src/protocol/heartbeat.ts","../src/protocol/scene-file.ts","../src/protocol/scene-ops.ts","../src/protocol/scene.ts","../src/protocol/play.ts","../src/protocol/render-views.ts","../src/channel.ts","../src/scene/asset-reload.ts","../src/host.ts","../src/play-controls.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;qBA0Ba;;;;;;;UAQI;;WAEN,aAAa;;;;;;;;;;;wBAYR,uBAAuB,iBAAiB,SAAS;;;;;;;;;;;;qBCpCpD;;;;;;KAOD;;;;;;;;;;qBAWC;;WAEX;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA;;;;;;;;WAQA;;;;;WAKA;;;;;;;YAQU,uBAAuB,2BAA2B;;;;;;UAO7C;;WAEN,MAAM;;WAEN;;WAEA;;;;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AS;;WAET;;;;;;WAMA;;WAEA;;WAEA,gBAAgB;;;;;;;UAQV;;WAEN,KAAK;;WAEL,WAAW;;;;;WAKX,aAAa;;WAEb;;WAEA;;;;;;;;;;;;;;;;;;EAkBT,aAAa,QAAQ,oBAAoB;;EAEzC;;GAEC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqDY,gBAAgB,SAAS,oBAAoB,QAAQ;;;;;;;;UC5H1D;;WAEN;;WAEA;;WAEA;;WAEA,gBAAgB;;;;;;;UAQV;;WAEN;;EAET;;GAEC,OAAO;;;;;;;;UASO;;WAEN;;;;;;;;;EAST,OAAO,KAAK,MAAM;;EAElB;;GAEC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2XM,wBAAwB,KAAK,KAAK,SAAS,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgCvE,4BAA4B,SAAS,4BAA4B"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as isEditorOrigin, t as EditorHostErrorCode } from "./error-codes.js";
|
|
2
|
-
import { Camera, Component, CoreErrorCode, IgnifxError, Light, Phase, SCENE_ASSET_TYPE, SCENE_FILE_FORMAT, SCENE_FORMAT_VERSION, Script, Transform, VERSION, addComponentFromRecord, canonicalizeNumber, clamp, createApp, createFrameSample, createRay, createSceneAsset, decodeProps, decodeValue, degToRad, describeRegisteredSchemas, describeSchemas, describeSettings, encodeProps, encodeValue, instantiateScene, isIgnifxError, loadSceneDependencies, parseOverridePath, serializeEntity, serializeScene, settingsJsonSchema, toJsonSchema, transformSchema, validateSceneFile } from "@ignifx/core";
|
|
2
|
+
import { Camera, Component, CoreErrorCode, IgnifxError, Light, Phase, RENDERING_SETTINGS_SECTION, SCENE_ASSET_TYPE, SCENE_FILE_FORMAT, SCENE_FORMAT_VERSION, Script, Transform, VERSION, addComponentFromRecord, canonicalizeNumber, clamp, createApp, createFrameSample, createRay, createSceneAsset, decodeProps, decodeValue, degToRad, describeRegisteredSchemas, describeSchemas, describeSettings, encodeProps, encodeValue, instanceComponentAt, instanceEntityAt, instantiateScene, isIgnifxError, loadSceneDependencies, parseOverridePath, serializeEntity, serializeScene, settingsJsonSchema, toJsonSchema, transformSchema, validateSceneFile } from "@ignifx/core";
|
|
3
3
|
import { addToScene, attachPositionGizmoToNode, attachRotationGizmoToNode, attachScaleGizmoToNode, createLines, createPositionGizmo, createRotationGizmo, createScaleGizmo, isGizmoDragging, isGizmoInteracting, isGizmoPickPending, onBeforeRender, setPositionGizmoLocalCoordinates, setRotationGizmoLocalCoordinates, setScaleGizmoLocalCoordinates } from "@babylonjs/lite";
|
|
4
4
|
//#region src/protocol/rpc.ts
|
|
5
5
|
/**
|
|
@@ -187,9 +187,9 @@ const HostKind = {
|
|
|
187
187
|
* The play controls send `"heartbeat"`, `"playControls"`, `"logRelay"` and `"queryRuntime"`, plus
|
|
188
188
|
* `"screenshot"` when the game has a canvas and `"sendInput"` when it has `app.input`. The scene
|
|
189
189
|
* host sends `"heartbeat"` and whichever of `"gizmos"`, `"screenshot"`, `"viewMode2d"`,
|
|
190
|
-
* `"pick2d"`, `"gameView"`, `"
|
|
191
|
-
* `"spriteAnimation"` it supports; every
|
|
192
|
-
* 0.3 scene host.
|
|
190
|
+
* `"pick2d"`, `"gameView"`, `"gameViewOnDemand"`, `"gameViewSize"`, `"gameView2d"`, `"thumbnails"`,
|
|
191
|
+
* `"grid"`, `"tilemapCells"`, `"editorLines"` and `"spriteAnimation"` it supports; every
|
|
192
|
+
* `SceneMethod` not tied to one of them is required of a 0.3 scene host.
|
|
193
193
|
*
|
|
194
194
|
* @public
|
|
195
195
|
*/
|
|
@@ -251,6 +251,24 @@ const HostCapability = {
|
|
|
251
251
|
*/
|
|
252
252
|
gameView: "gameView",
|
|
253
253
|
/**
|
|
254
|
+
* The scene host's `gameViewFrame` renders on demand: it does not wait for an animation frame,
|
|
255
|
+
* which a hidden host (a `visibility: hidden` iframe, a background tab) never gets, so it answers
|
|
256
|
+
* at full rate while hidden. Additive in 0.3; without it, a hidden host answers slowly or not
|
|
257
|
+
* at all.
|
|
258
|
+
*/
|
|
259
|
+
gameViewOnDemand: "gameViewOnDemand",
|
|
260
|
+
/**
|
|
261
|
+
* The scene host's `gameViewFrame` takes `width` and `height`, resizing the view first. Additive
|
|
262
|
+
* in 0.3; without it, send `setGameView` to resize.
|
|
263
|
+
*/
|
|
264
|
+
gameViewSize: "gameViewSize",
|
|
265
|
+
/**
|
|
266
|
+
* The scene host's `gameViewFrame` renders a document whose main camera is a `Camera2D`
|
|
267
|
+
* (`@ignifx/2d`): its sprites through that camera, at the view's size. Additive in 0.3; without
|
|
268
|
+
* it, such a document answers `dataUrl: null`.
|
|
269
|
+
*/
|
|
270
|
+
gameView2d: "gameView2d",
|
|
271
|
+
/**
|
|
254
272
|
* The scene host answers `renderThumbnail`: a model or prefab asset rendered on its own
|
|
255
273
|
* (`RenderViewMethod`). From engine ask E8 (additive in 0.3); without it, the host answers it with
|
|
256
274
|
* `RpcErrorCode.methodNotFound`.
|
|
@@ -1349,6 +1367,8 @@ const GRID_MAX_SIZE = 1e3;
|
|
|
1349
1367
|
* @public
|
|
1350
1368
|
*/
|
|
1351
1369
|
const TILEMAP_CELLS_MAX_NUMBERS = 2e6;
|
|
1370
|
+
/** The longest `asset` address and string `layer` of `setTilemapCells`, in UTF-16 code units. */
|
|
1371
|
+
const TILEMAP_CELLS_MAX_NAME_LENGTH = 256;
|
|
1352
1372
|
/**
|
|
1353
1373
|
* The most numbers the `lines` of one `setEditorLines` request may hold: 100 000 segments.
|
|
1354
1374
|
*
|
|
@@ -1701,15 +1721,15 @@ function isSetGridParams(value) {
|
|
|
1701
1721
|
* Checks the parameters of `setTilemapCells`.
|
|
1702
1722
|
*
|
|
1703
1723
|
* @param value - The received `params`.
|
|
1704
|
-
* @returns True for a non-empty `asset
|
|
1705
|
-
* {@link TILEMAP_CELLS_MAX_NUMBERS} non-negative integers.
|
|
1724
|
+
* @returns True for a non-empty `asset` and a layer name or index, each name at most 256 code
|
|
1725
|
+
* units, and an even-length list of at most {@link TILEMAP_CELLS_MAX_NUMBERS} non-negative integers.
|
|
1706
1726
|
*
|
|
1707
1727
|
* @public
|
|
1708
1728
|
*/
|
|
1709
1729
|
function isSetTilemapCellsParams(value) {
|
|
1710
1730
|
if (!isRecord(value)) return false;
|
|
1711
1731
|
const { asset, layer, cells } = value;
|
|
1712
|
-
return isUidString(asset) && (isString(layer) || isCount(layer)) && Array.isArray(cells) && cells.length % 2 === 0 && cells.length <= 2e6 && cells.every((item) => isCount(item));
|
|
1732
|
+
return isUidString(asset) && asset.length <= TILEMAP_CELLS_MAX_NAME_LENGTH && (isString(layer) && layer.length <= TILEMAP_CELLS_MAX_NAME_LENGTH || isCount(layer)) && Array.isArray(cells) && cells.length % 2 === 0 && cells.length <= 2e6 && cells.every((item) => isCount(item));
|
|
1713
1733
|
}
|
|
1714
1734
|
/**
|
|
1715
1735
|
* Checks the result of `setTilemapCells`.
|
|
@@ -1986,7 +2006,9 @@ function isLogParams(value) {
|
|
|
1986
2006
|
* @remarks
|
|
1987
2007
|
* A host lists `HostCapability.gameView` when it answers the first two and
|
|
1988
2008
|
* `HostCapability.thumbnails` when it answers the third; one that does not answers
|
|
1989
|
-
* `RpcErrorCode.methodNotFound`. Additive in 0.3.
|
|
2009
|
+
* `RpcErrorCode.methodNotFound`. Additive in 0.3. `HostCapability.gameViewOnDemand`,
|
|
2010
|
+
* `HostCapability.gameViewSize` and `HostCapability.gameView2d` mark what a newer host's
|
|
2011
|
+
* `gameViewFrame` does beyond that.
|
|
1990
2012
|
*
|
|
1991
2013
|
* @public
|
|
1992
2014
|
*/
|
|
@@ -1997,6 +2019,10 @@ const RenderViewMethod = {
|
|
|
1997
2019
|
* Renders the open scene through its own main camera, the one the game would use, and answers
|
|
1998
2020
|
* the image: {@link GameViewFrameResult}. Fails with `RpcErrorCode.noScene` while no scene is
|
|
1999
2021
|
* open and `RpcErrorCode.invalidRequest` while the game view is off.
|
|
2022
|
+
*
|
|
2023
|
+
* A host with `HostCapability.gameViewOnDemand` answers without waiting for an animation frame
|
|
2024
|
+
* (a hidden host gets none); one with `HostCapability.gameViewSize` takes the image size in the
|
|
2025
|
+
* request; one with `HostCapability.gameView2d` renders a `Camera2D` document camera too.
|
|
2000
2026
|
*/
|
|
2001
2027
|
gameViewFrame: "gameViewFrame",
|
|
2002
2028
|
/** Renders one model or prefab asset on its own and answers the image: {@link ThumbnailResult}. */
|
|
@@ -2084,12 +2110,12 @@ function isGameViewState(value) {
|
|
|
2084
2110
|
* Checks the parameters of `gameViewFrame`.
|
|
2085
2111
|
*
|
|
2086
2112
|
* @param value - The received `params`.
|
|
2087
|
-
* @returns True for a known format
|
|
2113
|
+
* @returns True for a known format, a quality from 0 to 1 and sizes in range when given.
|
|
2088
2114
|
*
|
|
2089
2115
|
* @public
|
|
2090
2116
|
*/
|
|
2091
2117
|
function isGameViewFrameParams(value) {
|
|
2092
|
-
return isRecord(value) && hasImageFormat(value);
|
|
2118
|
+
return isRecord(value) && hasImageFormat(value) && optionalField(value, "width", (width) => isSide(width, 2048)) && optionalField(value, "height", (height) => isSide(height, 2048));
|
|
2093
2119
|
}
|
|
2094
2120
|
/**
|
|
2095
2121
|
* Checks the result of `gameViewFrame`.
|
|
@@ -3260,6 +3286,67 @@ var PlayStatsReader = class {
|
|
|
3260
3286
|
};
|
|
3261
3287
|
}
|
|
3262
3288
|
};
|
|
3289
|
+
//#endregion
|
|
3290
|
+
//#region src/scene/json.ts
|
|
3291
|
+
/**
|
|
3292
|
+
* The uid of a referenced entity or component.
|
|
3293
|
+
*
|
|
3294
|
+
* @param target - The field's value.
|
|
3295
|
+
* @returns Its uid, or `null` for anything without one.
|
|
3296
|
+
*/
|
|
3297
|
+
function uidOf(target) {
|
|
3298
|
+
const uid = typeof target === "object" && target !== null ? Reflect.get(target, "uid") : null;
|
|
3299
|
+
return typeof uid === "string" ? uid : null;
|
|
3300
|
+
}
|
|
3301
|
+
/**
|
|
3302
|
+
* Narrows JSON to an object. `Array.isArray` does not remove a readonly array from the union, so the
|
|
3303
|
+
* discrimination lives here once.
|
|
3304
|
+
*
|
|
3305
|
+
* @param value - The JSON.
|
|
3306
|
+
* @returns The object, or `null` for anything else.
|
|
3307
|
+
*/
|
|
3308
|
+
function asJsonObject(value) {
|
|
3309
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
3310
|
+
return value;
|
|
3311
|
+
}
|
|
3312
|
+
/**
|
|
3313
|
+
* Narrows JSON to an array.
|
|
3314
|
+
*
|
|
3315
|
+
* @param value - The JSON.
|
|
3316
|
+
* @returns The array, or `null`.
|
|
3317
|
+
*/
|
|
3318
|
+
function asJsonArray(value) {
|
|
3319
|
+
return Array.isArray(value) ? value : null;
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* Tells whether JSON references an entity or component of a set.
|
|
3323
|
+
*
|
|
3324
|
+
* @param value - The JSON.
|
|
3325
|
+
* @param entities - The entity uids.
|
|
3326
|
+
* @param components - The component uids.
|
|
3327
|
+
* @returns True when a `$entity` or `$component` names one of them, or is an instance path that
|
|
3328
|
+
* starts at one of the entities.
|
|
3329
|
+
*/
|
|
3330
|
+
function pointsInto(value, entities, components) {
|
|
3331
|
+
const array = asJsonArray(value);
|
|
3332
|
+
if (array !== null) return array.some((item) => pointsInto(item, entities, components));
|
|
3333
|
+
const object = asJsonObject(value);
|
|
3334
|
+
if (object === null) return false;
|
|
3335
|
+
const entity = object["$entity"];
|
|
3336
|
+
const component = object["$component"];
|
|
3337
|
+
return typeof entity === "string" && (entities.has(entity) || entities.has(pathHead(entity))) || typeof component === "string" && (components.has(component) || entities.has(pathHead(component))) || Object.values(object).some((item) => pointsInto(item, entities, components));
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* The first segment of an instance path (`"<instanceRootUid>/<uidInThePrefab>"`), the document
|
|
3341
|
+
* entity the path starts at; a plain uid has none.
|
|
3342
|
+
*
|
|
3343
|
+
* @param uid - A reference's uid or instance path.
|
|
3344
|
+
* @returns The instance root's uid, or `""` for a plain uid.
|
|
3345
|
+
*/
|
|
3346
|
+
function pathHead(uid) {
|
|
3347
|
+
const at = uid.indexOf("/");
|
|
3348
|
+
return at <= 0 ? "" : uid.slice(0, at);
|
|
3349
|
+
}
|
|
3263
3350
|
/**
|
|
3264
3351
|
* Copies a JSON value, so the host's settings never share an object with the editor's message.
|
|
3265
3352
|
*
|
|
@@ -3713,9 +3800,25 @@ var DocumentMirror = class {
|
|
|
3713
3800
|
decoder(built) {
|
|
3714
3801
|
const index = this.index();
|
|
3715
3802
|
const assets = this.#app.assets;
|
|
3803
|
+
const rootOf = (uid) => {
|
|
3804
|
+
const head = pathHead(uid);
|
|
3805
|
+
const root = head === "" ? null : index?.entities.get(head) ?? built?.entity(head) ?? null;
|
|
3806
|
+
return root === null ? null : {
|
|
3807
|
+
root,
|
|
3808
|
+
rest: uid.slice(head.length + 1)
|
|
3809
|
+
};
|
|
3810
|
+
};
|
|
3716
3811
|
return {
|
|
3717
|
-
entity: (uid) =>
|
|
3718
|
-
|
|
3812
|
+
entity: (uid) => {
|
|
3813
|
+
const known = index?.entities.get(uid) ?? built?.entity(uid) ?? null;
|
|
3814
|
+
const path = known === null ? rootOf(uid) : null;
|
|
3815
|
+
return path === null ? known : instanceEntityAt(path.root, path.rest);
|
|
3816
|
+
},
|
|
3817
|
+
component: (uid) => {
|
|
3818
|
+
const known = index?.components.get(uid) ?? built?.component(uid) ?? index?.added.get(uid) ?? null;
|
|
3819
|
+
const path = known === null ? rootOf(uid) : null;
|
|
3820
|
+
return path === null ? known : instanceComponentAt(path.root, path.rest);
|
|
3821
|
+
},
|
|
3719
3822
|
asset: (address, type) => {
|
|
3720
3823
|
const handle = assets.get(address);
|
|
3721
3824
|
return handle !== null && handle.state === "loaded" && (type === null || handle.type === type) ? handle : null;
|
|
@@ -4626,6 +4729,107 @@ function sceneViewMode(app, scene) {
|
|
|
4626
4729
|
const has3D = app.world.components(Camera).some(inScene);
|
|
4627
4730
|
return has2D && !has3D ? ViewMode.twoD : ViewMode.threeD;
|
|
4628
4731
|
}
|
|
4732
|
+
/** The view a screen-space layer keeps: no camera at all. */
|
|
4733
|
+
const IDENTITY_LAYER_VIEW = {
|
|
4734
|
+
x: 0,
|
|
4735
|
+
y: 0,
|
|
4736
|
+
zoom: 1,
|
|
4737
|
+
rotation: 0
|
|
4738
|
+
};
|
|
4739
|
+
/**
|
|
4740
|
+
* The view of a world layer centred on a point, as `@ignifx/2d`'s sync writes it: Lite's
|
|
4741
|
+
* `positionPx` is the layer pixel at the top-left corner, so the centre is moved back by half the
|
|
4742
|
+
* image, turned by the view's rotation.
|
|
4743
|
+
*
|
|
4744
|
+
* @param shot - What the camera shows.
|
|
4745
|
+
* @param widthPx - The image width.
|
|
4746
|
+
* @param heightPx - The image height.
|
|
4747
|
+
* @param pixelsPerUnit - Layer pixels per metre.
|
|
4748
|
+
* @returns The layer's view.
|
|
4749
|
+
*/
|
|
4750
|
+
function centredLayerView(shot, widthPx, heightPx, pixelsPerUnit) {
|
|
4751
|
+
const zoom = shot.zoom === 0 ? 1 : shot.zoom;
|
|
4752
|
+
const halfWidth = widthPx * .5 / zoom;
|
|
4753
|
+
const halfHeight = heightPx * .5 / zoom;
|
|
4754
|
+
const cos = Math.cos(shot.rotation);
|
|
4755
|
+
const sin = Math.sin(shot.rotation);
|
|
4756
|
+
const centreXPx = shot.centreX * pixelsPerUnit;
|
|
4757
|
+
const centreYPx = -shot.centreY * pixelsPerUnit;
|
|
4758
|
+
return {
|
|
4759
|
+
x: centreXPx - halfWidth * cos - halfHeight * sin,
|
|
4760
|
+
y: centreYPx + halfWidth * sin - halfHeight * cos,
|
|
4761
|
+
zoom,
|
|
4762
|
+
rotation: shot.rotation
|
|
4763
|
+
};
|
|
4764
|
+
}
|
|
4765
|
+
/**
|
|
4766
|
+
* What a `Camera2D` shows in an image of a size: its own `resolve` (orthographic size, pixel-perfect
|
|
4767
|
+
* snapping, bounds) run against that size, else `zoom = heightPx / (2 · size · PPU)` at its
|
|
4768
|
+
* position.
|
|
4769
|
+
*
|
|
4770
|
+
* @remarks
|
|
4771
|
+
* `resolve` stores the size it was given on the camera. The scene view draws through the editor's
|
|
4772
|
+
* own `Camera2D`, so the level's camera keeps those values only until a frame draws through it.
|
|
4773
|
+
*
|
|
4774
|
+
* @param camera - The level's camera.
|
|
4775
|
+
* @param widthPx - The image width.
|
|
4776
|
+
* @param heightPx - The image height.
|
|
4777
|
+
* @param pixelsPerUnit - Layer pixels per metre.
|
|
4778
|
+
* @returns The centre, zoom and rotation.
|
|
4779
|
+
*/
|
|
4780
|
+
function camera2DShot(camera, widthPx, heightPx, pixelsPerUnit) {
|
|
4781
|
+
const matrix = camera.entity.transform.worldMatrix;
|
|
4782
|
+
const worldX = matrix[12] ?? 0;
|
|
4783
|
+
const worldY = matrix[13] ?? 0;
|
|
4784
|
+
const rotation = Math.atan2(matrix[1] ?? 0, matrix[0] ?? 1);
|
|
4785
|
+
const resolve = Reflect.get(camera, "resolve");
|
|
4786
|
+
const centre = Reflect.get(camera, "centre");
|
|
4787
|
+
if (typeof resolve === "function") {
|
|
4788
|
+
Reflect.apply(resolve, camera, [
|
|
4789
|
+
worldX,
|
|
4790
|
+
worldY,
|
|
4791
|
+
widthPx,
|
|
4792
|
+
heightPx,
|
|
4793
|
+
pixelsPerUnit
|
|
4794
|
+
]);
|
|
4795
|
+
const zoom = Reflect.get(camera, "zoom");
|
|
4796
|
+
const x = typeof centre === "object" && centre !== null ? Reflect.get(centre, "x") : void 0;
|
|
4797
|
+
const y = typeof centre === "object" && centre !== null ? Reflect.get(centre, "y") : void 0;
|
|
4798
|
+
if (typeof zoom === "number" && typeof x === "number" && typeof y === "number") return {
|
|
4799
|
+
centreX: x,
|
|
4800
|
+
centreY: y,
|
|
4801
|
+
zoom,
|
|
4802
|
+
rotation
|
|
4803
|
+
};
|
|
4804
|
+
}
|
|
4805
|
+
return {
|
|
4806
|
+
centreX: worldX,
|
|
4807
|
+
centreY: worldY,
|
|
4808
|
+
zoom: zoomForSize(camera.orthographicSize > 0 ? camera.orthographicSize : 1, heightPx, pixelsPerUnit),
|
|
4809
|
+
rotation
|
|
4810
|
+
};
|
|
4811
|
+
}
|
|
4812
|
+
/**
|
|
4813
|
+
* The project's sprite layers, in draw order, from `app.twoD.layers`.
|
|
4814
|
+
*
|
|
4815
|
+
* @param app - The app.
|
|
4816
|
+
* @returns The layers, or `null` when the project has no 2D toolkit.
|
|
4817
|
+
*/
|
|
4818
|
+
function twoDLayersOf(app) {
|
|
4819
|
+
const service = Reflect.get(app, "twoD");
|
|
4820
|
+
if (typeof service !== "object" || service === null) return null;
|
|
4821
|
+
const layers = Reflect.get(service, "layers");
|
|
4822
|
+
if (!Array.isArray(layers)) return null;
|
|
4823
|
+
const out = [];
|
|
4824
|
+
for (const entry of layers) {
|
|
4825
|
+
const layer = typeof entry === "object" && entry !== null ? Reflect.get(entry, "layer") : null;
|
|
4826
|
+
if (typeof layer === "object" && layer !== null) out.push({
|
|
4827
|
+
layer,
|
|
4828
|
+
screenSpace: Reflect.get(Object(entry), "screenSpace") === true
|
|
4829
|
+
});
|
|
4830
|
+
}
|
|
4831
|
+
return out;
|
|
4832
|
+
}
|
|
4629
4833
|
//#endregion
|
|
4630
4834
|
//#region src/scene/editor-camera-2d.ts
|
|
4631
4835
|
/**
|
|
@@ -5238,10 +5442,19 @@ async function encodeCapture(capture, size, format, quality) {
|
|
|
5238
5442
|
targetContext.imageSmoothingQuality = "high";
|
|
5239
5443
|
targetContext.drawImage(source, 0, 0, size.width, size.height);
|
|
5240
5444
|
const type = format === "png" ? "image/png" : "image/jpeg";
|
|
5241
|
-
|
|
5445
|
+
return encodeBlob(await target.convertToBlob(format === "png" ? { type } : {
|
|
5242
5446
|
type,
|
|
5243
5447
|
quality
|
|
5244
|
-
});
|
|
5448
|
+
}), type);
|
|
5449
|
+
}
|
|
5450
|
+
/**
|
|
5451
|
+
* Writes an encoded image as a data URL.
|
|
5452
|
+
*
|
|
5453
|
+
* @param blob - The PNG or JPEG bytes.
|
|
5454
|
+
* @param type - `"image/png"` or `"image/jpeg"`.
|
|
5455
|
+
* @returns The data URL.
|
|
5456
|
+
*/
|
|
5457
|
+
async function encodeBlob(blob, type) {
|
|
5245
5458
|
return `data:${type};base64,${toBase64(new Uint8Array(await blob.arrayBuffer()))}`;
|
|
5246
5459
|
}
|
|
5247
5460
|
/**
|
|
@@ -5277,12 +5490,6 @@ async function takeScreenshot(app, params) {
|
|
|
5277
5490
|
height: size.height
|
|
5278
5491
|
};
|
|
5279
5492
|
}
|
|
5280
|
-
//#endregion
|
|
5281
|
-
//#region src/scene/game-view.ts
|
|
5282
|
-
/**
|
|
5283
|
-
* The Game panel's view (engine ask E8): the open scene through its own main camera, rendered into
|
|
5284
|
-
* a render texture beside the editor camera's frame (`setGameView`, `gameViewFrame`).
|
|
5285
|
-
*/
|
|
5286
5493
|
/** The JPEG quality when the request gives none, as for `screenshot`. */
|
|
5287
5494
|
const DEFAULT_JPEG_QUALITY$1 = .9;
|
|
5288
5495
|
/**
|
|
@@ -5334,32 +5541,67 @@ var GameView = class {
|
|
|
5334
5541
|
};
|
|
5335
5542
|
}
|
|
5336
5543
|
/**
|
|
5337
|
-
* `gameViewFrame`: renders the document camera into the texture
|
|
5338
|
-
* as an image.
|
|
5544
|
+
* `gameViewFrame`: renders the document camera, a `Camera` into the texture or a `Camera2D`
|
|
5545
|
+
* through the sprite pass, and answers it as an image.
|
|
5339
5546
|
*
|
|
5340
5547
|
* @param app - The scene view's app.
|
|
5341
5548
|
* @param mirror - The open document.
|
|
5342
|
-
* @param params - `{ format, quality? }`.
|
|
5549
|
+
* @param params - `{ format, quality?, width?, height? }`.
|
|
5343
5550
|
* @returns The image and the camera's document uid, or no image when the document has no camera.
|
|
5344
5551
|
*/
|
|
5345
5552
|
async frame(app, mirror, params) {
|
|
5346
|
-
if (!isGameViewFrameParams(params)) throw new InvalidParamsError("gameViewFrame takes { format: \"png\" | \"jpeg\", quality? }.");
|
|
5553
|
+
if (!isGameViewFrameParams(params)) throw new InvalidParamsError("gameViewFrame takes { format: \"png\" | \"jpeg\", quality?, width?, height? } with sides from 1 to 2048.");
|
|
5554
|
+
if (!this.#enabled || this.#texture === null) throw new RpcFailure(RpcErrorCode.invalidRequest, "The game view is off; send \"setGameView\" with enabled: true first.");
|
|
5555
|
+
if (params.width !== void 0 || params.height !== void 0) this.set(app, {
|
|
5556
|
+
enabled: true,
|
|
5557
|
+
width: params.width ?? this.#width,
|
|
5558
|
+
height: params.height ?? this.#height
|
|
5559
|
+
});
|
|
5347
5560
|
const texture = this.#texture;
|
|
5348
|
-
if (!this.#enabled || texture === null) throw new RpcFailure(RpcErrorCode.invalidRequest, "The game view is off; send \"setGameView\" with enabled: true first.");
|
|
5349
5561
|
const size = {
|
|
5350
5562
|
width: this.#width,
|
|
5351
5563
|
height: this.#height
|
|
5352
5564
|
};
|
|
5565
|
+
const quality = params.quality ?? DEFAULT_JPEG_QUALITY$1;
|
|
5353
5566
|
const camera = documentCamera(app, mirror);
|
|
5354
|
-
if (camera
|
|
5567
|
+
if (camera !== null) {
|
|
5568
|
+
const uid = (mirror.documentEntityOf(camera.entity) ?? camera.entity).uid;
|
|
5569
|
+
await app.renderer.renderToTexture(camera, texture, { maxWaitMs: 20 });
|
|
5570
|
+
return {
|
|
5571
|
+
dataUrl: await encodeCapture(await texture.readPixels(), size, params.format, quality),
|
|
5572
|
+
...size,
|
|
5573
|
+
camera: uid
|
|
5574
|
+
};
|
|
5575
|
+
}
|
|
5576
|
+
const camera2D = levelCamera2D(app, mirror.scene);
|
|
5577
|
+
const layers = twoDLayersOf(app);
|
|
5578
|
+
const twoD = twoDServiceOf(app);
|
|
5579
|
+
if (camera2D === null || layers === null || twoD === null) return {
|
|
5355
5580
|
dataUrl: null,
|
|
5356
5581
|
...size,
|
|
5357
5582
|
camera: null
|
|
5358
5583
|
};
|
|
5359
|
-
const uid = (mirror.documentEntityOf(
|
|
5360
|
-
await app.renderer.
|
|
5584
|
+
const uid = (mirror.documentEntityOf(camera2D.entity) ?? camera2D.entity).uid;
|
|
5585
|
+
await app.renderer.nextFrame({ maxWaitMs: 20 });
|
|
5586
|
+
const world = centredLayerView(camera2DShot(camera2D, size.width, size.height, twoD.pixelsPerUnit), size.width, size.height, twoD.pixelsPerUnit);
|
|
5587
|
+
const draws = layers.map(({ layer, screenSpace }) => {
|
|
5588
|
+
const view = screenSpace ? IDENTITY_LAYER_VIEW : world;
|
|
5589
|
+
return {
|
|
5590
|
+
layer,
|
|
5591
|
+
x: view.x,
|
|
5592
|
+
y: view.y,
|
|
5593
|
+
zoom: view.zoom,
|
|
5594
|
+
rotation: view.rotation
|
|
5595
|
+
};
|
|
5596
|
+
});
|
|
5597
|
+
const { renderSpriteGameView } = await import("./sprite-game-view.js");
|
|
5598
|
+
const { clearColor } = app.settings.section(RENDERING_SETTINGS_SECTION);
|
|
5599
|
+
const type = params.format === "png" ? "image/png" : "image/jpeg";
|
|
5361
5600
|
return {
|
|
5362
|
-
dataUrl: await
|
|
5601
|
+
dataUrl: await encodeBlob(await renderSpriteGameView(app.lite.engine, draws, {
|
|
5602
|
+
...size,
|
|
5603
|
+
clear: clearColor
|
|
5604
|
+
}, type, quality), type),
|
|
5363
5605
|
...size,
|
|
5364
5606
|
camera: uid
|
|
5365
5607
|
};
|
|
@@ -5522,55 +5764,6 @@ function screenGridPlacement(view, size) {
|
|
|
5522
5764
|
};
|
|
5523
5765
|
}
|
|
5524
5766
|
//#endregion
|
|
5525
|
-
//#region src/scene/json.ts
|
|
5526
|
-
/**
|
|
5527
|
-
* The uid of a referenced entity or component.
|
|
5528
|
-
*
|
|
5529
|
-
* @param target - The field's value.
|
|
5530
|
-
* @returns Its uid, or `null` for anything without one.
|
|
5531
|
-
*/
|
|
5532
|
-
function uidOf(target) {
|
|
5533
|
-
const uid = typeof target === "object" && target !== null ? Reflect.get(target, "uid") : null;
|
|
5534
|
-
return typeof uid === "string" ? uid : null;
|
|
5535
|
-
}
|
|
5536
|
-
/**
|
|
5537
|
-
* Narrows JSON to an object. `Array.isArray` does not remove a readonly array from the union, so the
|
|
5538
|
-
* discrimination lives here once.
|
|
5539
|
-
*
|
|
5540
|
-
* @param value - The JSON.
|
|
5541
|
-
* @returns The object, or `null` for anything else.
|
|
5542
|
-
*/
|
|
5543
|
-
function asJsonObject(value) {
|
|
5544
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
5545
|
-
return value;
|
|
5546
|
-
}
|
|
5547
|
-
/**
|
|
5548
|
-
* Narrows JSON to an array.
|
|
5549
|
-
*
|
|
5550
|
-
* @param value - The JSON.
|
|
5551
|
-
* @returns The array, or `null`.
|
|
5552
|
-
*/
|
|
5553
|
-
function asJsonArray(value) {
|
|
5554
|
-
return Array.isArray(value) ? value : null;
|
|
5555
|
-
}
|
|
5556
|
-
/**
|
|
5557
|
-
* Tells whether JSON references an entity or component of a set.
|
|
5558
|
-
*
|
|
5559
|
-
* @param value - The JSON.
|
|
5560
|
-
* @param entities - The entity uids.
|
|
5561
|
-
* @param components - The component uids.
|
|
5562
|
-
* @returns True when a `$entity` or `$component` names one of them.
|
|
5563
|
-
*/
|
|
5564
|
-
function pointsInto(value, entities, components) {
|
|
5565
|
-
const array = asJsonArray(value);
|
|
5566
|
-
if (array !== null) return array.some((item) => pointsInto(item, entities, components));
|
|
5567
|
-
const object = asJsonObject(value);
|
|
5568
|
-
if (object === null) return false;
|
|
5569
|
-
const entity = object["$entity"];
|
|
5570
|
-
const component = object["$component"];
|
|
5571
|
-
return typeof entity === "string" && entities.has(entity) || typeof component === "string" && components.has(component) || Object.values(object).some((item) => pointsInto(item, entities, components));
|
|
5572
|
-
}
|
|
5573
|
-
//#endregion
|
|
5574
5767
|
//#region src/scene/held-references.ts
|
|
5575
5768
|
/**
|
|
5576
5769
|
* What instance members outside a subtree that is about to be rebuilt hold in it: the reference
|
|
@@ -6842,7 +7035,7 @@ var ThumbnailRenderer = class {
|
|
|
6842
7035
|
await nextFrame();
|
|
6843
7036
|
const size = params.size ?? 128;
|
|
6844
7037
|
const texture = this.#textureOf(app, size * SUPERSAMPLE);
|
|
6845
|
-
await app.renderer.renderToTexture(camera, texture);
|
|
7038
|
+
await app.renderer.renderToTexture(camera, texture, { maxWaitMs: 20 });
|
|
6846
7039
|
return {
|
|
6847
7040
|
dataUrl: await encodeCapture(await texture.readPixels(), {
|
|
6848
7041
|
width: size,
|
|
@@ -8190,6 +8383,9 @@ async function startEditorHost(options) {
|
|
|
8190
8383
|
HostCapability.logRelay,
|
|
8191
8384
|
HostCapability.hotReloadDefaults,
|
|
8192
8385
|
HostCapability.gameView,
|
|
8386
|
+
HostCapability.gameViewOnDemand,
|
|
8387
|
+
HostCapability.gameViewSize,
|
|
8388
|
+
HostCapability.gameView2d,
|
|
8193
8389
|
...canRenderThumbnails(options) ? [HostCapability.thumbnails] : [],
|
|
8194
8390
|
HostCapability.grid,
|
|
8195
8391
|
HostCapability.tilemapCells,
|