Type class
An EventDispatcher for Sprite.
Click here for more info
Sources
This information about SpriteEventDispatcher is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.
Inheritance
SpriteEventDispatcher extends EventDispatcher.
SpriteEventDispatcher is not extended by any other symbol.
Settings
SpriteEventDispatcher does not have any settings.
Private settings
SpriteEventDispatcher does not have any private settings.
Properties
SpriteEventDispatcher does not have any properties.
Methods
|
constructor( sprite: ) |
Returns |
|---|---|
|
disable() |
Returns Inherited from Disable dispatching of events until re-enabled by |
|
disableType( type: ) |
Returns Inherited from Stops dispatching events of |
|
dispatch( type: ) |
Returns Inherited from Calls the listeners of |
|
dispose() |
Returns Inherited from Disposes the dispatcher and all its listeners. |
|
enable() |
Returns Inherited from Enable dispatching of events if they were previously disabled by |
|
enableType( type: ) |
Returns Inherited from Enable dispatching particular event, if it was disabled before by |
|
has( type: ) |
Returns Inherited from Checks if there's already a listener with specific parameters. Listeners added with |
|
hasListeners() |
Returns Inherited from Checks if the dispatcher has any listeners. |
|
hasListenersByType( type: ) |
Returns Inherited from Checks if the dispatcher has listeners for |
|
isDisposed() |
Returns Inherited from Returns |
|
isEnabled( type: ) |
Returns Inherited from Checks if an event of |
|
off( type: ) |
Returns Inherited from Removes listeners added with |
|
on( type: ) |
Returns Inherited from Creates an event listener to be invoked on a specific event type. button.events.on("click", (ev) => {
console.log("Button clicked");
}, this);
button.events.on("click", function(ev) {
console.log("Button clicked");
}, this);
The above logs every click on the button. To remove the listener, call |
|
onAll( callback: ( this: ) |
Returns Inherited from Creates an event listener to be invoked on any event. |
|
onDebounced( type: ) |
Returns Inherited from Creates a debounced event listener to be invoked on a specific event type. button.events.onDebounced("click", (ev) => {
console.log("Button clicked");
}, 500, this);
button.events.onDebounced("click", function(ev) {
console.log("Button clicked");
}, 500, this);
The above logs once, 500 ms after the last of a series of clicks. Each new event restarts the delay, and Click here for more info |
|
once( type: ) |
Returns Inherited from Creates an event listener that is invoked only the first time the event happens, and is then disposed. button.events.once("click", (ev) => {
console.log("Button clicked");
}, this);
button.events.once("click", function(ev) {
console.log("Button clicked");
}, this);
The above logs the first click on the button only. |
|
removeType( type: ) |
Returns Inherited from Removes all listeners of a particular event type. |
|
stopParentDispatch() |
Returns Stops the event being handled from being dispatched on the element's parents. Call it in an event handler, e.g.: element.events.on("pointerdown", function(ev) {
// Do something here and prevent from "pointerdown" bubbling up
// ...
ev.target.events.stopParentDispatch();
});
element.events.on("pointerdown", function(ev) {
// Do something here and prevent from "pointerdown" bubbling up
// ...
ev.target.events.stopParentDispatch();
});
|
| There are 17 inherited items currently hidden from this list. | |
Events
SpriteEventDispatcher does not have any events.