2017-07-24 22:47:55 +00:00
|
|
|
var Class = require('../../../utils/Class');
|
|
|
|
var Event = require('../../../events/Event');
|
|
|
|
|
|
|
|
var GameObjectDownEvent = new Class({
|
|
|
|
|
|
|
|
Extends: Event,
|
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
2017-07-25 03:10:50 +00:00
|
|
|
function GameObjectDownEvent (pointer, gameObject)
|
2017-07-24 22:47:55 +00:00
|
|
|
{
|
|
|
|
Event.call(this, 'GAME_OBJECT_DOWN_EVENT');
|
|
|
|
|
|
|
|
// The Pointer that triggered the event
|
|
|
|
this.pointer = pointer;
|
|
|
|
|
|
|
|
// The native DOM event (MouseEvent, TouchEvent, etc)
|
|
|
|
this.event = pointer.event;
|
|
|
|
|
|
|
|
// The Game Object the event occurred on
|
2017-07-25 03:10:50 +00:00
|
|
|
this.gameObject = gameObject;
|
2017-07-24 22:47:55 +00:00
|
|
|
|
|
|
|
// The local x/y coordinates of the event within the Game Object
|
2017-07-25 03:10:50 +00:00
|
|
|
this.x = gameObject.input.localX;
|
|
|
|
this.y = gameObject.input.localY;
|
2017-07-24 22:47:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = GameObjectDownEvent;
|