getScene() → Scene|undefinedsceneSystem.js:56Get the current scene
LittleJS Scene System Plugin
getScene() → Scene|undefinedsceneSystem.js:56Get the current scene
setScene(scene)sceneSystem.js:32Leave the current scene, destroy every object that is not persistent, and enter the next scene
scene Scene optionalThe scene to enter
Scene : ObjectsceneSystem.js:14A scene, any object with the hooks it needs, each optional and called as a method so this is the scene
enter function optionalCalled when the scene starts, after the old one left and the objects were destroyed; it is not awaited, so setup done once, like await box2dInit() and new plugins, goes in gameInit before the first setScene
leave function optionalCalled before the next scene starts, while the scene is current and its objects are still there
update function optionalCalled each update after gameUpdate, not while paused or at time scale 0
render function optionalCalled before gameRender, to draw under the objects
renderPost function optionalCalled after gameRenderPost, to draw over the game, while paused too; plugins made after the first setScene draw over it