File size: 1,212 Bytes
e1d589b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | var Class = require('../../../utils/Class');
var Event = require('../../../events/Event');
var PointerOverEvent = new Class({
Extends: Event,
initialize:
function PointerOverEvent (pointer, gameObjects)
{
Event.call(this, 'POINTER_OVER_EVENT');
// The Pointer that triggered the event
this.pointer = pointer;
// The native DOM event (MouseEvent, TouchEvent, etc)
this.event = pointer.event;
// The camera on which the input event occurred
this.camera = pointer.camera;
// The x/y coordinates of the event
this.x = pointer.x;
this.y = pointer.y;
// An array of all the game objects the pointer event occurred on in display list order.
// Will be undefined if no objects were interacted with.
// If populated, the bottom element (list[0]) is the highest object on the display list.
// If InputManager.topOnly is true this array will only contain one element.
this.list = gameObjects;
// A reference to the top-most object on the display list (also this.list[0])
this.gameObject = gameObjects[0];
}
});
module.exports = PointerOverEvent;
|