Gets or sets the current camera for the scene
Access to the Excalibur engine
Direct access to the game object event dispatcher.
The ECS world for the scene
The actors in the current scene
The entities in the current scene
Gets whether or not the Scene has been initialized
The triggers in the current scene
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
Initializes the scene before the first update, meant to be called by engine not by users of Excalibur
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
Internal _postdraw handler for onPostDraw lifecycle event
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
Internal _preupdate handler for onPostUpdate lifecycle event
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
Internal _predraw handler for onPreDraw lifecycle event
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
Internal _preupdate handler for onPreUpdate lifecycle event
Adds an actor to the scene, once this is done the Actor will be drawn and updated.
The actor to add to the current scene
Adds a ScreenElement to the scene.
The ScreenElement to add to the current scene
Removes all entities and timers from the scene, optionally indicate whether deferred should or shouldn't be used.
By default entities use deferred removal
Checks whether an actor is contained in this scene or not
Draws all the actors' debug information in the Scene. Called by the Engine.
The current rendering context
Draws all the actors in the Scene. Called by the Engine.
The current rendering context
The number of milliseconds since the last draw
Emits a new event
Name of the event to emit
Data associated with this event
Alias for removeEventListener
. If only the eventName is specified
it will remove all handlers registered for that specific event. If the eventName
and the handler instance are specified only that handler will be removed.
Event signatures
Event signatures
Safe to override onPostDraw lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})
onPostDraw
is called directly after a scene is drawn.
Safe to override onPostUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})
onPostUpdate
is called directly after a scene is updated.
Safe to override onPreDraw lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})
onPreDraw
is called directly before a scene is drawn.
Safe to override onPreUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})
onPreUpdate
is called directly before a scene is updated.
Once listens to an event one time, then unsubscribes from that event
Removes a Timer from the current scene, it will no longer be updated.
The timer to remove to the current scene.
Removes a TileMap from the scene, it will no longer be drawn or updated.
Removes an actor from the scene, it will no longer be drawn or updated.
The actor to remove from the current scene.
Removes a ScreenElement to the scene, it will no longer be drawn or updated
The ScreenElement to remove from the current scene
Actors are composed together into groupings called Scenes in Excalibur. The metaphor models the same idea behind real world actors in a scene. Only actors in scenes will be updated and drawn.
Typical usages of a scene include: levels, menus, loading screens, etc.