Function

popScene

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

Pops the scene from the stack and set as current active scene.

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

go("mainScene");
popScene();  // when triggered the text should appear on the center screen //

since v3001.1

group Scenes

kaplay logo

Components