Add a listener for a given event.
The event name.
The listener function.
Optionalcontext: C
The context to invoke the listener with. Default this.
this.
Removes all listeners from this EventEmitter and prepares it for garbage collection. This method is called automatically when the parent object is destroyed and should not be called directly unless you are tearing down the emitter manually.
Calls each of the listeners registered for a given event.
The event name.
Additional arguments that will be passed to the event handler.
true if the event had listeners, else false.
Return an array listing the events for which the emitter has registered listeners.undefined
undefined
Return the number of listeners listening to a given event.
The event name.
The number of listeners.
Return the listeners registered for a given event.
The event name.
The registered listeners.
Remove the listeners of a given event.
The event name.
Optionalfn: EventCallbackFn<D>
Only remove the listeners that match this function.
Optionalcontext: C
Only remove the listeners that have this context.
Optionalonce: boolean
Only remove one-time listeners.
this.
Add a listener for a given event.
The event name.
The listener function.
Optionalcontext: C
The context to invoke the listener with. Default this.
this.
Add a one-time listener for a given event. The listener is automatically removed the first time the event is emitted, so it will never be called more than once.
The event name.
The listener function.
Optionalcontext: C
The context to invoke the listener with. Default this.
this.
Remove all listeners, or those of the specified event.
Optionalevent: AnyEvent
The event name.
this.
Remove the listeners of a given event.
The event name.
Optionalfn: EventCallbackFn<D>
Only remove the listeners that match this function.
Optionalcontext: C
Only remove the listeners that have this context.
Optionalonce: boolean
Only remove one-time listeners.
this.
Removes all listeners from this EventEmitter. This method is called automatically by the Scene Systems when the parent Scene shuts down, ensuring that all event bindings are cleared and no stale references remain.
Extension of
Phaser.Events.EventEmitterwith custom event names