Class: Phaser.MSPointer
Constructor
new MSPointer(game)
The MSPointer class handles Microsoft touch interactions with the game and the resulting Pointer objects.
It will work only in Internet Explorer 10+ and Windows Store or Windows Phone 8 apps using JavaScript.
http://msdn.microsoft.com/en-us/library/ie/hh673557(v=vs.85).aspx
You should not normally access this class directly, but instead use a Phaser.Pointer object which
normalises all game input for you including accurate button handling.
Please note that at the current time of writing Phaser does not yet support chorded button interactions:
http://www.w3.org/TR/pointerevents/#chorded-button-interactions
Parameters
Name | Type | Description |
---|---|---|
game | Phaser.Game | A reference to the currently running game. |
- Source code: input/MSPointer.js (Line 23)
Public Properties
- Source code: input/MSPointer.js (Line 67)
- Source code: input/MSPointer.js (Line 39)
- Source code: input/MSPointer.js (Line 59)
- Default Value
- true
- Source code: input/MSPointer.js (Line 82)
- MSPointerEvent | null
- Source code: input/MSPointer.js (Line 75)
- Source code: input/MSPointer.js (Line 28)
- Internal:
- This member is internal (protected) and may be modified or removed in the future.
- Source code: input/MSPointer.js (Line 34)
- Source code: input/MSPointer.js (Line 44)
- Source code: input/MSPointer.js (Line 49)
- Source code: input/MSPointer.js (Line 54)
button : number
This property was removed in Phaser 2.4 and should no longer be used.
Instead please see the Pointer button properties such as Pointer.leftButton
, Pointer.rightButton
and so on.
Or Pointer.button holds the DOM event button value if you require that.
callbackContext : Object
The context under which callbacks are called (defaults to game).
capture : boolean
If true the Pointer events will have event.preventDefault applied to them, if false they will propagate fully.
enabled : boolean
MSPointer input will only be processed if enabled.
event :MSPointerEvent | null
The browser MSPointer DOM event. Will be null if no event has ever been received.
Access this property only inside a Pointer event handler and do not keep references to it.
Type
game : Phaser.Game
A reference to the currently running game.
<internal> input : Phaser.Input
A reference to the Phaser Input Manager.
pointerDownCallback : Function
A callback that can be fired on a MSPointerDown event.
pointerMoveCallback : Function
A callback that can be fired on a MSPointerMove event.
pointerUpCallback : Function
A callback that can be fired on a MSPointerUp event.
Public Methods
- Source code: input/MSPointer.js (Line 193)
- Source code: input/MSPointer.js (Line 231)
- Source code: input/MSPointer.js (Line 329)
- Source code: input/MSPointer.js (Line 384)
- Source code: input/MSPointer.js (Line 268)
- Source code: input/MSPointer.js (Line 305)
- Source code: input/MSPointer.js (Line 124)
- Source code: input/MSPointer.js (Line 420)
onPointerDown(event)
The function that handles the PointerDown event.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native DOM event. |
onPointerMove(event)
The function that handles the PointerMove event.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native DOM event. |
onPointerOut(event)
The internal method that handles the pointer out event from the browser.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native event from the browser. This gets stored in MSPointer.event. |
onPointerOut(event)
The internal method that handles the pointer out event from the browser.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native event from the browser. This gets stored in MSPointer.event. |
onPointerUp(event)
The function that handles the PointerUp event.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native DOM event. |
onPointerUpGlobal(event)
The internal method that handles the mouse up event from the window.
Parameters
Name | Type | Description |
---|---|---|
event | PointerEvent | The native event from the browser. This gets stored in MSPointer.event. |
start()
Starts the event listeners running.
stop()
Stop the event listeners.
© 2016 Richard Davey, Photon Storm Ltd.
Licensed under the MIT License.
http://phaser.io/docs/2.6.2/Phaser.MSPointer.html