phaser/v3/src/input/InteractiveObject.js

67 lines
1.4 KiB
JavaScript
Raw Normal View History

// Phaser.Input.InteractiveObject
var Class = require('../utils/Class');
var InteractiveObject = new Class({
initialize:
function InteractiveObject (gameObject, hitArea, hitAreaCallback)
{
this.gameObject = gameObject;
this.enabled = true;
this.draggable = false;
this.hitArea = hitArea;
this.hitAreaCallback = hitAreaCallback;
this.localX = 0;
this.localY = 0;
// this.dragX = 0;
// this.dragY = 0;
// this.callbackContext = gameObject;
2017-07-18 12:54:01 +00:00
// onDragStart: NOOP,
// onDrag: NOOP,
// onDragEnd: NOOP
},
2017-07-25 03:53:23 +00:00
onUp: function (gameObject, pointer, x, y)
{
// Empty by default. Override via setCallback.
},
2017-07-25 03:53:23 +00:00
onDown: function (gameObject, pointer, x, y)
{
// Empty by default. Override via setCallback.
},
2017-07-18 12:54:01 +00:00
2017-07-25 03:53:23 +00:00
onOver: function (gameObject, pointer, x, y)
{
// Empty by default. Override via setCallback.
},
2017-07-25 03:53:23 +00:00
onOut: function (gameObject, pointer)
{
// Empty by default. Override via setCallback.
},
2017-07-25 03:53:23 +00:00
onMove: function (gameObject, pointer, x, y)
{
// Empty by default. Override via setCallback.
},
2017-07-24 13:09:57 +00:00
destroy: function ()
{
this.gameObject = undefined;
this.hitArea = undefined;
this.hitAreaCallback = undefined;
}
2017-07-24 13:09:57 +00:00
});
module.exports = InteractiveObject;