phaser/v3/src/input/InteractiveObject.js

33 lines
594 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,
2017-07-18 16:22:14 +00:00
draggable: false,
2017-07-18 12:54:01 +00:00
hitArea: hitArea,
hitAreaCallback: hitAreaCallback,
localX: 0,
localY: 0,
isOver: false,
isDown: false,
2017-07-18 12:54:01 +00:00
isDragged: false,
callbackContext: gameObject,
2017-07-18 12:54:01 +00:00
onDown: NOOP,
onUp: NOOP,
onOver: NOOP,
onOut: NOOP
};
};
module.exports = InteractiveObject;