Whether this entity is active, if set to false it will be reclaimed
Observable that keeps track of component add or remove changes on the entity
Direct access to the game object event dispatcher.
The unique identifier for the entity
Get the direct children of this entity
Gets whether the actor is Initialized
Specifically get the tags on the entity from TagComponent
The types of the components on the Entity
Initializes this entity, meant to be called by the Scene before first update not by users of Excalibur.
It is not recommended that internal excalibur methods be overridden, do so at your own risk.
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 _preupdate handler for onPreUpdate lifecycle event
Adds a tag to an entity
Entity
Creates a deep copy of the entity and a copy of all its components
Draws the tile map to the screen. Called by the Scene.
ExcaliburGraphicsContext
The number of milliseconds since the last draw
Emits a new event
Name of the event to emit
Data associated with this event
Get a component by type with typecheck
(Does not work on tag components, use .hasTag("mytag") instead)
Returns a list of parent entities starting with the topmost parent. Includes the current entity.
Returns a list of all the entities that descend from this entity. Includes the current entity.
Check if a component type exists
Check if a tag exists on the entity
name to check for
Kill the entity, means it will no longer be updated. Kills are deferred to the end of the update.
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.
Name of the event to listen for
Event handler for the thrown event
Alias for addEventListener
. You can listen for a variety of
events off of the engine; see the events section below for a complete list.
onInitialize
is called before the first update of the entity. This method is meant to be
overridden.
Synonymous with the event handler .on('initialize', (evt) => {...})
Safe to override onPostUpdate lifecycle event handler. Synonymous with .on('postupdate', (evt) =>{...})
onPostUpdate
is called directly after an entity is updated.
Safe to override onPreUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})
onPreUpdate
is called directly before an entity is updated.
Once listens to an event one time, then unsubscribes from that event
The name of the event to subscribe to once
The handler of the event that will be auto unsubscribed
Removes all children from this entity
Removes a component from the entity, by default removals are deferred to the end of entity update to avoid consistency issues
Components can be force removed with the force
flag, the removal is not deferred and happens immediately
Removes a tag on the entity
Removals are deferred until the end of update
Remove component immediately, no deferred
Unparents this entity, if there is a parent. Otherwise it does nothing.
Entity update lifecycle, called internally
The TileMap provides a mechanism for doing flat 2D tiles rendered in a grid.
TileMaps are useful for top down or side scrolling grid oriented games.