Updated drag event.

This commit is contained in:
photonstorm 2017-07-28 18:00:04 +01:00
parent 486e80f0a9
commit c8a1dc32cc
3 changed files with 7 additions and 12 deletions

View file

@ -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)
{

View file

@ -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;

View file

@ -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);
}
});