mirror of
https://github.com/photonstorm/phaser
synced 2025-01-13 21:54:45 +00:00
e17118c1aa
Everything working properly and faster than before. Swapped InteractiveObject for a class to help internal optimisation.
33 lines
887 B
JavaScript
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;
|