AbstractOptionalx: number = 0Optionaly: number = 0Unique name of the entity (used for lookup and serialization).
OptionalarrayZ-order for draw sorting (higher = drawn later / on top).
Private___Current position (center point).
X coordinate (center).
Y coordinate (center).
Registers a listener for the specified event.
Event name
This emitter for chaining
Registers a one-time listener for the specified event.
The listener is automatically removed after the first invocation.
Event name
This emitter for chaining
Removes a listener for the specified event.
Event name
This emitter for chaining
Emits an event, invoking all registered listeners with the provided arguments.
If the event is "error" and no listeners are registered, the first argument (the error)
will be thrown.
Event name
true if any listeners were invoked, false otherwise
Removes all listeners for the specified event, or all listeners if no event is provided.
Event name
Optionalevent: KOptional event name to clear listeners for
This emitter for chaining
Returns the number of listeners registered for the specified event.
Event name
The event to count listeners for
The number of registered listeners
Update entity.
AbstractupdateCalled once per tick with delta time (seconds).
Draw entity.
Optional AbstractdrawCalled once per frame to draw the entity.
The context is already translated to the entity's position if autoTranslate is true.
The 2D rendering context
Serializes the entity to a plain object (for save/load).
Excludes internal properties and respects nonSerializableProperties.
Serializable data
Staticdeserialize
Abstract base class for all entities in a LEA scene.
Provides event emission (
update,draw,error), position, name, and z-order.