Instantiate a new instance of Scene class for an existing scene in the platform.
Optional
options: SceneOptionalInterfaceReturns a new Scene object for interacting with the specified scene.
This method creates a controller instance for working with a scene but does not fetch its properties. Use this when you need to interact with a specific scene by its id.
// Import the pre-initialized factory from your app's initialization file
import { Scene } from "utils/topiaInit.ts";
// Create a Scene instance with credentials
const sceneInstance = Scene.create(
"scene-id-123",
{
credentials: {
interactiveNonce,
interactivePublicKey,
assetId,
urlSlug,
visitorId
}
}
);
// Fetch scene details if needed
await sceneInstance.fetchSceneById();
Instantiate a new instance of Scene class and retrieve all properties.
Optional
options: SceneOptionalInterfaceReturns a new Scene object with all properties.
Factory for creating Scene instances. Use this factory to work with scenes in the Topia platform.
Remarks
This factory should be instantiated once per application and reused across your codebase. Scenes represent the template or blueprint for a world's design and layout.
Keywords
scene, factory, create, template, blueprint, layout, design
Example