Function

pushScene

(id: string, args: unknown[]): void

Push the current active scene to a stack and then goes to the new scene

param id- The scene name.

param args- The args passed to the scene definition.

scene("mainScene", () => {
    add([
        text("this is the first scene", { size: 32 }),
        pos(center()),
    ]);
});
scene("otherScene", () => {
    add([
        sprite("bean"),
        pos(center()),
    ]);
});

pushScene("mainScene")

since v3001.1

group Scenes

see

kaplay logo

Components

Miscalenous