hytopia 0.1.59 → 0.1.60
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/docs/server.audio._constructor_.md +2 -0
- package/docs/server.audio.setattachedtoentity.md +1 -1
- package/docs/server.audiomanager.unregisteraudio.md +1 -1
- package/docs/server.audiomanager.unregisterentityattachedaudios.md +1 -1
- package/docs/server.md +33 -0
- package/docs/server.sceneui._constructor_.md +49 -0
- package/docs/server.sceneui.attachedtoentity.md +11 -0
- package/docs/server.sceneui.id.md +11 -0
- package/docs/server.sceneui.isloaded.md +11 -0
- package/docs/server.sceneui.load.md +53 -0
- package/docs/server.sceneui.md +344 -0
- package/docs/server.sceneui.offset.md +11 -0
- package/docs/server.sceneui.position.md +11 -0
- package/docs/server.sceneui.setattachedtoentity.md +53 -0
- package/docs/server.sceneui.setoffset.md +53 -0
- package/docs/server.sceneui.setposition.md +53 -0
- package/docs/server.sceneui.setstate.md +53 -0
- package/docs/server.sceneui.state.md +11 -0
- package/docs/server.sceneui.templateid.md +11 -0
- package/docs/server.sceneui.unload.md +17 -0
- package/docs/server.sceneui.world.md +11 -0
- package/docs/server.sceneuimanager.getallentityattachedsceneuis.md +55 -0
- package/docs/server.sceneuimanager.getallsceneuis.md +19 -0
- package/docs/server.sceneuimanager.md +127 -0
- package/docs/server.sceneuimanager.unloadentityattachedsceneuis.md +53 -0
- package/docs/server.sceneuimanager.world.md +13 -0
- package/docs/server.sceneuioptions.attachedtoentity.md +13 -0
- package/docs/server.sceneuioptions.md +133 -0
- package/docs/server.sceneuioptions.offset.md +13 -0
- package/docs/server.sceneuioptions.position.md +13 -0
- package/docs/server.sceneuioptions.state.md +13 -0
- package/docs/server.sceneuioptions.templateid.md +13 -0
- package/docs/server.world.md +21 -0
- package/docs/server.world.sceneuimanager.md +13 -0
- package/package.json +1 -1
- package/server.api.json +986 -4
- package/server.d.ts +140 -4
- package/server.js +83 -83
package/server.d.ts
CHANGED
@@ -47,7 +47,7 @@ export declare class Audio implements protocol.Serializable {
|
|
47
47
|
|
48
48
|
|
49
49
|
/**
|
50
|
-
* @param
|
50
|
+
* @param options - The options for the Audio instance.
|
51
51
|
*/
|
52
52
|
constructor(options: AudioOptions);
|
53
53
|
/** The unique identifier for the audio. */
|
@@ -98,7 +98,7 @@ export declare class Audio implements protocol.Serializable {
|
|
98
98
|
/**
|
99
99
|
* Sets the entity to which the audio is attached, following its position.
|
100
100
|
*
|
101
|
-
* @param entity - The entity to attach the
|
101
|
+
* @param entity - The entity to attach the Audio to.
|
102
102
|
*/
|
103
103
|
setAttachedToEntity(entity: Entity): void;
|
104
104
|
/**
|
@@ -250,13 +250,13 @@ export declare class AudioManager {
|
|
250
250
|
/**
|
251
251
|
* Unregisters and stops an audio instance from the audio manager.
|
252
252
|
*
|
253
|
-
* @param audio - The audio instance to unregister.
|
253
|
+
* @param audio - The audio instance to pause and unregister.
|
254
254
|
*/
|
255
255
|
unregisterAudio(audio: Audio): void;
|
256
256
|
/**
|
257
257
|
* Unregisters and stops all audio instances attached to a specific entity.
|
258
258
|
*
|
259
|
-
* @param entity - The entity to unregister audio instances for.
|
259
|
+
* @param entity - The entity to pause and unregister audio instances for.
|
260
260
|
*/
|
261
261
|
unregisterEntityAttachedAudios(entity: Entity): void;
|
262
262
|
}
|
@@ -2908,6 +2908,139 @@ export declare enum RigidBodyType {
|
|
2908
2908
|
KINEMATIC_VELOCITY = "kinematic_velocity"
|
2909
2909
|
}
|
2910
2910
|
|
2911
|
+
/**
|
2912
|
+
* UI rendered within the 3D space of a world's
|
2913
|
+
* game scene.
|
2914
|
+
*
|
2915
|
+
* @remarks
|
2916
|
+
* SceneUI instances are created directly as instances.
|
2917
|
+
* They support a variety of configuration options through
|
2918
|
+
* the {@link SceneUIOptions} constructor argument.
|
2919
|
+
*
|
2920
|
+
* @example
|
2921
|
+
* ```typescript
|
2922
|
+
* const sceneUI = new SceneUI({
|
2923
|
+
* templateId: 'player-health-bar',
|
2924
|
+
* attachedToEntity: playerEntity,
|
2925
|
+
* offset: { x: 0, y: 1, z: 0 },
|
2926
|
+
* });
|
2927
|
+
* ```
|
2928
|
+
*
|
2929
|
+
* @public
|
2930
|
+
*/
|
2931
|
+
export declare class SceneUI implements protocol.Serializable {
|
2932
|
+
|
2933
|
+
|
2934
|
+
|
2935
|
+
|
2936
|
+
|
2937
|
+
|
2938
|
+
|
2939
|
+
/**
|
2940
|
+
* @param options - The options for the SceneUI instance.
|
2941
|
+
*/
|
2942
|
+
constructor(options: SceneUIOptions);
|
2943
|
+
get id(): number | undefined;
|
2944
|
+
get attachedToEntity(): Entity | undefined;
|
2945
|
+
get isLoaded(): boolean;
|
2946
|
+
get offset(): Vector3Like | undefined;
|
2947
|
+
get position(): Vector3Like | undefined;
|
2948
|
+
get state(): Readonly<object>;
|
2949
|
+
get templateId(): string;
|
2950
|
+
get world(): World | undefined;
|
2951
|
+
/**
|
2952
|
+
* Loads the SceneUI into the world.
|
2953
|
+
*
|
2954
|
+
* @param world - The world to load the SceneUI into.
|
2955
|
+
*/
|
2956
|
+
load(world: World): void;
|
2957
|
+
/**
|
2958
|
+
* Sets the entity to which the SceneUI is attached, following its position.
|
2959
|
+
*
|
2960
|
+
* @param entity - The entity to attach the SceneUI to.
|
2961
|
+
*/
|
2962
|
+
setAttachedToEntity(entity: Entity): void;
|
2963
|
+
/**
|
2964
|
+
* Sets the spatial offset of the SceneUI relative to the attached entity or position.
|
2965
|
+
*
|
2966
|
+
* @param offset - The offset in the world.
|
2967
|
+
*/
|
2968
|
+
setOffset(offset: Vector3Like): void;
|
2969
|
+
/**
|
2970
|
+
* Sets the position of the SceneUI. Will detach from entity if attached.
|
2971
|
+
*
|
2972
|
+
* @param position - The position in the world.
|
2973
|
+
*/
|
2974
|
+
setPosition(position: Vector3Like): void;
|
2975
|
+
/**
|
2976
|
+
* Sets the state of the SceneUI by performing a shallow merge with existing state.
|
2977
|
+
*
|
2978
|
+
* @param state - The state to set.
|
2979
|
+
*/
|
2980
|
+
setState(state: object): void;
|
2981
|
+
/**
|
2982
|
+
* Unloads the SceneUI from the world.
|
2983
|
+
*/
|
2984
|
+
unload(): void;
|
2985
|
+
|
2986
|
+
}
|
2987
|
+
|
2988
|
+
/**
|
2989
|
+
* Manages SceneUI instances in a world.
|
2990
|
+
*
|
2991
|
+
* @remarks
|
2992
|
+
* The SceneUIManager is created internally as a singleton
|
2993
|
+
* for each {@link World} instance in a game server.
|
2994
|
+
* It allows retrieval of all loaded SceneUI instances,
|
2995
|
+
* entity attached SceneUI instances, and more.
|
2996
|
+
*
|
2997
|
+
* @public
|
2998
|
+
*/
|
2999
|
+
export declare class SceneUIManager {
|
3000
|
+
|
3001
|
+
|
3002
|
+
|
3003
|
+
|
3004
|
+
/** The world the SceneUIManager is for. */
|
3005
|
+
get world(): World;
|
3006
|
+
/**
|
3007
|
+
* Retrieves all loaded SceneUI instances for the world.
|
3008
|
+
*
|
3009
|
+
* @returns An array of SceneUI instances.
|
3010
|
+
*/
|
3011
|
+
getAllSceneUIs(): SceneUI[];
|
3012
|
+
/**
|
3013
|
+
* Retrieves all loaded SceneUI instances attached to a specific entity.
|
3014
|
+
*
|
3015
|
+
* @param entity - The entity to get attached SceneUI instances for.
|
3016
|
+
* @returns An array of SceneUI instances.
|
3017
|
+
*/
|
3018
|
+
getAllEntityAttachedSceneUIs(entity: Entity): SceneUI[];
|
3019
|
+
|
3020
|
+
/**
|
3021
|
+
* Unloads and unregisters all SceneUI instances attached to a specific entity.
|
3022
|
+
*
|
3023
|
+
* @param entity - The entity to unload and unregister SceneUI instances for.
|
3024
|
+
*/
|
3025
|
+
unloadEntityAttachedSceneUIs(entity: Entity): void;
|
3026
|
+
|
3027
|
+
|
3028
|
+
}
|
3029
|
+
|
3030
|
+
/** Options for creating a SceneUI instance. @public */
|
3031
|
+
export declare interface SceneUIOptions {
|
3032
|
+
/** If set, SceneUI will follow the entity's position */
|
3033
|
+
attachedToEntity?: Entity;
|
3034
|
+
/** The offset of the SceneUI from the attached entity or position */
|
3035
|
+
offset?: Vector3Like;
|
3036
|
+
/** If set, SceneUI will be attached at this position */
|
3037
|
+
position?: Vector3Like;
|
3038
|
+
/** The state of the SceneUI */
|
3039
|
+
state?: object;
|
3040
|
+
/** The template ID to use for this SceneUI */
|
3041
|
+
templateId: string;
|
3042
|
+
}
|
3043
|
+
|
2911
3044
|
/**
|
2912
3045
|
* A simple entity controller with basic movement functions.
|
2913
3046
|
*
|
@@ -3348,6 +3481,7 @@ export declare class World implements protocol.Serializable {
|
|
3348
3481
|
|
3349
3482
|
|
3350
3483
|
|
3484
|
+
|
3351
3485
|
/**
|
3352
3486
|
* @param options - The options for the world.
|
3353
3487
|
*/
|
@@ -3373,6 +3507,8 @@ export declare class World implements protocol.Serializable {
|
|
3373
3507
|
/** The world loop for the world. */
|
3374
3508
|
get loop(): WorldLoop;
|
3375
3509
|
|
3510
|
+
/** The scene UI manager for the world. */
|
3511
|
+
get sceneUIManager(): SceneUIManager;
|
3376
3512
|
/** The simulation for the world. */
|
3377
3513
|
get simulation(): Simulation;
|
3378
3514
|
/**
|