From 48d743a6854c8ae06a441a357f18b244c243f2b1 Mon Sep 17 00:00:00 2001 From: obiot Date: Thu, 4 Jul 2013 12:17:05 +0800 Subject: [PATCH] Attempt at better documenting the "custom" extended Event Object --- src/input/input.js | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/input/input.js b/src/input/input.js index 7a873a3449..88baaf5310 100644 --- a/src/input/input.js +++ b/src/input/input.js @@ -6,6 +6,37 @@ */ (function(window) { + + /** + * The built in Event Object + * @external Event + * @see {@link https://developer.mozilla.org/en/docs/Web/API/Event|Event} + */ + + /** + * Event normalized X coordinates whithin the game canvas itself
+ * + * @memberof! external:Event# + * @name external:Event#gameX + * @type {Number} + */ + + /** + * Event normalized Y coordinates whithin the game canvas itself
+ * + * @memberof! external:Event# + * @name external:Event#gameY + * @type {Number} + */ + + /** + * The unique identifier of the contact for a touch, mouse or pen
+ * (This id is also defined on non Pointer Event Compatible platform like pure mouse or iOS-like touch event) + * @memberof! external:Event# + * @name external:Event#pointerId + * @type {Number} + * @see http://msdn.microsoft.com/en-us/library/windows/apps/hh466123.aspx + */ /** * There is no constructor function for me.input. @@ -738,10 +769,9 @@ * allows registration of event listeners on the object target.
* (on a touch enabled device mouse event will automatically be converted to touch event)
*
- * melonJS also define an additional `gameX/gameY` property in the Event object
- * (accessible as parameter from the callback function)
- * that allows to get the object coordinates whithin the canvas itself
- * + * melonJS defines the additional `gameX` and `gameY` properties when passing the Event object
+ * to the defined callback (see below)
+ * @see external:Event * @name registerPointerEvent * @memberOf me.input * @public