Navigation helper to switch from Scene to Scene.
import { Navigation, BaseEvent, Scene } from "pencil.js";
Navigation.prepareScenes({
// The first scene on the set is going to be the default one
home: (scene) => {
// Build your scene here ...
// If you want to change scene call a new change event
scene.fire(new BaseEvent(Scene.event.change, "other"));
},
other: (scene) => {
// Build your scene here ...
},
});
const currentScene = Navigation.getCurrentScene();
Go check the full documentation.