Skip to content

Commit f411edf

Browse files
committed
Added jsdocs.
1 parent 6092088 commit f411edf

1 file changed

Lines changed: 28 additions & 24 deletions

File tree

src/input/CreateInteractiveObject.js

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,49 @@
77
/**
88
* @callback HitAreaCallback
99
*
10-
* @param {*} hitArea - [description]
11-
* @param {number} x - [description]
12-
* @param {number} y - [description]
13-
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
10+
* @param {any} hitArea - The hit area object.
11+
* @param {number} x - The translated x coordinate of the hit test event.
12+
* @param {number} y - The translated y coordinate of the hit test event.
13+
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that invoked the hit test.
1414
*
15-
* @return {boolean} [description]
15+
* @return {boolean} `true` if the coordinates fall within the space of the hitArea, otherwise `false`.
1616
*/
1717

1818
/**
1919
* @typedef {object} Phaser.Input.InteractiveObject
2020
*
21-
* @property {Phaser.GameObjects.GameObject} gameObject - [description]
22-
* @property {boolean} enabled - [description]
23-
* @property {boolean} draggable - [description]
24-
* @property {boolean} dropZone - [description]
21+
* @property {Phaser.GameObjects.GameObject} gameObject - The Game Object to which this Interactive Object is bound.
22+
* @property {boolean} enabled - Is this Interactive Object currently enabled for input events?
23+
* @property {boolean} draggable - Is this Interactive Object draggable? Enable with `InputPlugin.setDraggable`.
24+
* @property {boolean} dropZone - Is this Interactive Object a drag-targets drop zone? Set when the object is created.
2525
* @property {?Phaser.GameObjects.GameObject} target - [description]
26-
* @property {Phaser.Cameras.Scene2D.Camera} camera - [description]
27-
* @property {*} hitArea - [description]
28-
* @property {HitAreaCallback} hitAreaCallback - [description]
29-
* @property {number} localX - [description]
30-
* @property {number} localY - [description]
31-
* @property {(0|1|2)} dragState - [description]
32-
* @property {number} dragStartX - [description]
33-
* @property {number} dragStartY - [description]
34-
* @property {number} dragX - [description]
35-
* @property {number} dragY - [description]
26+
* @property {Phaser.Cameras.Scene2D.Camera} camera - The most recent Camera to be tested against this Interactive Object.
27+
* @property {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle.
28+
* @property {HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests.
29+
* @property {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.
30+
* @property {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.
31+
* @property {(0|1|2)} dragState - The current drag state of this Interactive Object. 0 = Not being dragged, 1 = being checked for drag, or 2 = being actively dragged.
32+
* @property {number} dragStartX - The x coordinate that the Pointer started dragging this Interactive Object from.
33+
* @property {number} dragStartY - The y coordinate that the Pointer started dragging this Interactive Object from.
34+
* @property {number} dragX - The x coordinate that this Interactive Object is currently being dragged to.
35+
* @property {number} dragY - The y coordinate that this Interactive Object is currently being dragged to.
3636
*/
3737

3838
/**
39-
* [description]
39+
* Creates a new Interactive Object.
40+
*
41+
* This is called automatically by the Input Manager when you enable a Game Object for input.
42+
*
43+
* The resulting Interactive Object is mapped to the Game Object's `input` property.
4044
*
4145
* @function Phaser.Input.CreateInteractiveObject
4246
* @since 3.0.0
4347
*
44-
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
45-
* @param {*} hitArea - [description]
46-
* @param {HitAreaCallback} hitAreaCallback - [description]
48+
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to which this Interactive Object is bound.
49+
* @param {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle.
50+
* @param {HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests.
4751
*
48-
* @return {Phaser.Input.InteractiveObject} [description]
52+
* @return {Phaser.Input.InteractiveObject} The new Interactive Object.
4953
*/
5054
var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback)
5155
{

0 commit comments

Comments
 (0)