phaser/v3/src/input/InteractiveObject.js

43 lines
863 B
JavaScript
Raw Normal View History

2017-07-18 12:54:01 +00:00
var NOOP = require('../utils/NOOP');
// Phaser.Input.InteractiveObject
var InteractiveObject = function (gameObject, hitArea, hitAreaCallback)
{
return {
gameObject: gameObject,
2017-07-18 12:54:01 +00:00
enabled: true,
// draggable: false,
2017-07-18 12:54:01 +00:00
hitArea: hitArea,
hitAreaCallback: hitAreaCallback,
localX: 0, // tempX value populated by HitTest function
localY: 0, // tempY value populated by HitTest function
// isOver: false,
// isDown: false,
// isDragged: false,
2017-07-18 12:54:01 +00:00
// checkingDrag: false,
dragX: 0,
dragY: 0,
2017-07-24 13:09:57 +00:00
callbackContext: gameObject,
2017-07-18 12:54:01 +00:00
onUp: NOOP,
2017-07-24 13:09:57 +00:00
onDown: NOOP,
2017-07-18 12:54:01 +00:00
onOver: NOOP,
onOut: NOOP,
2017-07-24 13:09:57 +00:00
onMove: NOOP,
onDragStart: NOOP,
onDrag: NOOP,
onDragEnd: NOOP
};
};
module.exports = InteractiveObject;