PIXI. EventTarget

new EventTarget()

Mixins event emitter functionality to a class

Source - pixi/utils/EventTarget.js, line 11

Methods

emit(eventName) → {Boolean}

Emit an event to all registered event listeners.

Parameters:
Name Type Description
eventName String

The name of the event.

Returns:
Boolean -

Indication if we've emitted an event.

Source - pixi/utils/EventTarget.js, line 54

listeners(eventName) → {Array}

Return a list of assigned event listeners.

Parameters:
Name Type Description
eventName String

The events that should be listed.

Returns:
Array -

An array of listener functions

Source - pixi/utils/EventTarget.js, line 41

mixin(object)

Mixes in the properties of the EventTarget prototype onto another object

Parameters:
Name Type Description
object Object

The obj to mix into

Source - pixi/utils/EventTarget.js, line 34

off(eventName, callback)

Remove event listeners.

Parameters:
Name Type Description
eventName String

The event we want to remove.

callback function

The listener that we need to find.

Source - pixi/utils/EventTarget.js, line 143

on(eventName, callback)

Register a new EventListener for the given event.

Parameters:
Name Type Description
eventName String

Name of the event.

callback Functon

fn Callback function.

Source - pixi/utils/EventTarget.js, line 107

once(eventName, callback)

Add an EventListener that's only called once.

Parameters:
Name Type Description
eventName String

Name of the event.

callback function

Callback function.

Source - pixi/utils/EventTarget.js, line 124

removeAllListeners(eventName)

Remove all listeners or only the listeners for the specified event.

Parameters:
Name Type Description
eventName String

The event you want to remove all listeners for.

Source - pixi/utils/EventTarget.js, line 173
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Tue Jan 06 2015 06:32:34 GMT-0000 (GMT) using the DocStrap template.