Class

io.scalajs.dom.html.phaser

Events

Related Doc: package phaser

Permalink

class Events extends Object

The Events component is a collection of events fired by the parent Game Object.

Phaser uses what are known as 'Signals' for all event handling. All of the events in this class are signals you can subscribe to, much in the same way you'd "listen" for an event.

For example to tell when a Sprite has been added to a new group, you can bind a function to the onAddedToGroup signal:

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

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

For more details about how signals work please see the Phaser.Signal class.

The Input-related events will only be dispatched if the Sprite has had inputEnabled set to true and the Animation-related events only apply to game objects with animations like Phaser.Sprite.

Annotations
@RawJSType() @native() @JSName( "Phaser.Events" )
See also

http://phaser.io/docs/2.6.2/Phaser.Events.html

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Events
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Events(sprite: Phaser.Sprite)

    Permalink

    sprite

    A reference to the game object / Sprite that owns this Events object.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. var onAddedToGroup: Phaser.Signal

    Permalink

    This signal is dispatched when this Game Object is added to a new Group.

    This signal is dispatched when this Game Object is added to a new Group. It is sent two arguments: {any} The Game Object that was added to the Group. {Phaser.Group} The Group it was added to.

  18. var onAnimationComplete: Phaser.Signal

    Permalink

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has been stopped (via animation.stop() and the dispatchComplete argument has been set.

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has been stopped (via animation.stop() and the dispatchComplete argument has been set. You can also listen to Animation.onComplete rather than via the Game Objects events. It is sent two arguments: {any} The Game Object that received the event. {Phaser.Animation} The Phaser.Animation that was stopped.

  19. var onAnimationLoop: Phaser.Signal

    Permalink

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has looped playback.

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has looped playback. You can also listen to Animation.onLoop rather than via the Game Objects events. It is sent two arguments: {any} The Game Object that received the event. {Phaser.Animation} The Phaser.Animation that looped.

  20. var onAnimationStart: Phaser.Signal

    Permalink

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has been played.

    This signal is dispatched if the Game Object has the AnimationManager component, and an Animation has been played. You can also listen to Animation.onStart rather than via the Game Objects events. It is sent two arguments: {any} The Game Object that received the event. {Phaser.Animation} The Phaser.Animation that was started.

  21. var onDestroy: Phaser.Signal

    Permalink

    This signal is dispatched when the Game Object is destroyed.

    This signal is dispatched when the Game Object is destroyed. This happens when Sprite.destroy() is called, or Group.destroy() with destroyChildren set to true. It is sent one argument: {any} The Game Object that was destroyed.

  22. var onDragStart: Phaser.Signal

    Permalink

    This signal is dispatched if the Game Object has been inputEnabled and enableDrag has been set.

    This signal is dispatched if the Game Object has been inputEnabled and enableDrag has been set. It is sent when a Phaser.Pointer starts to drag the Game Object, taking into consideration the various drag limitations that may be set. It is sent four arguments: {any} The Game Object that received the event. {Phaser.Pointer} The Phaser.Pointer object that caused the event. {number} The x coordinate that the drag started from. {number} The y coordinate that the drag started from.

  23. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  24. val sprite: Phaser.Sprite

    Permalink

    A reference to the game object / Sprite that owns this Events object.

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped