forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInteractiveObject.js
More file actions
43 lines (30 loc) · 848 Bytes
/
InteractiveObject.js
File metadata and controls
43 lines (30 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
// Phaser.Input.InteractiveObject
var InteractiveObject = function (gameObject, hitArea, hitAreaCallback)
{
return {
gameObject: gameObject,
enabled: true,
draggable: false,
dropZone: false,
target: null,
camera: null,
hitArea: hitArea,
hitAreaCallback: hitAreaCallback,
localX: 0,
localY: 0,
// 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;