Class/Object

io.scalajs.dom.html.phaser

Pointer

Related Docs: object Pointer | package phaser

Permalink

class Pointer extends Object

A Pointer object is used by the Mouse, Touch and MSPoint managers and represents a single finger on the touch screen.

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

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

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

Instance Constructors

  1. new Pointer(game: Phaser.Game, id: Double, pointerMode: Phaser.PointerMode)

    Permalink

    game

    A reference to the currently running game.

    id

    The ID of the Pointer object within the game. Each game can have up to 10 active pointers.

    pointerMode

    The operational mode of this pointer, eg. CURSOR or TOUCH.

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

    Permalink

    An active pointer is one that is currently pressed down on the display.

    An active pointer is one that is currently pressed down on the display. A Mouse is always active.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. var backButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Mouse or Pen / Stylus then you can access its X1 (back) button directly through this property.

    If this Pointer is a Mouse or Pen / Stylus then you can access its X1 (back) button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

    Please see the DeviceButton docs for details on browser button limitations.

  7. var button: Any

    Permalink

    The button property of the most recent DOM event when this Pointer is started.

    The button property of the most recent DOM event when this Pointer is started. You should not rely on this value for accurate button detection, instead use the Pointer properties leftButton, rightButton, middleButton and so on.

  8. var circle: Phaser.Circle

    Permalink

    A Phaser.Circle that is centered on the x/y coordinates of this pointer, useful for hit detection.

    A Phaser.Circle that is centered on the x/y coordinates of this pointer, useful for hit detection. The Circle size is 44px (Apples recommended "finger tip" size).

  9. var clientX: Double

    Permalink

    The horizontal coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).

  10. var clientY: Double

    Permalink

    The vertical coordinate of the Pointer within the application's client area at which the event occurred (as opposed to the coordinates within the page).

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. var dirty: Boolean

    Permalink

    A dirty pointer needs to re-poll any interactive objects it may have been over, regardless if it has moved or not

  13. var duration: Double

    Permalink

    How long the Pointer has been depressed on the touchscreen or any of the mouse buttons have been held down.

    How long the Pointer has been depressed on the touchscreen or any of the mouse buttons have been held down. If not currently down it returns -1. If you need to test a specific mouse or pen button then access the buttons directly, i.e. Pointer.rightButton.duration.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. var eraserButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Pen / Stylus then you can access its eraser button directly through this property.

    If this Pointer is a Pen / Stylus then you can access its eraser button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

    Please see the DeviceButton docs for details on browser button limitations.

  17. var exists: Boolean

    Permalink

    A Pointer object that exists is allowed to be checked for physics collisions and overlaps.

  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. var forwardButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Mouse or Pen / Stylus then you can access its X2 (forward) button directly through this property.

    If this Pointer is a Mouse or Pen / Stylus then you can access its X2 (forward) button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

    Please see the DeviceButton docs for details on browser button limitations.

  20. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. var interactiveCandidates: Array[_]

    Permalink

    This array is erased and re-populated every time this Pointer is updated.

    This array is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, this frame. To be valid they must have suitable a priorityID, be Input enabled, visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown, but beware it is reset every frame.

  24. var isDown: Boolean

    Permalink

    If the Pointer is touching the touchscreen, or any mouse or pen button is held down, isDown is set to true.

    If the Pointer is touching the touchscreen, or any mouse or pen button is held down, isDown is set to true. If you need to check a specific mouse or pen button then use the button properties, i.e. Pointer.rightButton.isDown.

  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. var isMouse: Boolean

    Permalink

    If the Pointer is a mouse or pen / stylus this is true, otherwise false.

  27. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  28. var isUp: Boolean

    Permalink

    If the Pointer is not touching the touchscreen, or all mouse or pen buttons are up, isUp is set to true.

    If the Pointer is not touching the touchscreen, or all mouse or pen buttons are up, isUp is set to true. If you need to check a specific mouse or pen button then use the button properties, i.e. Pointer.rightButton.isUp.

  29. def justPressed(duration: Double = js.native): Boolean

    Permalink

    The Pointer is considered justPressed if the time it was pressed onto the touchscreen or clicked is less than justPressedRate.

    The Pointer is considered justPressed if the time it was pressed onto the touchscreen or clicked is less than justPressedRate. Note that calling justPressed doesn't reset the pressed status of the Pointer, it will return true for as long as the duration is valid.

    If you wish to check if the Pointer was pressed down just once then see the Sprite.events.onInputDown event.

    duration

    The time to check against. If none given it will use InputManager.justPressedRate.

    returns

    true if the Pointer was pressed down within the duration given.

  30. def justReleased(duration: Double = js.native): Boolean

    Permalink

    The Pointer is considered justReleased if the time it left the touchscreen is less than justReleasedRate.

    The Pointer is considered justReleased if the time it left the touchscreen is less than justReleasedRate. Note that calling justReleased doesn't reset the pressed status of the Pointer, it will return true for as long as the duration is valid.

    If you wish to check if the Pointer was released just once then see the Sprite.events.onInputUp event.

    duration

    The time to check against. If none given it will use InputManager.justReleasedRate.

    returns

    true if the Pointer was released within the duration given.

  31. def leave(event: Event): Unit

    Permalink

    Called when the Pointer leaves the target area.

    Called when the Pointer leaves the target area.

    event

    The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).

  32. var leftButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Mouse or Pen / Stylus then you can access its left button directly through this property.

    If this Pointer is a Mouse or Pen / Stylus then you can access its left button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

  33. var middleButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Mouse or Pen / Stylus then you can access its middle button directly through this property.

    If this Pointer is a Mouse or Pen / Stylus then you can access its middle button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

    Please see the DeviceButton docs for details on browser button limitations.

  34. def move(event: Event, fromClick: Boolean = js.native): Unit

    Permalink

    Called when the Pointer is moved.

    Called when the Pointer is moved.

    event

    The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).

    fromClick

    Was this called from the click event?

  35. var movementX: Double

    Permalink

    The horizontal processed relative movement of the Pointer in pixels since last event.

  36. var movementY: Double

    Permalink

    The vertical processed relative movement of the Pointer in pixels since last event.

  37. var msSinceLastClick: Double

    Permalink

    The number of milliseconds since the last click or touch event.

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

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

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

    Permalink
    Definition Classes
    AnyRef
  41. var pageX: Double

    Permalink

    The horizontal coordinate of the Pointer relative to whole document.

  42. var pageY: Double

    Permalink

    The vertical coordinate of the Pointer relative to whole document.

  43. var pointerId: Double

    Permalink

    The pointerId property of the Pointer as set by the DOM event when this Pointer is started.

    The pointerId property of the Pointer as set by the DOM event when this Pointer is started. The browser can and will recycle this value.

  44. var position: Phaser.Point

    Permalink

    A Phaser.Point object containing the current x/y values of the pointer on the display.

  45. var positionDown: Phaser.Point

    Permalink

    A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display.

  46. var positionUp: Phaser.Point

    Permalink

    A Phaser.Point object containing the x/y values of the pointer when it was last released.

  47. var previousTapTime: Double

    Permalink

    A timestamp representing when the Pointer was last tapped or clicked.

  48. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  49. var rawMovementX: Double

    Permalink

    The horizontal raw relative movement of the Pointer in pixels since last event.

  50. var rawMovementY: Double

    Permalink

    The vertical raw relative movement of the Pointer in pixels since last event.

  51. def reset(): Unit

    Permalink

    Resets the Pointer properties.

    Resets the Pointer properties. Called by InputManager.reset when you perform a State change.

  52. def resetMovement(): Unit

    Permalink

    Resets the movementX and movementY properties.

    Resets the movementX and movementY properties. Use in your update handler after retrieving the values.

  53. var rightButton: Phaser.DeviceButton

    Permalink

    If this Pointer is a Mouse or Pen / Stylus then you can access its right button directly through this property.

    If this Pointer is a Mouse or Pen / Stylus then you can access its right button directly through this property.

    The DeviceButton has its own properties such as isDown, duration and methods like justReleased for more fine-grained button control.

    Please see the DeviceButton docs for details on browser button limitations.

  54. var screenX: Double

    Permalink

    The horizontal coordinate of the Pointer relative to the screen.

  55. var screenY: Double

    Permalink

    The vertical coordinate of the Pointer relative to the screen.

  56. def start(event: Event): Unit

    Permalink

    Called when the Pointer is pressed onto the touchscreen.

    Called when the Pointer is pressed onto the touchscreen.

    event

    The DOM event from the browser.

  57. def stop(event: Event): Unit

    Permalink

    Called when the Pointer leaves the touchscreen.

    Called when the Pointer leaves the touchscreen.

    event

    The event passed up from the input handler (MouseEvent | PointerEvent | TouchEvent).

  58. def swapTarget(newTarget: Phaser.InputHandler, silent: Boolean = js.native): Unit

    Permalink

    This will change the Pointer.targetObject object to be the one provided.

    This will change the Pointer.targetObject object to be the one provided. This allows you to have fine-grained control over which object the Pointer is targeting. Note that even if you set a new Target here, it is still able to be replaced by any other valid target during the next Pointer update.

    newTarget

    The new target for this Pointer. Note this is an InputHandler, so don't pass a Sprite, instead pass sprite.input to it.

    silent

    If true the new target AND the old one will NOT dispatch their onInputOver or onInputOut events.

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

    Permalink
    Definition Classes
    AnyRef
  60. var target: Any

    Permalink

    The target property of the Pointer as set by the DOM event when this Pointer is started.

  61. var targetObject: Any

    Permalink

    The Game Object this Pointer is currently over / touching / dragging.

  62. var timeDown: Double

    Permalink

    A timestamp representing when the Pointer first touched the touchscreen.

  63. var timeUp: Double

    Permalink

    A timestamp representing when the Pointer left the touchscreen.

  64. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  66. var totalTouches: Int

    Permalink

    The total number of times this Pointer has been touched to the touchscreen.

  67. def type: Int

    Permalink

    The const type of this object.

  68. def update(): Unit

    Permalink

    Called by the Input Manager.

  69. def valueOf(): Any

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. var withinGame: Boolean

    Permalink

    Returns true if the Pointer is over the game canvas, otherwise false.

  74. def worldX: Double

    Permalink

    Gets the X value of this Pointer in world coordinates based on the world camera.

  75. def worldY: Double

    Permalink

    Gets the Y value of this Pointer in world coordinates based on the world camera.

  76. def x: Double

    Permalink

    The horizontal coordinate of the Pointer.

    The horizontal coordinate of the Pointer. This value is automatically scaled based on the game scale.

  77. def y: Double

    Permalink

    The vertical coordinate of the Pointer.

    The vertical coordinate of the Pointer. This value is automatically scaled based on the game scale.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped