incanto 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/dist/2d.d.ts +7 -2
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +9 -3
- package/dist/3d.js +3 -3
- package/dist/{audio-player-DkBqRTs4.d.ts → audio-player-VSjk_vG8.d.ts} +1 -1
- package/dist/{behavior-CWhW3oa6.d.ts → behavior-e3kAmPGC.d.ts} +11 -0
- package/dist/{create-game-DkbZCNaV.js → create-game-CEFoFN8d.js} +3 -3
- package/dist/{create-game-B_sW_eiE.js → create-game-X5iRu6pf.js} +3 -3
- package/dist/debug.d.ts +3 -1
- package/dist/debug.js +56 -6
- package/dist/gameplay.d.ts +1 -1
- package/dist/index.d.ts +21 -4
- package/dist/index.js +3 -3
- package/dist/{loader-D2u0fVW2.d.ts → loader-y_X4zYO0.d.ts} +1 -1
- package/dist/net.d.ts +1 -1
- package/dist/{particle-sim-CFkILGwh.js → particle-sim-CrTE7c02.js} +36 -2
- package/dist/{physics-2d-Cgli1aju.js → physics-2d-DmQ540uR.js} +1 -1
- package/dist/{physics-3d-CBAQ12LY.js → physics-3d-CDjuhtt_.js} +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{register-BJCfuuZ2.js → register-ClKnoILk.js} +34 -5
- package/dist/{register-Dd7Juujf.js → register-CscQqB7V.js} +44 -3
- package/dist/test.d.ts +2 -2
- package/dist/test.js +7 -7
- package/editor/assets/{agent8-MciFwn0v.js → agent8-1WJU-yXr.js} +1 -1
- package/editor/assets/{index-mofVSmuA.js → index-DzYFgZbl.js} +81 -81
- package/editor/index.html +1 -1
- package/package.json +1 -1
- package/schemas/scene.schema.json +175 -0
- package/skills/incanto-behaviors-and-scripts.md +25 -0
- package/skills/incanto-node-reference.md +35 -0
- package/skills/incanto-scene-json-authoring.md +19 -0
package/dist/2d.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as JsonObject } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-
|
|
3
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
2
|
+
import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-e3kAmPGC.js";
|
|
3
|
+
import { t as LoadSceneOptions } from "./loader-y_X4zYO0.js";
|
|
4
4
|
import { t as ParticleSim } from "./particle-sim-CwJ5rI_P.js";
|
|
5
5
|
import { Group, Mesh, Object3D, Scene, Texture } from "three";
|
|
6
6
|
import * as RapierNs from "@dimforge/rapier2d-compat";
|
|
@@ -57,6 +57,10 @@ declare class Node2D extends Node {
|
|
|
57
57
|
scale: number[];
|
|
58
58
|
/** Draw order among 2D drawables (higher = on top); matches 3D `renderOrder`. */
|
|
59
59
|
renderOrder: number;
|
|
60
|
+
/** Named draw-order band; `renderOrder` is the fine offset inside it. */
|
|
61
|
+
orderGroup: string;
|
|
62
|
+
/** What three actually sorts by: band base + renderOrder. */
|
|
63
|
+
get effectiveRenderOrder(): number;
|
|
60
64
|
visible: boolean;
|
|
61
65
|
private _object2D;
|
|
62
66
|
/** @internal The backing three object (lazily created). */
|
|
@@ -507,6 +511,7 @@ declare class Label extends Node2D {
|
|
|
507
511
|
* Simulation is deterministic under the engine seed.
|
|
508
512
|
*/
|
|
509
513
|
declare class Particles2D extends Node2D {
|
|
514
|
+
override orderGroup: string;
|
|
510
515
|
static override readonly typeName: string;
|
|
511
516
|
static override readonly signals: readonly string[];
|
|
512
517
|
static override readonly props: PropSchema;
|
package/dist/2d.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
2
|
-
import { a as AssetStore2D, i as syncTree2D, r as Renderer2D, t as createGame2D } from "./create-game-
|
|
3
|
-
import { a as ColorRect2D, c as AnimatedSprite2D, d as Area2D, f as CharacterBody2D, g as Node2D, h as StaticBody2D, i as Label, l as Sprite2D, m as RigidBody2D, n as UILayer, o as CharacterController2D, p as PhysicsBody2D, r as Particles2D, s as Camera2D, t as registerNodes2D, u as Joint2D } from "./register-
|
|
4
|
-
import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-
|
|
2
|
+
import { a as AssetStore2D, i as syncTree2D, r as Renderer2D, t as createGame2D } from "./create-game-X5iRu6pf.js";
|
|
3
|
+
import { a as ColorRect2D, c as AnimatedSprite2D, d as Area2D, f as CharacterBody2D, g as Node2D, h as StaticBody2D, i as Label, l as Sprite2D, m as RigidBody2D, n as UILayer, o as CharacterController2D, p as PhysicsBody2D, r as Particles2D, s as Camera2D, t as registerNodes2D, u as Joint2D } from "./register-ClKnoILk.js";
|
|
4
|
+
import { n as enablePhysics2D, t as Physics2D } from "./physics-2d-DmQ540uR.js";
|
|
5
5
|
//#region src/2d/library-sprite.ts
|
|
6
6
|
/**
|
|
7
7
|
* Turn a library sprite-animation JSON into a scene-ready spritesheet asset
|
package/dist/3d.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { s as JsonObject } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-
|
|
3
|
-
import { t as LoadSceneOptions } from "./loader-
|
|
2
|
+
import { C as RendererStats, S as GameStats, T as Node, b as Scheduler, l as PropSchema, n as BehaviorCtor, v as Engine, w as Scene$1 } from "./behavior-e3kAmPGC.js";
|
|
3
|
+
import { t as LoadSceneOptions } from "./loader-y_X4zYO0.js";
|
|
4
4
|
import { t as ParticleSim } from "./particle-sim-CwJ5rI_P.js";
|
|
5
|
-
import { r as SpatialPose } from "./audio-player-
|
|
5
|
+
import { r as SpatialPose } from "./audio-player-VSjk_vG8.js";
|
|
6
6
|
import { AnimationClip, BufferGeometry, Color, DirectionalLight, InstancedMesh, MeshPhysicalMaterial, Object3D, PerspectiveCamera, Scene, Vector3, WebGLRenderer } from "three";
|
|
7
7
|
import { VRM } from "@pixiv/three-vrm";
|
|
8
8
|
import { Sky } from "three/examples/jsm/objects/Sky.js";
|
|
@@ -152,6 +152,10 @@ declare class Node3D extends Node {
|
|
|
152
152
|
* materials — three sorts the transparent pass by renderOrder, then depth.
|
|
153
153
|
* Pairs with named scene constants (e.g. `{"@const": "UI"}`) for sorting tiers. */
|
|
154
154
|
renderOrder: number;
|
|
155
|
+
/** Named draw-order band; `renderOrder` is the fine offset inside it. */
|
|
156
|
+
orderGroup: string;
|
|
157
|
+
/** What three actually sorts by: band base + renderOrder. */
|
|
158
|
+
get effectiveRenderOrder(): number;
|
|
155
159
|
private _object3D;
|
|
156
160
|
/**
|
|
157
161
|
* @internal Fixed-step render interpolation. A physics body fills these with
|
|
@@ -1291,6 +1295,7 @@ declare class ModelInstance3D extends Node3D {
|
|
|
1291
1295
|
* tilts emission out of the plane too).
|
|
1292
1296
|
*/
|
|
1293
1297
|
declare class Particles3D extends Node3D {
|
|
1298
|
+
override orderGroup: string;
|
|
1294
1299
|
static override readonly typeName: string;
|
|
1295
1300
|
static override readonly signals: readonly string[];
|
|
1296
1301
|
static override readonly props: PropSchema;
|
|
@@ -1486,6 +1491,7 @@ declare function terrainThemeLayers(theme: TerrainTheme, textureBase: string): T
|
|
|
1486
1491
|
* real numbers off `heightAt`.
|
|
1487
1492
|
*/
|
|
1488
1493
|
declare class Terrain3D extends Node3D {
|
|
1494
|
+
override orderGroup: string;
|
|
1489
1495
|
static override readonly typeName: string;
|
|
1490
1496
|
static override readonly props: PropSchema;
|
|
1491
1497
|
/** [width, depth] extent in meters, centered on the node. */
|
package/dist/3d.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-
|
|
2
|
-
import { A as StaticBody3D, C as TERRAIN_THEMES, D as CharacterBody3D, E as Area3D, F as keyboardIntensity, I as movementState, L as rigPose, N as QUARTER_PITCH, O as PhysicsBody3D, P as cameraRelative, S as DEFAULT_TERRAIN_TEXTURE_BASE, T as Joint3D, _ as FLOWER_VARIETIES, a as VoxelGrid3D, b as Billboard3D, c as ModelInstance3D, d as DirectionalLight3D, f as OmniLight3D, g as resolveFlowerDensity, h as Flowers3D, i as VOXEL_PALETTE, j as Node3D, k as RigidBody3D, l as LoftMesh3D, m as DENSITY_PRESETS, n as Water3D, o as Tree3D, p as Foliage3D, r as WATER_MAX_RIPPLES, s as Particles3D, t as registerNodes3D, u as MeshInstance3D, v as CharacterController3D, w as terrainThemeLayers, x as Terrain3D, y as Camera3D } from "./register-
|
|
1
|
+
import { a as Environment3D, c as sunDirectionFromElevationAzimuth, i as syncTree, l as sunDirectionFromSky, o as horizonColorFromSky, r as Renderer3D, s as parseEnvironment3D, t as createGame3D, u as AssetStore3D } from "./create-game-CEFoFN8d.js";
|
|
2
|
+
import { A as StaticBody3D, C as TERRAIN_THEMES, D as CharacterBody3D, E as Area3D, F as keyboardIntensity, I as movementState, L as rigPose, N as QUARTER_PITCH, O as PhysicsBody3D, P as cameraRelative, S as DEFAULT_TERRAIN_TEXTURE_BASE, T as Joint3D, _ as FLOWER_VARIETIES, a as VoxelGrid3D, b as Billboard3D, c as ModelInstance3D, d as DirectionalLight3D, f as OmniLight3D, g as resolveFlowerDensity, h as Flowers3D, i as VOXEL_PALETTE, j as Node3D, k as RigidBody3D, l as LoftMesh3D, m as DENSITY_PRESETS, n as Water3D, o as Tree3D, p as Foliage3D, r as WATER_MAX_RIPPLES, s as Particles3D, t as registerNodes3D, u as MeshInstance3D, v as CharacterController3D, w as terrainThemeLayers, x as Terrain3D, y as Camera3D } from "./register-CscQqB7V.js";
|
|
3
3
|
import { n as splatWeights, t as buildHeightmap } from "./heightmap-CroQPEER.js";
|
|
4
|
-
import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-
|
|
4
|
+
import { n as enablePhysics3D, t as Physics3D } from "./physics-3d-CDjuhtt_.js";
|
|
5
5
|
export { Area3D, AssetStore3D, Billboard3D, Camera3D, CharacterBody3D, CharacterController3D, DEFAULT_TERRAIN_TEXTURE_BASE, DirectionalLight3D, Environment3D, DENSITY_PRESETS as FLOWER_DENSITY_PRESETS, FLOWER_VARIETIES, Flowers3D, Foliage3D, Joint3D, LoftMesh3D, MeshInstance3D, ModelInstance3D, Node3D, OmniLight3D, Particles3D, Physics3D, PhysicsBody3D, QUARTER_PITCH, Renderer3D, RigidBody3D, StaticBody3D, TERRAIN_THEMES, Terrain3D, Tree3D, VOXEL_PALETTE, VoxelGrid3D, WATER_MAX_RIPPLES, Water3D, buildHeightmap, cameraRelative, createGame3D, enablePhysics3D, horizonColorFromSky, keyboardIntensity, movementState, parseEnvironment3D, registerNodes3D, resolveFlowerDensity, rigPose, splatWeights, sunDirectionFromElevationAzimuth, sunDirectionFromSky, syncTree, terrainThemeLayers };
|
|
@@ -773,6 +773,17 @@ declare class Engine {
|
|
|
773
773
|
* timers, behaviors all breathe together. See `gameplay` `hitStop()`.
|
|
774
774
|
*/
|
|
775
775
|
timeScale: number;
|
|
776
|
+
private _time;
|
|
777
|
+
private _unscaledTime;
|
|
778
|
+
/**
|
|
779
|
+
* Elapsed GAME time in seconds since the scene started — the sum of every
|
|
780
|
+
* scaled dt (freezes at timeScale 0, crawls in slow motion). Unity's
|
|
781
|
+
* `Time.time`. Resets on `setScene`.
|
|
782
|
+
*/
|
|
783
|
+
get time(): number;
|
|
784
|
+
/** Elapsed REAL time in seconds since the scene started (ignores timeScale) —
|
|
785
|
+
* UI animations that must keep moving during slow-mo/pause read this. */
|
|
786
|
+
get unscaledTime(): number;
|
|
776
787
|
constructor(opts?: EngineOptions);
|
|
777
788
|
get scene(): Scene | null;
|
|
778
789
|
/** Replace the active scene. The previous scene's root is freed. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { _ as registerBehavior, n as loadScene } from "./loader-B4OEXDZ8.js";
|
|
3
|
-
import {
|
|
3
|
+
import { s as Engine } from "./particle-sim-CrTE7c02.js";
|
|
4
4
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
5
5
|
import { s as AudioPlayer } from "./register-Dl_ixIJe.js";
|
|
6
6
|
import { i as resolveRendering, n as attachTouchControls } from "./touch-031PxtCR.js";
|
|
7
7
|
import { n as registerGameplayBehaviors } from "./gameplay-CDFgSG6z.js";
|
|
8
8
|
import { t as debugSources } from "./debug-draw-CZmOYjL2.js";
|
|
9
|
-
import { O as PhysicsBody3D, c as ModelInstance3D, d as DirectionalLight3D, j as Node3D, t as registerNodes3D, y as Camera3D } from "./register-
|
|
10
|
-
import { n as enablePhysics3D } from "./physics-3d-
|
|
9
|
+
import { O as PhysicsBody3D, c as ModelInstance3D, d as DirectionalLight3D, j as Node3D, t as registerNodes3D, y as Camera3D } from "./register-CscQqB7V.js";
|
|
10
|
+
import { n as enablePhysics3D } from "./physics-3d-CDjuhtt_.js";
|
|
11
11
|
import { ACESFilmicToneMapping, AmbientLight, BufferAttribute, BufferGeometry, Color, DepthTexture, EquirectangularReflectionMapping, FloatType, Fog, HalfFloatType, LineBasicMaterial, LineSegments, Matrix4, Mesh, PCFShadowMap, PMREMGenerator, PerspectiveCamera, PlaneGeometry, Quaternion, Raycaster, Scene, ShaderMaterial, Vector2, Vector3, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
12
12
|
import { VRMLoaderPlugin, VRMUtils } from "@pixiv/three-vrm";
|
|
13
13
|
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { _ as registerBehavior, n as loadScene, o as computeViewport, s as resolveViewport } from "./loader-B4OEXDZ8.js";
|
|
3
|
-
import {
|
|
3
|
+
import { s as Engine } from "./particle-sim-CrTE7c02.js";
|
|
4
4
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
5
5
|
import { s as AudioPlayer } from "./register-Dl_ixIJe.js";
|
|
6
6
|
import { i as resolveRendering, n as attachTouchControls } from "./touch-031PxtCR.js";
|
|
7
7
|
import { n as registerGameplayBehaviors } from "./gameplay-CDFgSG6z.js";
|
|
8
|
-
import { g as Node2D, n as UILayer, p as PhysicsBody2D, s as Camera2D, t as registerNodes2D } from "./register-
|
|
8
|
+
import { g as Node2D, n as UILayer, p as PhysicsBody2D, s as Camera2D, t as registerNodes2D } from "./register-ClKnoILk.js";
|
|
9
9
|
import { t as debugSources } from "./debug-draw-CZmOYjL2.js";
|
|
10
|
-
import { n as enablePhysics2D } from "./physics-2d-
|
|
10
|
+
import { n as enablePhysics2D } from "./physics-2d-DmQ540uR.js";
|
|
11
11
|
import { Box3, BufferAttribute, BufferGeometry, Color, LineBasicMaterial, LineSegments, LinearFilter, NearestFilter, OrthographicCamera, Raycaster, SRGBColorSpace, Scene, TextureLoader, Vector2, Vector3, WebGLRenderer } from "three";
|
|
12
12
|
//#region src/2d/assets.ts
|
|
13
13
|
/**
|
package/dist/debug.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RendererStats, k as LogLevel, v as Engine } from "./behavior-
|
|
1
|
+
import { C as RendererStats, k as LogLevel, v as Engine } from "./behavior-e3kAmPGC.js";
|
|
2
2
|
|
|
3
3
|
//#region src/debug/panel.d.ts
|
|
4
4
|
/** Minimal document surface the overlay needs (injectable for tests). */
|
|
@@ -32,6 +32,8 @@ declare class DebugOverlay {
|
|
|
32
32
|
private readonly menuButton;
|
|
33
33
|
private dropdown;
|
|
34
34
|
private selected;
|
|
35
|
+
/** Explorer subtrees the user collapsed (nodes keep identity across frames). */
|
|
36
|
+
private readonly collapsedFlags;
|
|
35
37
|
private statsChip;
|
|
36
38
|
private readonly logRows;
|
|
37
39
|
private readonly levelEnabled;
|
package/dist/debug.js
CHANGED
|
@@ -178,6 +178,8 @@ var DebugOverlay = class {
|
|
|
178
178
|
menuButton;
|
|
179
179
|
dropdown = null;
|
|
180
180
|
selected = null;
|
|
181
|
+
/** Explorer subtrees the user collapsed (nodes keep identity across frames). */
|
|
182
|
+
collapsedFlags = /* @__PURE__ */ new Map();
|
|
181
183
|
statsChip = null;
|
|
182
184
|
logRows = [];
|
|
183
185
|
levelEnabled = {
|
|
@@ -418,26 +420,74 @@ var DebugOverlay = class {
|
|
|
418
420
|
clear(panel.body);
|
|
419
421
|
const root = this.engine.scene?.root;
|
|
420
422
|
if (!root) return;
|
|
421
|
-
const renderNode = (node,
|
|
423
|
+
const renderNode = (node, container) => {
|
|
422
424
|
const ctor = node.constructor;
|
|
425
|
+
const hasKids = node.children.length > 0;
|
|
426
|
+
const isCollapsed = this.collapsedFlags.get(node) === true;
|
|
423
427
|
const row = this.doc.createElement("div");
|
|
424
|
-
row.textContent = `${" ".repeat(depth)}${node.name} (${ctor.typeName})`;
|
|
425
428
|
applyStyle(row, {
|
|
426
|
-
|
|
429
|
+
display: "flex",
|
|
430
|
+
alignItems: "center",
|
|
427
431
|
cursor: "pointer",
|
|
428
432
|
padding: "1px 2px",
|
|
433
|
+
borderRadius: "3px",
|
|
429
434
|
background: node === this.selected ? "rgba(110,160,255,0.25)" : "transparent"
|
|
430
435
|
});
|
|
436
|
+
const chevron = this.doc.createElement("span");
|
|
437
|
+
chevron.textContent = hasKids ? isCollapsed ? "▸" : "▾" : "·";
|
|
438
|
+
applyStyle(chevron, {
|
|
439
|
+
width: "14px",
|
|
440
|
+
flex: "none",
|
|
441
|
+
textAlign: "center",
|
|
442
|
+
opacity: hasKids ? "0.85" : "0.25",
|
|
443
|
+
userSelect: "none"
|
|
444
|
+
});
|
|
445
|
+
if (hasKids) chevron.addEventListener("click", (e) => {
|
|
446
|
+
e.stopPropagation?.();
|
|
447
|
+
this.collapsedFlags.set(node, !isCollapsed);
|
|
448
|
+
this.renderExplorer();
|
|
449
|
+
});
|
|
450
|
+
row.appendChild(chevron);
|
|
451
|
+
const label = this.doc.createElement("span");
|
|
452
|
+
label.textContent = node.name;
|
|
453
|
+
applyStyle(label, { whiteSpace: "nowrap" });
|
|
454
|
+
row.appendChild(label);
|
|
455
|
+
const type = this.doc.createElement("span");
|
|
456
|
+
type.textContent = ` ${ctor.typeName}`;
|
|
457
|
+
applyStyle(type, {
|
|
458
|
+
opacity: "0.45",
|
|
459
|
+
whiteSpace: "nowrap",
|
|
460
|
+
fontSize: "10px"
|
|
461
|
+
});
|
|
462
|
+
row.appendChild(type);
|
|
463
|
+
if (hasKids && isCollapsed) {
|
|
464
|
+
const count = this.doc.createElement("span");
|
|
465
|
+
count.textContent = ` (${node.children.length})`;
|
|
466
|
+
applyStyle(count, {
|
|
467
|
+
opacity: "0.35",
|
|
468
|
+
fontSize: "10px"
|
|
469
|
+
});
|
|
470
|
+
row.appendChild(count);
|
|
471
|
+
}
|
|
431
472
|
row.addEventListener("click", () => {
|
|
432
473
|
this.selected = node;
|
|
433
474
|
this.open("inspector");
|
|
434
475
|
this.renderExplorer();
|
|
435
476
|
this.renderInspector();
|
|
436
477
|
});
|
|
437
|
-
|
|
438
|
-
|
|
478
|
+
container.appendChild(row);
|
|
479
|
+
if (hasKids && !isCollapsed) {
|
|
480
|
+
const kids = this.doc.createElement("div");
|
|
481
|
+
applyStyle(kids, {
|
|
482
|
+
marginLeft: "8px",
|
|
483
|
+
paddingLeft: "8px",
|
|
484
|
+
borderLeft: "1px solid rgba(255,255,255,0.14)"
|
|
485
|
+
});
|
|
486
|
+
for (const child of node.children) renderNode(child, kids);
|
|
487
|
+
container.appendChild(kids);
|
|
488
|
+
}
|
|
439
489
|
};
|
|
440
|
-
renderNode(root,
|
|
490
|
+
renderNode(root, panel.body);
|
|
441
491
|
}
|
|
442
492
|
renderInspector() {
|
|
443
493
|
const panel = this.panels.get("inspector");
|
package/dist/gameplay.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as JsonValue } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { T as Node, l as PropSchema, n as BehaviorCtor, t as Behavior, v as Engine } from "./behavior-
|
|
2
|
+
import { T as Node, l as PropSchema, n as BehaviorCtor, t as Behavior, v as Engine } from "./behavior-e3kAmPGC.js";
|
|
3
3
|
|
|
4
4
|
//#region src/gameplay/chase.d.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as Rng, c as JsonValue, d as jsonKind, i as SceneJson, l as jsonClone, n as NodeJson, o as JsonKind, r as SCENE_FORMAT, s as JsonObject, t as ConnectionJson, u as jsonEquals } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { $ as BusName, A as LogManager, B as spatialGain, C as RendererStats, D as SceneTree, E as NodeLifecycle, F as Listener, G as SfxWave, H as SFX_PRESETS, I as ROLLOFF_MODELS, J as MusicBackend, K as SynthOptions, L as RolloffModel, M as SfxEngine, N as SfxPlayOptions, O as LogEntry, P as isAudioContextAvailable, Q as AudioBuses, R as SpatialParams, S as GameStats, T as Node, U as SFX_PRESET_NAMES, V as spatialPan, W as SfxParams, X as MusicTrack, Y as MusicManager, Z as PlayMusicOptions, _ as registeredTypes, a as registerBehavior, b as Scheduler, c as PropDef, d as createNode, et as Signal, f as getNodeSchema, g as registerNode, h as mergeStaticSignals, i as getBehavior, j as InputMap, k as LogLevel, l as PropSchema, m as getNodeType, n as BehaviorCtor, o as registeredBehaviors, p as getNodeSignals, q as synthSfx, r as clearBehaviors, s as NodeCtor, t as Behavior, tt as SignalListener, u as clearRegistry, v as Engine, w as Scene, x as EngineStats, y as EngineOptions, z as Vec3 } from "./behavior-
|
|
3
|
-
import { n as loadScene, t as LoadSceneOptions } from "./loader-
|
|
2
|
+
import { $ as BusName, A as LogManager, B as spatialGain, C as RendererStats, D as SceneTree, E as NodeLifecycle, F as Listener, G as SfxWave, H as SFX_PRESETS, I as ROLLOFF_MODELS, J as MusicBackend, K as SynthOptions, L as RolloffModel, M as SfxEngine, N as SfxPlayOptions, O as LogEntry, P as isAudioContextAvailable, Q as AudioBuses, R as SpatialParams, S as GameStats, T as Node, U as SFX_PRESET_NAMES, V as spatialPan, W as SfxParams, X as MusicTrack, Y as MusicManager, Z as PlayMusicOptions, _ as registeredTypes, a as registerBehavior, b as Scheduler, c as PropDef, d as createNode, et as Signal, f as getNodeSchema, g as registerNode, h as mergeStaticSignals, i as getBehavior, j as InputMap, k as LogLevel, l as PropSchema, m as getNodeType, n as BehaviorCtor, o as registeredBehaviors, p as getNodeSignals, q as synthSfx, r as clearBehaviors, s as NodeCtor, t as Behavior, tt as SignalListener, u as clearRegistry, v as Engine, w as Scene, x as EngineStats, y as EngineOptions, z as Vec3 } from "./behavior-e3kAmPGC.js";
|
|
3
|
+
import { n as loadScene, t as LoadSceneOptions } from "./loader-y_X4zYO0.js";
|
|
4
4
|
import { n as ParticleSimConfig, r as ParticleView, t as ParticleSim } from "./particle-sim-CwJ5rI_P.js";
|
|
5
|
-
import { n as AudioPlayer, t as AudioElementLike } from "./audio-player-
|
|
5
|
+
import { n as AudioPlayer, t as AudioElementLike } from "./audio-player-VSjk_vG8.js";
|
|
6
6
|
import { n as IncantoErrorCode, r as IncantoErrorDetails, t as IncantoError } from "./errors-BMFaY68Q.js";
|
|
7
7
|
|
|
8
8
|
//#region src/core/audio/crossfade.d.ts
|
|
@@ -218,6 +218,23 @@ declare class Timer extends Node {
|
|
|
218
218
|
*/
|
|
219
219
|
declare function createNoise2D(seed: number): (x: number, y: number) => number;
|
|
220
220
|
//#endregion
|
|
221
|
+
//#region src/core/order-groups.d.ts
|
|
222
|
+
/**
|
|
223
|
+
* Named draw-order bands — Unity's "sorting layers" for both dimensions.
|
|
224
|
+
* A node's effective render order is `base(orderGroup) + renderOrder`, so
|
|
225
|
+
* `renderOrder` stays a FINE offset within its band and whole categories
|
|
226
|
+
* layer correctly without magic numbers:
|
|
227
|
+
*
|
|
228
|
+
* background < terrain < default < characters < effects < overlay
|
|
229
|
+
*
|
|
230
|
+
* Engine type defaults: particles sit in `effects`, Terrain3D in `terrain`;
|
|
231
|
+
* everything else is `default` (base 0 — identical to pre-band behavior).
|
|
232
|
+
*/
|
|
233
|
+
type OrderGroup = "background" | "terrain" | "default" | "characters" | "effects" | "overlay";
|
|
234
|
+
declare const ORDER_GROUP_BASE: Record<OrderGroup, number>;
|
|
235
|
+
/** base + fine offset (unknown group names fall back to `default`). */
|
|
236
|
+
declare function effectiveOrder(group: string, renderOrder: number): number;
|
|
237
|
+
//#endregion
|
|
221
238
|
//#region src/core/particle-presets.d.ts
|
|
222
239
|
/**
|
|
223
240
|
* Predefined particle looks. A node's `preset` seeds these values UNDER its
|
|
@@ -436,4 +453,4 @@ declare function computeViewport(canvasW: number, canvasH: number, viewport: {
|
|
|
436
453
|
/** Engine version. Kept in sync with package.json by the release pipeline. */
|
|
437
454
|
declare const VERSION: string;
|
|
438
455
|
//#endregion
|
|
439
|
-
export { AudioBuses, type AudioElementLike, AudioPlayer, Behavior, type BehaviorCtor, type BusName, CONST_REF_KEY, type ComputedViewport, type ConnectionJson, type CrossfadeGains, type DebugLineSource, Engine, type EngineOptions, type EngineStats, type GameStats, type HudAnchor, HudLayer, IncantoError, type IncantoErrorCode, type IncantoErrorDetails, InputMap, type JsonKind, type JsonObject, type JsonValue, type Listener, type LoadSceneOptions, type LogEntry, type LogLevel, LogManager, type MusicBackend, MusicManager, type MusicTrack, Node, type NodeCtor, type NodeJson, type NodeLifecycle, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, type ParsedNodePath, type ParticlePresetValues, ParticleSim, type ParticleSimConfig, type ParticleView, type PlayMusicOptions, type PreloadResult, type PropDef, type PropSchema, ROLLOFF_MODELS, type RendererStats, type ResolvedRendering, type ResolvedViewport, Rng, type RolloffModel, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, type SaveStore, Scene, type SceneJson, SceneTree, type Scheduler, SfxEngine, type SfxParams, type SfxPlayOptions, type SfxWave, Signal, type SignalListener, type SpatialParams, type SynthOptions, Timer, TouchControls, type TouchControlsOptions, UiBanner, UiBar, UiText, VERSION, type Vec3, type ViewportFit, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, duplicateNode, fadeGain, getBehavior, getNodeSchema, getNodeSignals, getNodeType, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, mergeStaticSignals, newUid, parseNodePath, preloadUrls, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, resolveConstants, resolveRendering, resolveViewport, serializeNode, spatialGain, spatialPan, synthSfx };
|
|
456
|
+
export { AudioBuses, type AudioElementLike, AudioPlayer, Behavior, type BehaviorCtor, type BusName, CONST_REF_KEY, type ComputedViewport, type ConnectionJson, type CrossfadeGains, type DebugLineSource, Engine, type EngineOptions, type EngineStats, type GameStats, type HudAnchor, HudLayer, IncantoError, type IncantoErrorCode, type IncantoErrorDetails, InputMap, type JsonKind, type JsonObject, type JsonValue, type Listener, type LoadSceneOptions, type LogEntry, type LogLevel, LogManager, type MusicBackend, MusicManager, type MusicTrack, Node, type NodeCtor, type NodeJson, type NodeLifecycle, ORDER_GROUP_BASE, type OrderGroup, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, type ParsedNodePath, type ParticlePresetValues, ParticleSim, type ParticleSimConfig, type ParticleView, type PlayMusicOptions, type PreloadResult, type PropDef, type PropSchema, ROLLOFF_MODELS, type RendererStats, type ResolvedRendering, type ResolvedViewport, Rng, type RolloffModel, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, type SaveStore, Scene, type SceneJson, SceneTree, type Scheduler, SfxEngine, type SfxParams, type SfxPlayOptions, type SfxWave, Signal, type SignalListener, type SpatialParams, type SynthOptions, Timer, TouchControls, type TouchControlsOptions, UiBanner, UiBar, UiText, VERSION, type Vec3, type ViewportFit, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, duplicateNode, effectiveOrder, fadeGain, getBehavior, getNodeSchema, getNodeSignals, getNodeType, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, mergeStaticSignals, newUid, parseNodePath, preloadUrls, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, resolveConstants, resolveRendering, resolveViewport, serializeNode, spatialGain, spatialPan, synthSfx };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as registerBehavior, a as SCENE_FORMAT, c as SceneTree, d as resolveConstants, f as Node, g as getBehavior, h as clearBehaviors, i as serializeNode, l as CONST_REF_KEY, m as Behavior, n as loadScene, o as computeViewport, p as parseNodePath, r as Scene, s as resolveViewport, u as isConstRef, v as registeredBehaviors, y as Signal } from "./loader-B4OEXDZ8.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as ORDER_GROUP_BASE, c as LogManager, d as isAudioContextAvailable, f as MusicManager, g as AudioBuses, h as fadeGain, i as applyParticlePreset, l as InputMap, m as crossfadeGains, n as PARTICLE_PRESETS, o as effectiveOrder, p as WebAudioMusicBackend, r as PARTICLE_PRESET_NAMES, s as Engine, t as ParticleSim, u as SfxEngine } from "./particle-sim-CrTE7c02.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { t as Rng } from "./rng-DP-SR7eg.js";
|
|
5
5
|
import { a as UiBar, c as ROLLOFF_MODELS, d as SFX_PRESETS, f as SFX_PRESET_NAMES, i as UiBanner, l as spatialGain, n as Timer, o as UiText, p as synthSfx, r as HudLayer, s as AudioPlayer, t as registerCoreNodes, u as spatialPan } from "./register-Dl_ixIJe.js";
|
|
@@ -110,6 +110,6 @@ function newUid() {
|
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/index.ts
|
|
112
112
|
/** Engine version. Kept in sync with package.json by the release pipeline. */
|
|
113
|
-
const VERSION = "0.
|
|
113
|
+
const VERSION = "0.7.0";
|
|
114
114
|
//#endregion
|
|
115
|
-
export { AudioBuses, AudioPlayer, Behavior, CONST_REF_KEY, Engine, HudLayer, IncantoError, InputMap, LogManager, MusicManager, Node, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, ParticleSim, ROLLOFF_MODELS, Rng, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, Scene, SceneTree, SfxEngine, Signal, Timer, TouchControls, UiBanner, UiBar, UiText, VERSION, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, duplicateNode, fadeGain, getBehavior, getNodeSchema, getNodeSignals, getNodeType, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, mergeStaticSignals, newUid, parseNodePath, preloadUrls, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, resolveConstants, resolveRendering, resolveViewport, serializeNode, spatialGain, spatialPan, synthSfx };
|
|
115
|
+
export { AudioBuses, AudioPlayer, Behavior, CONST_REF_KEY, Engine, HudLayer, IncantoError, InputMap, LogManager, MusicManager, Node, ORDER_GROUP_BASE, PARTICLE_PRESETS, PARTICLE_PRESET_NAMES, ParticleSim, ROLLOFF_MODELS, Rng, SCENE_FORMAT, SFX_PRESETS, SFX_PRESET_NAMES, Scene, SceneTree, SfxEngine, Signal, Timer, TouchControls, UiBanner, UiBar, UiText, VERSION, WebAudioMusicBackend, applyParticlePreset, assetUrls, attachTouchControls, clearBehaviors, clearRegistry, computeViewport, createNode, createNoise2D, createSaveStore, crossfadeGains, duplicateNode, effectiveOrder, fadeGain, getBehavior, getNodeSchema, getNodeSignals, getNodeType, isAudioContextAvailable, isConstRef, joystickVector, jsonClone, jsonEquals, jsonKind, loadScene, mergeStaticSignals, newUid, parseNodePath, preloadUrls, registerBehavior, registerCoreNodes, registerNode, registeredBehaviors, registeredTypes, resolveConstants, resolveRendering, resolveViewport, serializeNode, spatialGain, spatialPan, synthSfx };
|
package/dist/net.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as JsonValue, i as SceneJson, s as JsonObject } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { T as Node, et as Signal, l as PropSchema, v as Engine } from "./behavior-
|
|
2
|
+
import { T as Node, et as Signal, l as PropSchema, v as Engine } from "./behavior-e3kAmPGC.js";
|
|
3
3
|
|
|
4
4
|
//#region src/net/types.d.ts
|
|
5
5
|
type Unsubscribe = () => void;
|
|
@@ -1011,6 +1011,21 @@ var Engine = class {
|
|
|
1011
1011
|
* timers, behaviors all breathe together. See `gameplay` `hitStop()`.
|
|
1012
1012
|
*/
|
|
1013
1013
|
timeScale = 1;
|
|
1014
|
+
_time = 0;
|
|
1015
|
+
_unscaledTime = 0;
|
|
1016
|
+
/**
|
|
1017
|
+
* Elapsed GAME time in seconds since the scene started — the sum of every
|
|
1018
|
+
* scaled dt (freezes at timeScale 0, crawls in slow motion). Unity's
|
|
1019
|
+
* `Time.time`. Resets on `setScene`.
|
|
1020
|
+
*/
|
|
1021
|
+
get time() {
|
|
1022
|
+
return this._time;
|
|
1023
|
+
}
|
|
1024
|
+
/** Elapsed REAL time in seconds since the scene started (ignores timeScale) —
|
|
1025
|
+
* UI animations that must keep moving during slow-mo/pause read this. */
|
|
1026
|
+
get unscaledTime() {
|
|
1027
|
+
return this._unscaledTime;
|
|
1028
|
+
}
|
|
1014
1029
|
constructor(opts = {}) {
|
|
1015
1030
|
this.fixedStep = 1 / (opts.fixedHz ?? 60);
|
|
1016
1031
|
this.maxFixedSteps = opts.maxFixedStepsPerTick ?? 5;
|
|
@@ -1028,6 +1043,8 @@ var Engine = class {
|
|
|
1028
1043
|
this._scene = scene;
|
|
1029
1044
|
scene.tree._setEngine(this);
|
|
1030
1045
|
this.input.clear();
|
|
1046
|
+
this._time = 0;
|
|
1047
|
+
this._unscaledTime = 0;
|
|
1031
1048
|
if (scene.input) this.input.declare(scene.input);
|
|
1032
1049
|
this.sceneChanged.emit(scene);
|
|
1033
1050
|
}
|
|
@@ -1107,7 +1124,10 @@ var Engine = class {
|
|
|
1107
1124
|
this.lastMs = nowMs;
|
|
1108
1125
|
return;
|
|
1109
1126
|
}
|
|
1110
|
-
const
|
|
1127
|
+
const rawDt = Math.min((nowMs - this.lastMs) / 1e3, MAX_DT_SECONDS);
|
|
1128
|
+
const dt = rawDt * this.timeScale;
|
|
1129
|
+
this._time += dt;
|
|
1130
|
+
this._unscaledTime += rawDt;
|
|
1111
1131
|
this.lastMs = nowMs;
|
|
1112
1132
|
const scene = this._scene;
|
|
1113
1133
|
if (!scene) return;
|
|
@@ -1132,6 +1152,20 @@ function countNodes(root) {
|
|
|
1132
1152
|
return n;
|
|
1133
1153
|
}
|
|
1134
1154
|
//#endregion
|
|
1155
|
+
//#region src/core/order-groups.ts
|
|
1156
|
+
const ORDER_GROUP_BASE = {
|
|
1157
|
+
background: -2e3,
|
|
1158
|
+
terrain: -1e3,
|
|
1159
|
+
default: 0,
|
|
1160
|
+
characters: 1e3,
|
|
1161
|
+
effects: 2e3,
|
|
1162
|
+
overlay: 3e3
|
|
1163
|
+
};
|
|
1164
|
+
/** base + fine offset (unknown group names fall back to `default`). */
|
|
1165
|
+
function effectiveOrder(group, renderOrder) {
|
|
1166
|
+
return (ORDER_GROUP_BASE[group] ?? 0) + renderOrder;
|
|
1167
|
+
}
|
|
1168
|
+
//#endregion
|
|
1135
1169
|
//#region src/core/particle-presets.ts
|
|
1136
1170
|
const PARTICLE_PRESETS = {
|
|
1137
1171
|
fire: {
|
|
@@ -1397,4 +1431,4 @@ var ParticleSim = class {
|
|
|
1397
1431
|
}
|
|
1398
1432
|
};
|
|
1399
1433
|
//#endregion
|
|
1400
|
-
export {
|
|
1434
|
+
export { ORDER_GROUP_BASE as a, LogManager as c, isAudioContextAvailable as d, MusicManager as f, AudioBuses as g, fadeGain as h, applyParticlePreset as i, InputMap as l, crossfadeGains as m, PARTICLE_PRESETS as n, effectiveOrder as o, WebAudioMusicBackend as p, PARTICLE_PRESET_NAMES as r, Engine as s, ParticleSim as t, SfxEngine as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
|
-
import { _ as validateCollider2D, d as Area2D, f as CharacterBody2D, g as Node2D, m as RigidBody2D, p as PhysicsBody2D, u as Joint2D } from "./register-
|
|
3
|
+
import { _ as validateCollider2D, d as Area2D, f as CharacterBody2D, g as Node2D, m as RigidBody2D, p as PhysicsBody2D, u as Joint2D } from "./register-ClKnoILk.js";
|
|
4
4
|
import { n as registerDebugSource } from "./debug-draw-CZmOYjL2.js";
|
|
5
5
|
//#region src/2d/physics/physics-2d.ts
|
|
6
6
|
var physics_2d_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
3
|
import { n as registerDebugSource } from "./debug-draw-CZmOYjL2.js";
|
|
4
|
-
import { D as CharacterBody3D, E as Area3D, M as validateCollider3D, O as PhysicsBody3D, T as Joint3D, j as Node3D, k as RigidBody3D, x as Terrain3D } from "./register-
|
|
4
|
+
import { D as CharacterBody3D, E as Area3D, M as validateCollider3D, O as PhysicsBody3D, T as Joint3D, j as Node3D, k as RigidBody3D, x as Terrain3D } from "./register-CscQqB7V.js";
|
|
5
5
|
import { Euler, Quaternion } from "three";
|
|
6
6
|
//#region src/3d/physics/physics-3d.ts
|
|
7
7
|
var physics_3d_exports = /* @__PURE__ */ __exportAll({
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as JsonValue } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { n as BehaviorCtor, v as Engine, w as Scene } from "./behavior-
|
|
2
|
+
import { n as BehaviorCtor, v as Engine, w as Scene } from "./behavior-e3kAmPGC.js";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/react/index.d.ts
|
package/dist/react.js
CHANGED
|
@@ -156,7 +156,7 @@ function IncantoCanvas(props) {
|
|
|
156
156
|
pointer: latest.pointer,
|
|
157
157
|
...keyboard !== void 0 ? { keyboard } : {}
|
|
158
158
|
};
|
|
159
|
-
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-
|
|
159
|
+
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-CEFoFN8d.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-X5iRu6pf.js").then((n) => n.n)).createGame2D(o)))(opts);
|
|
160
160
|
if (disposed) {
|
|
161
161
|
next.dispose();
|
|
162
162
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as Node } from "./loader-B4OEXDZ8.js";
|
|
2
|
-
import { i as applyParticlePreset, r as PARTICLE_PRESET_NAMES, t as ParticleSim } from "./particle-sim-
|
|
2
|
+
import { i as applyParticlePreset, o as effectiveOrder, r as PARTICLE_PRESET_NAMES, t as ParticleSim } from "./particle-sim-CrTE7c02.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { t as Rng } from "./rng-DP-SR7eg.js";
|
|
5
5
|
import { t as registerCoreNodes } from "./register-Dl_ixIJe.js";
|
|
@@ -45,6 +45,17 @@ var Node2D = class extends Node {
|
|
|
45
45
|
static: { default: false },
|
|
46
46
|
scale: { default: [1, 1] },
|
|
47
47
|
renderOrder: { default: 0 },
|
|
48
|
+
orderGroup: {
|
|
49
|
+
default: "default",
|
|
50
|
+
options: [
|
|
51
|
+
"background",
|
|
52
|
+
"terrain",
|
|
53
|
+
"default",
|
|
54
|
+
"characters",
|
|
55
|
+
"effects",
|
|
56
|
+
"overlay"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
48
59
|
visible: { default: true }
|
|
49
60
|
};
|
|
50
61
|
/** Legacy alias: old 2D scenes (and `zIndex`-trained agents) keep loading —
|
|
@@ -60,6 +71,12 @@ var Node2D = class extends Node {
|
|
|
60
71
|
scale = [1, 1];
|
|
61
72
|
/** Draw order among 2D drawables (higher = on top); matches 3D `renderOrder`. */
|
|
62
73
|
renderOrder = 0;
|
|
74
|
+
/** Named draw-order band; `renderOrder` is the fine offset inside it. */
|
|
75
|
+
orderGroup = "default";
|
|
76
|
+
/** What three actually sorts by: band base + renderOrder. */
|
|
77
|
+
get effectiveRenderOrder() {
|
|
78
|
+
return effectiveOrder(this.orderGroup, this.renderOrder);
|
|
79
|
+
}
|
|
63
80
|
visible = true;
|
|
64
81
|
_object2D = null;
|
|
65
82
|
/** @internal The backing three object (lazily created). */
|
|
@@ -308,7 +325,7 @@ var Sprite2D = class extends Node2D {
|
|
|
308
325
|
const ax = this.anchor[0] ?? .5;
|
|
309
326
|
const ay = this.anchor[1] ?? .5;
|
|
310
327
|
quad.position.set((.5 - ax) * w, (ay - .5) * h, 0);
|
|
311
|
-
quad.renderOrder = this.
|
|
328
|
+
quad.renderOrder = this.effectiveRenderOrder;
|
|
312
329
|
mat.color.set(this.tint);
|
|
313
330
|
mat.opacity = this.opacity;
|
|
314
331
|
}
|
|
@@ -571,7 +588,7 @@ var ColorRect2D = class extends Node2D {
|
|
|
571
588
|
const ax = this.anchor[0] ?? .5;
|
|
572
589
|
const ay = this.anchor[1] ?? .5;
|
|
573
590
|
quad.position.set((.5 - ax) * w, (ay - .5) * h, 0);
|
|
574
|
-
quad.renderOrder = this.
|
|
591
|
+
quad.renderOrder = this.effectiveRenderOrder;
|
|
575
592
|
const mat = quad.material;
|
|
576
593
|
mat.color.set(this.color);
|
|
577
594
|
mat.opacity = this.opacity;
|
|
@@ -627,7 +644,7 @@ var Label = class extends Node2D {
|
|
|
627
644
|
this.rasterize();
|
|
628
645
|
}
|
|
629
646
|
quad.visible = true;
|
|
630
|
-
quad.renderOrder = this.
|
|
647
|
+
quad.renderOrder = this.effectiveRenderOrder;
|
|
631
648
|
}
|
|
632
649
|
rasterize() {
|
|
633
650
|
const dpr = Math.min(globalThis.devicePixelRatio ?? 1, 2);
|
|
@@ -669,9 +686,21 @@ const UNIT_PLANE = new PlaneGeometry(1, 1);
|
|
|
669
686
|
* Simulation is deterministic under the engine seed.
|
|
670
687
|
*/
|
|
671
688
|
var Particles2D = class Particles2D extends Node2D {
|
|
689
|
+
orderGroup = "effects";
|
|
672
690
|
static typeName = "Particles2D";
|
|
673
691
|
static signals = ["finished"];
|
|
674
692
|
static props = {
|
|
693
|
+
orderGroup: {
|
|
694
|
+
default: "effects",
|
|
695
|
+
options: [
|
|
696
|
+
"background",
|
|
697
|
+
"terrain",
|
|
698
|
+
"default",
|
|
699
|
+
"characters",
|
|
700
|
+
"effects",
|
|
701
|
+
"overlay"
|
|
702
|
+
]
|
|
703
|
+
},
|
|
675
704
|
preset: {
|
|
676
705
|
default: "custom",
|
|
677
706
|
options: ["custom", ...PARTICLE_PRESET_NAMES]
|
|
@@ -837,7 +866,7 @@ var Particles2D = class Particles2D extends Node2D {
|
|
|
837
866
|
mesh.count = index;
|
|
838
867
|
mesh.instanceMatrix.needsUpdate = true;
|
|
839
868
|
if (mesh.instanceColor) mesh.instanceColor.needsUpdate = true;
|
|
840
|
-
mesh.renderOrder = this.
|
|
869
|
+
mesh.renderOrder = this.effectiveRenderOrder;
|
|
841
870
|
}
|
|
842
871
|
};
|
|
843
872
|
const matrixScratch = new Matrix4();
|