MCPcopy
hub / github.com/phaserjs/phaser / CreateInteractiveObject

Function CreateInteractiveObject

src/input/CreateInteractiveObject.js:28–68  ·  view source on GitHub ↗
(gameObject, hitArea, hitAreaCallback)

Source from the content-addressed store, hash-verified

26 * @return {Phaser.Types.Input.InteractiveObject} The new Interactive Object.
27 */
28var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback)
29{
30 return {
31
32 gameObject: gameObject,
33
34 enabled: true,
35 draggable: false,
36 dropZone: false,
37 cursor: false,
38
39 target: null,
40
41 camera: null,
42
43 hitArea: hitArea,
44 hitAreaCallback: hitAreaCallback,
45 hitAreaDebug: null,
46
47 // Has the dev specified their own shape, or is this bound to the texture size?
48 customHitArea: false,
49
50 localX: 0,
51 localY: 0,
52
53 // 0 = Not being dragged
54 // 1 = Being checked for dragging
55 // 2 = Being dragged
56 dragState: 0,
57
58 dragStartX: 0,
59 dragStartY: 0,
60 dragStartXGlobal: 0,
61 dragStartYGlobal: 0,
62 dragStartCamera: null,
63
64 dragX: 0,
65 dragY: 0
66
67 };
68};
69
70module.exports = CreateInteractiveObject;

Callers 2

InputPlugin.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…