phaser/v3/src/input/local/events/GameObjectMoveEvent.js
Richard Davey e17118c1aa Tidying up after refactor.
Everything working properly and faster than before. Swapped InteractiveObject for a class to help internal optimisation.
2017-07-25 04:10:50 +01:00

33 lines
887 B
JavaScript

var Class = require('../../../utils/Class');
var Event = require('../../../events/Event');
var GameObjectMoveEvent = new Class({
Extends: Event,
initialize:
function GameObjectMoveEvent (pointer, gameObject)
{
Event.call(this, 'GAME_OBJECT_MOVE_EVENT');
// The Pointer that triggered the event
this.pointer = pointer;
// The native DOM event (MouseEvent, TouchEvent, etc)
this.event = pointer.event;
// The button that was used. This is read directly from the DOM event.
this.button = pointer.event.button;
// The Game Object the event occurred on
this.gameObject = gameObject;
// The local x/y coordinates of the event within the Game Object
this.x = gameObject.input.localX;
this.y = gameObject.input.localY;
}
});
module.exports = GameObjectMoveEvent;