mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Updated drag event.
This commit is contained in:
parent
486e80f0a9
commit
c8a1dc32cc
3 changed files with 7 additions and 12 deletions
|
@ -11,7 +11,6 @@ var ProcessDragEvents = function (pointer, time)
|
|||
|
||||
var i;
|
||||
var c;
|
||||
var overGameObject;
|
||||
var gameObject;
|
||||
var list;
|
||||
var input;
|
||||
|
@ -113,8 +112,8 @@ var ProcessDragEvents = function (pointer, time)
|
|||
|
||||
input.dragState = 2;
|
||||
|
||||
input.dragX = input.localX - gameObject.displayOriginX;
|
||||
input.dragY = input.localY - gameObject.displayOriginY;
|
||||
input.dragX = pointer.x - gameObject.x;
|
||||
input.dragY = pointer.y - gameObject.y;
|
||||
|
||||
input.dragStartX = gameObject.x;
|
||||
input.dragStartY = gameObject.y;
|
||||
|
@ -151,12 +150,6 @@ var ProcessDragEvents = function (pointer, time)
|
|||
|
||||
input = gameObject.input;
|
||||
|
||||
// input.dragX = pointer.x - (input.localX - gameObject.displayOriginX);
|
||||
// input.dragY = pointer.y - (input.localY - gameObject.displayOriginY);
|
||||
|
||||
// input.dragX = pointer.x - input.localX;
|
||||
// input.dragY = pointer.y - input.localY;
|
||||
|
||||
// If this GO has a target then let's check it
|
||||
if (input.target)
|
||||
{
|
||||
|
|
|
@ -24,9 +24,6 @@ var DragEvent = new Class({
|
|||
this.x = pointer.x;
|
||||
this.y = pointer.y;
|
||||
|
||||
// this.dragX = gameObject.input.dragX;
|
||||
// this.dragY = gameObject.input.dragY;
|
||||
|
||||
// The local x/y coordinates of the event within the Game Object
|
||||
this.dragX = pointer.x - gameObject.input.dragX;
|
||||
this.dragY = pointer.y - gameObject.input.dragY;
|
||||
|
|
|
@ -11,6 +11,11 @@ var InputManager = new Class({
|
|||
function InputManager (scene, game)
|
||||
{
|
||||
SceneInputManager.call(this, scene, game);
|
||||
},
|
||||
|
||||
pointScreenToWorldHitTest: function (gameObjects, x, y, camera)
|
||||
{
|
||||
return this.manager.pointScreenToWorldHitTest(gameObjects, x, y, camera);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue