Class

io.scalajs.dom.html.phaser

Gamepad

Related Doc: package phaser

Permalink

class Gamepad extends Object

The Gamepad class handles gamepad input and dispatches gamepad events.

Remember to call gamepad.start().

HTML5 GAMEPAD API SUPPORT IS AT AN EXPERIMENTAL STAGE! At moment of writing this (end of 2013) only Chrome supports parts of it out of the box. Firefox supports it via prefs flags (about:config, search gamepad). The browsers map the same controllers differently. This class has constants for Windows 7 Chrome mapping of XBOX 360 controller.

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

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

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

Instance Constructors

  1. new Gamepad(game: Phaser.Game)

    Permalink

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. def active: Boolean

    Permalink

    If the gamepad input is active or not - if not active it should not be updated from Input.js

  5. def addCallbacks(context: RawOptions, callbacks: Callbacks): Unit

    Permalink

    Add callbacks to the main Gamepad handler to handle connect/disconnect/button down/button up/axis change/float value buttons.

    Add callbacks to the main Gamepad handler to handle connect/disconnect/button down/button up/axis change/float value buttons.

    context

    The context under which the callbacks are run.

    callbacks

    Object that takes six different callback methods: onConnectCallback, onDisconnectCallback, onDownCallback, onUpCallback, onAxisCallback, onFloatCallback

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. var callbackContext: Object

    Permalink

    The context under which the callbacks are run.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def destroy(): Unit

    Permalink

    Destroys this object and the associated event listeners.

  10. var enabled: Boolean

    Permalink

    Gamepad input will only be processed if enabled (default: true).

  11. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. var game: Phaser.Game

    Permalink
  15. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def isDown(buttonCode: ButtonCode): Boolean

    Permalink

    Returns true if the button is currently pressed down, on ANY gamepad.

    Returns true if the button is currently pressed down, on ANY gamepad.

    buttonCode

    The buttonCode of the button to check for.

    returns

    True if a button is currently down.

  19. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  21. def justPressed(buttonCode: ButtonCode, duration: Double = js.native): Boolean

    Permalink

    Returns the "just released" state of a button from ANY gamepad connected.

    Returns the "just released" state of a button from ANY gamepad connected. Just released is considered as being true if the button was released within the duration given (default 250ms).

    buttonCode

    The buttonCode of the button to check for.

    duration

    The duration below which the button is considered as being just released.

    returns

    True if the button is just released otherwise false.

  22. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  25. var onAxisCallback: Function

    Permalink

    This callback is invoked every time any gamepad axis is changed.

  26. var onConnectCallback: Function

    Permalink

    This callback is invoked every time any gamepad is disconnected

  27. var onDownCallback: Function

    Permalink

    This callback is invoked every time any gamepad button is pressed down.

  28. var onFloatCallback: Function

    Permalink

    This callback is invoked every time any gamepad button is changed to a value where value > 0 and value < 1.

  29. var onUpCallback: Function

    Permalink

    This callback is invoked every time any gamepad button is released.

  30. def pad1: Phaser.SinglePad

    Permalink

    Gamepad #1

  31. def pad2: Phaser.SinglePad

    Permalink

    Gamepad #2

  32. def pad3: Phaser.SinglePad

    Permalink

    Gamepad #3

  33. def pad4: Phaser.SinglePad

    Permalink

    Gamepad #4

  34. def padsConnected: Int

    Permalink

    How many live gamepads are currently connected.

  35. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  36. def reset(): Unit

    Permalink

    Reset all buttons/axes of all gamepads

  37. def setDeadZones(): Unit

    Permalink

    Sets the deadZone variable for all four gamepads

  38. def start(): Unit

    Permalink

    Starts the Gamepad event handling.

    Starts the Gamepad event handling. This MUST be called manually before Phaser will start polling the Gamepad API.

  39. def stop(): Unit

    Permalink

    Stops the Gamepad event handling.

  40. def supported: Boolean

    Permalink

    Whether or not gamepads are supported in current browser.

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. 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