mirror of
https://github.com/wassname/phaser.git
synced 2026-07-12 00:50:45 +08:00
Lots more physics tests and updates.
PLEASE DO NOT upgrade to this release if you need your game working and it uses any of the physics functions, as they're nearly all broken here. Just pushing up so I can share it with someone.
This commit is contained in:
@@ -30,6 +30,16 @@ Phaser.Input = function (game) {
|
||||
* @default
|
||||
*/
|
||||
this.hitContext = null;
|
||||
|
||||
/**
|
||||
* @property {function} moveCallback - An optional callback that will be fired every time the activePointer receives a move event from the DOM. Set to null to disable.
|
||||
*/
|
||||
this.moveCallback = null;
|
||||
|
||||
/**
|
||||
* @property {object} moveCallbackContext - The context in which the moveCallback will be sent. Defaults to Phaser.Input but can be set to any valid JS object.
|
||||
*/
|
||||
this.moveCallbackContext = this;
|
||||
|
||||
};
|
||||
|
||||
@@ -404,6 +414,23 @@ Phaser.Input.prototype = {
|
||||
this.mspointer.stop();
|
||||
this.gamepad.stop();
|
||||
|
||||
this.moveCallback = null;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.
|
||||
* It will be called every time the activePointer moves, which in a multi-touch game can be a lot of times, so this is best
|
||||
* to only use if you've limited input to a single pointer (i.e. mouse or touch)
|
||||
* @method Phaser.Input#setMoveCallback
|
||||
* @param {function} callback - The callback that will be called each time the activePointer receives a DOM move event.
|
||||
* @param {object} callbackContext - The context in which the callback will be called.
|
||||
*/
|
||||
setMoveCallback: function (callback, callbackContext) {
|
||||
|
||||
this.moveCallback = callback;
|
||||
this.moveCallbackContext = callbackContext;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user