mirror of
https://github.com/wassname/phaser.git
synced 2026-07-24 13:10:53 +08:00
* Updated: event.preventDefault() has been added to all Mouse event handlers.
* Updated: Sprite.deltaX/Y removed due to non-use. prevX/Y values moved to Sprite._cache.prevX/Y. * Updated: Due to missing extends parameter the Sprite prototype was picking up functions from classes it never meant to (Button, TilemapLayer), now fully isolated.
This commit is contained in:
@@ -117,6 +117,8 @@ Phaser.Mouse.prototype = {
|
||||
*/
|
||||
onMouseDown: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if (this.mouseDownCallback)
|
||||
{
|
||||
this.mouseDownCallback.call(this.callbackContext, event);
|
||||
@@ -140,6 +142,8 @@ Phaser.Mouse.prototype = {
|
||||
*/
|
||||
onMouseMove: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if (this.mouseMoveCallback)
|
||||
{
|
||||
this.mouseMoveCallback.call(this.callbackContext, event);
|
||||
@@ -163,6 +167,8 @@ Phaser.Mouse.prototype = {
|
||||
*/
|
||||
onMouseUp: function (event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if (this.mouseUpCallback)
|
||||
{
|
||||
this.mouseUpCallback.call(this.callbackContext, event);
|
||||
|
||||
@@ -278,8 +278,8 @@ Phaser.Pointer.prototype = {
|
||||
|
||||
if (this.game.input.multiInputOverride == Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride == Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride == Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers == 0))
|
||||
{
|
||||
this.game.input.x = this.x * this.game.input.scale.x;
|
||||
this.game.input.y = this.y * this.game.input.scale.y;
|
||||
this.game.input.x = this.x;
|
||||
this.game.input.y = this.y;
|
||||
this.game.input.position.setTo(this.x, this.y);
|
||||
this.game.input.onDown.dispatch(this, event);
|
||||
this.game.input.resetSpeed(this.x, this.y);
|
||||
|
||||
Reference in New Issue
Block a user