ZetaEngine
Main API for the Zeta Engine.
It provides methods for managing scenes, loading assets, and controlling the canvas.
Properties
public version: any
Gets the version of the Zeta Engine.
Methods
public composeScene(primPath, assetPath): Promise (opens in a new tab)<ComposedAsset>
Composes an asset into the current scene using the specified primitive path and asset path.
LIMITATION: At this point, the asset being referenced must comes from the same project that's holding the current scene. Cross project asset referencing is on the roadmap.
Parameter | Type | Optional | Description |
---|---|---|---|
primPath | string (opens in a new tab) | ❌ | The path to the primitive in the current scene. |
assetPath | string (opens in a new tab) | ❌ | The path to the asset. The path should be the full path from the root of the project that holds the current scene. |
public getComposedAssets(): Array (opens in a new tab)<ComposedAsset>
Gets the composed assets in the current scene.
public loadScene(sceneUid): void (opens in a new tab)
Loads a scene with the specified UID.
Parameter | Type | Optional | Description |
---|---|---|---|
sceneUid | string (opens in a new tab) | ❌ | The UID of the scene to load. |
public logout(): Promise (opens in a new tab)<void (opens in a new tab)>
Logs out the current user.
public onLoadingProgress(callback): void (opens in a new tab)
Registers a callback to be called when the loading progress is updated.
Parameter | Type | Optional | Description |
---|---|---|---|
callback | (progress: numbertotal: number) => void (opens in a new tab) | ❌ | The callback function that takes the progress and total as parameters. |
public onSceneLoaded(callback): void (opens in a new tab)
Registers a callback to be called when a scene is loaded.
Once the callback is issued, the content of the scene will start to be drawn into the canvas
each frame, until ZetaEngine.unloadScene
is called.
BETA SDK ONLY: Once the callback is issued, the currently loaded scene is guaranteed to be
available via the ZetaEngine.scene
getter, until ZetaEngine.unloadScene
is called.
Parameter | Type | Optional | Description |
---|---|---|---|
callback | (...argsunknown[]) => void (opens in a new tab) | ❌ | The callback function that takes the loaded scene as a parameter. |
public resetCamera(): void (opens in a new tab)
Resets the camera to its default position.
public resizeCanvas(width, height): void (opens in a new tab)
Resizes the canvas to the specified width and height.
Parameter | Type | Optional | Description |
---|---|---|---|
width | number (opens in a new tab) | ❌ | The new width of the canvas. |
height | number (opens in a new tab) | ❌ | The new height of the canvas. |
public unloadScene(): void (opens in a new tab)
Unloads the current scene.