mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e421d50996
4 changed files with 25 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"//": "npm publish --tag beta",
|
||||
"name": "phaser",
|
||||
"version": "3.0.0-beta.14",
|
||||
"version": "3.0.0-beta.15",
|
||||
"release": "Shadow Coast",
|
||||
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
|
||||
"author": "Richard Davey <rdavey@gmail.com> (http://www.photonstorm.com)",
|
||||
|
|
|
@ -66,6 +66,9 @@ var Pointer = new Class({
|
|||
this.justUp = false;
|
||||
this.justMoved = false;
|
||||
|
||||
// Did the previous input event come from a Touch input (true) or Mouse? (false)
|
||||
this.wasTouch = false;
|
||||
|
||||
/**
|
||||
* @property {number} movementX - If the mouse is locked, the horizontal relative movement
|
||||
* of the Pointer in pixels since last frame.
|
||||
|
@ -135,6 +138,8 @@ var Pointer = new Class({
|
|||
this.justMoved = true;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = true;
|
||||
},
|
||||
|
||||
move: function (event, time)
|
||||
|
@ -159,6 +164,8 @@ var Pointer = new Class({
|
|||
this.justMoved = true;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = false;
|
||||
},
|
||||
|
||||
down: function (event, time)
|
||||
|
@ -186,6 +193,8 @@ var Pointer = new Class({
|
|||
this.isDown = true;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = false;
|
||||
},
|
||||
|
||||
touchstart: function (event, time)
|
||||
|
@ -206,6 +215,8 @@ var Pointer = new Class({
|
|||
this.isDown = true;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = true;
|
||||
},
|
||||
|
||||
up: function (event, time)
|
||||
|
@ -233,6 +244,8 @@ var Pointer = new Class({
|
|||
this.isDown = false;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = false;
|
||||
},
|
||||
|
||||
touchend: function (event, time)
|
||||
|
@ -253,6 +266,8 @@ var Pointer = new Class({
|
|||
this.isDown = false;
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
this.wasTouch = true;
|
||||
},
|
||||
|
||||
noButtonDown: function ()
|
||||
|
|
|
@ -111,30 +111,21 @@ var GlobalInputManager = new Class({
|
|||
var event = queue[i];
|
||||
|
||||
// TODO: Move to CONSTs so we can do integer comparisons instead of strings.
|
||||
// TODO: Remove the MouseEvent events. Devs should use Pointer events instead.
|
||||
switch (event.type)
|
||||
{
|
||||
case 'mousemove':
|
||||
|
||||
pointer.move(event, time);
|
||||
this.events.dispatch(new MouseEvent.MOVE(event));
|
||||
break;
|
||||
|
||||
case 'mousedown':
|
||||
|
||||
pointer.down(event, time);
|
||||
this.events.dispatch(new MouseEvent.DOWN(event));
|
||||
break;
|
||||
|
||||
case 'mouseup':
|
||||
|
||||
pointer.up(event, time);
|
||||
this.events.dispatch(new MouseEvent.UP(event));
|
||||
break;
|
||||
|
||||
case 'pointerlockchange':
|
||||
|
||||
this.events.dispatch(new MouseEvent.POINTER_LOCK_CHANGE(event, this.mouse.locked));
|
||||
break;
|
||||
|
||||
case 'touchmove':
|
||||
|
@ -151,6 +142,11 @@ var GlobalInputManager = new Class({
|
|||
|
||||
pointer.touchend(event, time);
|
||||
break;
|
||||
|
||||
case 'pointerlockchange':
|
||||
|
||||
this.events.dispatch(new MouseEvent.POINTER_LOCK_CHANGE(event, this.mouse.locked));
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -34,7 +34,10 @@ var Update = function (time, delta)
|
|||
|
||||
this.processDragEvents(pointer, time);
|
||||
|
||||
this.processOverOutEvents(pointer);
|
||||
if (!pointer.wasTouch)
|
||||
{
|
||||
this.processOverOutEvents(pointer);
|
||||
}
|
||||
|
||||
if (pointer.justDown)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue