Class: Events

Phaser. Events

Phaser.Events

new Events(sprite)

The Events component is a collection of events fired by the parent game object.

For example to tell when a Sprite has been added to a new group:

sprite.events.onAddedToGroup.add(yourFunction, this);

Where yourFunction is the function you want called when this event occurs.

Note that the Input related events only exist if the Sprite has had inputEnabled set to true.

Parameters:
Name Type Description
sprite Phaser.Sprite

A reference to the Sprite that owns this Events object.

Source:

Members

onAddedToGroup

Properties:
Name Type Description
onAddedToGroup Phaser.Signal

This signal is dispatched when the parent is added to a new Group.

Source:

onAnimationComplete

Properties:
Name Type Description
onAnimationComplete Phaser.Signal

This signal is dispatched when the parent has an animation that finishes playing.

Default Value:
  • null
Source:

onAnimationLoop

Properties:
Name Type Description
onAnimationLoop Phaser.Signal

This signal is dispatched when the parent has an animation that loops playback.

Default Value:
  • null
Source:

onAnimationStart

Properties:
Name Type Description
onAnimationStart Phaser.Signal

This signal is dispatched when the parent has an animation that is played.

Default Value:
  • null
Source:

onDestroy

Properties:
Name Type Description
onDestroy Phaser.Signal

This signal is dispatched when the parent is destoyed.

Source:

onDragStart

Properties:
Name Type Description
onDragStart Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives a drag start event from a Pointer.

Default Value:
  • null
Source:

onDragStop

Properties:
Name Type Description
onDragStop Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives a drag stop event from a Pointer.

Default Value:
  • null
Source:

onEnterBounds

Properties:
Name Type Description
onEnterBounds Phaser.Signal

This signal is dispatched when the parent returns within the world bounds (only if Sprite.checkWorldBounds is true).

Source:

onInputDown

Properties:
Name Type Description
onInputDown Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives a down event from a Pointer.

Default Value:
  • null
Source:

onInputOut

Properties:
Name Type Description
onInputOut Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives an out event from a Pointer.

Default Value:
  • null
Source:

onInputOver

Properties:
Name Type Description
onInputOver Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives an over event from a Pointer.

Default Value:
  • null
Source:

onInputUp

Properties:
Name Type Description
onInputUp Phaser.Signal

This signal is dispatched if the parent is inputEnabled and receives an up event from a Pointer.

Default Value:
  • null
Source:

onKilled

Properties:
Name Type Description
onKilled Phaser.Signal

This signal is dispatched when the parent is killed.

Source:

onOutOfBounds

Properties:
Name Type Description
onOutOfBounds Phaser.Signal

This signal is dispatched when the parent leaves the world bounds (only if Sprite.checkWorldBounds is true).

Source:

onRemovedFromGroup

Properties:
Name Type Description
onRemovedFromGroup Phaser.Signal

This signal is dispatched when the parent is removed from a Group.

Source:

onRevived

Properties:
Name Type Description
onRevived Phaser.Signal

This signal is dispatched when the parent is revived.

Source:

parent

Properties:
Name Type Description
parent Phaser.Sprite

The Sprite that owns these events.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Wed Oct 22 2014 21:45:51 GMT+0100 (BST) using the DocStrap template.