@zylem/game-lib 0.8.6 → 0.8.8

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.
@@ -91,6 +91,7 @@ import { EditorToGameMessages } from '@zylem/bridge';
91
91
  import { emitRuntimeGoal } from '@zylem/behaviors/runtime-2d';
92
92
  import { emitRuntimeRicochet } from '@zylem/behaviors/runtime-2d';
93
93
  import { emitRuntimeTriggerRegionEnter } from '@zylem/behaviors/runtime-2d';
94
+ import { EntityApplySwatchPayload } from '@zylem/bridge';
94
95
  import { EntityDefinition } from '@zylem/behaviors/core';
95
96
  import { EntityHandle } from '@zylem/behaviors/core';
96
97
  import { EntitySummaryPayload } from '@zylem/bridge';
@@ -1065,6 +1066,8 @@ export { emitRuntimeRicochet }
1065
1066
 
1066
1067
  export { emitRuntimeTriggerRegionEnter }
1067
1068
 
1069
+ export { EntityApplySwatchPayload }
1070
+
1068
1071
  // @public (undocumented)
1069
1072
  export type EntityBlueprint = Static<typeof EntitySchema>;
1070
1073
 
@@ -1482,6 +1485,7 @@ export class GameBridge {
1482
1485
  // @public
1483
1486
  export interface GameBridgeHost {
1484
1487
  applySceneOperation?(op: SceneOperationPayload, direction: 'undo' | 'redo'): void;
1488
+ applySwatch?(payload: EntityApplySwatchPayload): void;
1485
1489
  createEntity?(typeId: string, props: Record<string, unknown> | undefined, pose: BridgePose | undefined): void;
1486
1490
  resolveEntity(uuid: string): GameEntity<any> | null;
1487
1491
  setStageVariable?(key: string, value: unknown): void;
@@ -2286,6 +2290,9 @@ export function isManagedRenderEntity(entity: {
2286
2290
  isBundled?: boolean;
2287
2291
  }): boolean;
2288
2292
 
2293
+ // @public (undocumented)
2294
+ export function isPickMode(): boolean;
2295
+
2289
2296
  // @public (undocumented)
2290
2297
  export function isTransformTool(tool: DebugTools): tool is TransformTool;
2291
2298
 
@@ -3114,6 +3121,9 @@ export function setHoveredEntityId(uuid: string | null): void;
3114
3121
  // @public (undocumented)
3115
3122
  export function setPaused(paused: boolean): void;
3116
3123
 
3124
+ // @public
3125
+ export function setPickMode(enabled: boolean): void;
3126
+
3117
3127
  export { setPosition }
3118
3128
 
3119
3129
  export { setPositionX }
@@ -4821,8 +4831,8 @@ export class ZylemZone extends GameEntity<ZylemZoneOptions> implements Collision
4821
4831
  // dist/entity-XZNGBeca.d.ts:343:9 - (ae-forgotten-export) The symbol "EntityMeshBuilder" needs to be exported by the entry point public.d.ts
4822
4832
  // dist/entity-XZNGBeca.d.ts:344:9 - (ae-forgotten-export) The symbol "EntityCollisionBuilder" needs to be exported by the entry point public.d.ts
4823
4833
  // dist/entity-XZNGBeca.d.ts:345:9 - (ae-forgotten-export) The symbol "MaterialBuilder" needs to be exported by the entry point public.d.ts
4824
- // dist/game-Cy8f6gJm.d.ts:1051:5 - (ae-forgotten-export) The symbol "StageAssetLoaderConfig" needs to be exported by the entry point public.d.ts
4825
- // dist/game-Cy8f6gJm.d.ts:1721:5 - (ae-forgotten-export) The symbol "StageInterface" needs to be exported by the entry point public.d.ts
4834
+ // dist/game-BPOr7zTB.d.ts:1060:5 - (ae-forgotten-export) The symbol "StageAssetLoaderConfig" needs to be exported by the entry point public.d.ts
4835
+ // dist/game-BPOr7zTB.d.ts:1735:5 - (ae-forgotten-export) The symbol "StageInterface" needs to be exported by the entry point public.d.ts
4826
4836
 
4827
4837
  // (No @packageDocumentation comment for this package)
4828
4838
 
@@ -85,6 +85,7 @@ import { EditorToGameMessages } from '@zylem/bridge';
85
85
  import { emitRuntimeGoal } from '@zylem/behaviors/runtime-2d';
86
86
  import { emitRuntimeRicochet } from '@zylem/behaviors/runtime-2d';
87
87
  import { emitRuntimeTriggerRegionEnter } from '@zylem/behaviors/runtime-2d';
88
+ import { EntityApplySwatchPayload } from '@zylem/bridge';
88
89
  import { EntityDefinition } from '@zylem/behaviors/core';
89
90
  import { EntityHandle } from '@zylem/behaviors/core';
90
91
  import { EntitySummaryPayload } from '@zylem/bridge';
@@ -1777,6 +1778,11 @@ declare interface DebugState {
1777
1778
  addTypeId: string | null;
1778
1779
  /** Creation options merged over the armed type's defaults. */
1779
1780
  addTypeProps: Record<string, unknown> | null;
1781
+ /**
1782
+ * Host-driven hover picking (e.g. Creator swatch drag). Raycasts even when
1783
+ * the Select tool is not armed, and keeps the hover highlight painted.
1784
+ */
1785
+ pickMode: boolean;
1780
1786
  flags: Set<string>;
1781
1787
  }
1782
1788
 
@@ -1946,6 +1952,8 @@ declare interface Entity<T = any> {
1946
1952
  tag?: Set<string>;
1947
1953
  }
1948
1954
 
1955
+ export { EntityApplySwatchPayload }
1956
+
1949
1957
  export declare type EntityBlueprint = Static<typeof EntitySchema>;
1950
1958
 
1951
1959
  declare abstract class EntityBuilder<T extends GameEntity<U> & P, U extends GameEntityOptions, P = any> {
@@ -2700,6 +2708,8 @@ export declare interface GameBridgeHost {
2700
2708
  createEntity?(typeId: string, props: Record<string, unknown> | undefined, pose: BridgePose | undefined): void;
2701
2709
  /** Undo or redo a committed scene operation (`scene:operation:apply`). */
2702
2710
  applySceneOperation?(op: SceneOperationPayload, direction: 'undo' | 'redo'): void;
2711
+ /** Attach a catalog shader or behavior to a live entity (`entity:apply-swatch`). */
2712
+ applySwatch?(payload: EntityApplySwatchPayload): void;
2703
2713
  }
2704
2714
 
2705
2715
  /**
@@ -3805,6 +3815,8 @@ export declare function isManagedRenderEntity(entity: {
3805
3815
  isBundled?: boolean;
3806
3816
  }): boolean;
3807
3817
 
3818
+ export declare function isPickMode(): boolean;
3819
+
3808
3820
  declare interface IStage {
3809
3821
  onUpdate: (callback: UpdateFunction<IStage>) => void;
3810
3822
  onSetup: (callback: SetupFunction<IStage>) => void;
@@ -5405,6 +5417,9 @@ export declare function setHoveredEntityId(uuid: string | null): void;
5405
5417
 
5406
5418
  export declare function setPaused(paused: boolean): void;
5407
5419
 
5420
+ /** Hosts arm this while forwarding pointer coords for entity hover (no Select tool). */
5421
+ export declare function setPickMode(enabled: boolean): void;
5422
+
5408
5423
  export { setPosition }
5409
5424
 
5410
5425
  export { setPositionX }
@@ -6015,6 +6030,15 @@ declare class StageDebugDelegate {
6015
6030
  private parkToolVisuals;
6016
6031
  private disposeToolVisuals;
6017
6032
  update(): void;
6033
+ /**
6034
+ * Raycast at NDC coordinates (from a host that cannot send DOM pointer
6035
+ * events, e.g. an overlay sitting on a preview iframe). Updates hover so
6036
+ * the next `update()` paints the highlight.
6037
+ */
6038
+ pickAtNdc(ndcX: number, ndcY: number): {
6039
+ uuid: string;
6040
+ name: string;
6041
+ } | null;
6018
6042
  /** Collider wireframes, straight from the wasm simulation. */
6019
6043
  private updateColliderWireframes;
6020
6044
  /**
@@ -6262,6 +6286,11 @@ declare class StageEntityDelegate {
6262
6286
  */
6263
6287
  destroyAll(): void;
6264
6288
  private registerBehaviorLinks;
6289
+ /**
6290
+ * Re-index an entity's behavior refs after a late `entity.use(...)`.
6291
+ * Spawn-time registration only sees refs that existed at attach.
6292
+ */
6293
+ syncBehaviorLinks(entity: any): void;
6265
6294
  private unregisterBehaviorLinks;
6266
6295
  }
6267
6296