phaser/src/input/InteractiveObject.js

38 lines
646 B
JavaScript
Raw Normal View History

// Phaser.Input.InteractiveObject
var InteractiveObject = function (gameObject, hitArea, hitAreaCallback)
{
return {
gameObject: gameObject,
enabled: true,
draggable: false,
2017-07-27 17:24:04 +00:00
dropZone: false,
target: null,
camera: null,
hitArea: hitArea,
hitAreaCallback: hitAreaCallback,
localX: 0,
localY: 0,
2017-07-27 02:40:58 +00:00
// 0 = Not being dragged
// 1 = Being checked for dragging
// 2 = Being dragged
dragState: 0,
dragStartX: 0,
dragStartY: 0,
dragX: 0,
dragY: 0
};
};
module.exports = InteractiveObject;