phaser/v3/src/input/InteractiveObject.js

32 lines
568 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,
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;