|
7 | 7 | /** |
8 | 8 | * @callback HitAreaCallback |
9 | 9 | * |
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. |
14 | 14 | * |
15 | | - * @return {boolean} [description] |
| 15 | + * @return {boolean} `true` if the coordinates fall within the space of the hitArea, otherwise `false`. |
16 | 16 | */ |
17 | 17 |
|
18 | 18 | /** |
19 | 19 | * @typedef {object} Phaser.Input.InteractiveObject |
20 | 20 | * |
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. |
25 | 25 | * @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. |
36 | 36 | */ |
37 | 37 |
|
38 | 38 | /** |
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. |
40 | 44 | * |
41 | 45 | * @function Phaser.Input.CreateInteractiveObject |
42 | 46 | * @since 3.0.0 |
43 | 47 | * |
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. |
47 | 51 | * |
48 | | - * @return {Phaser.Input.InteractiveObject} [description] |
| 52 | + * @return {Phaser.Input.InteractiveObject} The new Interactive Object. |
49 | 53 | */ |
50 | 54 | var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) |
51 | 55 | { |
|
0 commit comments