From dca79961796b77362a9fd1df06c7a17c84ac0321 Mon Sep 17 00:00:00 2001 From: orblazer Date: Tue, 20 Mar 2018 16:10:19 +0100 Subject: [PATCH] Fix multiple types on Physics, Texture and Input --- src/input/InputPlugin.js | 14 ++++++------ src/input/Pointer.js | 4 ++-- src/input/keyboard/KeyboardManager.js | 10 ++++----- src/input/keyboard/combo/KeyCombo.js | 2 +- src/physics/arcade/ArcadeImage.js | 4 ++-- src/physics/arcade/ArcadePhysics.js | 8 +++---- src/physics/arcade/ArcadeSprite.js | 2 +- src/physics/arcade/Factory.js | 8 +++---- src/physics/arcade/World.js | 8 +++---- src/physics/arcade/tilemap/SeparateTile.js | 2 +- src/physics/impact/Factory.js | 4 ++-- src/physics/impact/ImpactImage.js | 2 +- src/physics/impact/ImpactSprite.js | 2 +- src/physics/impact/World.js | 4 ++-- src/physics/matter-js/Factory.js | 6 ++--- src/physics/matter-js/MatterImage.js | 2 +- src/physics/matter-js/MatterSprite.js | 2 +- src/physics/matter-js/World.js | 4 ++-- src/physics/matter-js/components/Collision.js | 2 +- .../matter-js/lib/plugins/MatterAttractors.js | 14 ++++++------ src/textures/Frame.js | 18 +++++++-------- src/textures/Texture.js | 22 +++++++++---------- src/textures/TextureManager.js | 8 +++---- src/textures/TextureSource.js | 6 ++--- 24 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 27dad065b..3b550939c 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -1010,7 +1010,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setDraggable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to change the draggable state on. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to change the draggable state on. * @param {boolean} [value=true] - Set to `true` if the Game Objects should be made draggable, `false` if they should be unset. * * @return {Phaser.Input.InputPlugin} This InputPlugin object. @@ -1051,7 +1051,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitArea * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set the hit area on. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set the hit area on. * @param {object} [shape] - The shape or object to check if the pointer is within for hit area checks. * @param {HitAreaCallback} [callback] - The 'contains' function to invoke to check if the pointer is within the hit area. * @@ -1087,7 +1087,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaCircle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a circle hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a circle hit area. * @param {number} x - The center of the circle. * @param {number} y - The center of the circle. * @param {number} radius - The radius of the circle. @@ -1110,7 +1110,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaEllipse * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. * @param {number} x - The center of the ellipse. * @param {number} y - The center of the ellipse. * @param {number} width - The width of the ellipse. @@ -1134,7 +1134,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaFromTexture * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having an ellipse hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having an ellipse hit area. * @param {HitAreaCallback} [callback] - The hit area callback. If undefined it uses Rectangle.Contains. * * @return {Phaser.Input.InputPlugin} This InputPlugin object. @@ -1184,7 +1184,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaRectangle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a rectangular hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a rectangular hit area. * @param {number} x - The top-left of the rectangle. * @param {number} y - The top-left of the rectangle. * @param {number} width - The width of the rectangle. @@ -1208,7 +1208,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#setHitAreaTriangle * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} gameObjects - An array of Game Objects to set as having a triangular hit area. + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} gameObjects - An array of Game Objects to set as having a triangular hit area. * @param {number} x1 - The x coordinate of the first point of the triangle. * @param {number} y1 - The y coordinate of the first point of the triangle. * @param {number} x2 - The x coordinate of the second point of the triangle. diff --git a/src/input/Pointer.js b/src/input/Pointer.js index 670176a27..cba2e313b 100644 --- a/src/input/Pointer.js +++ b/src/input/Pointer.js @@ -270,9 +270,9 @@ var Pointer = new Class({ * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - [description] - * @param {Phaser.Math.Vector2|object} output - [description] + * @param {(Phaser.Math.Vector2|object)} output - [description] * - * @return {Phaser.Math.Vector2|object} [description] + * @return {(Phaser.Math.Vector2|object)} [description] */ positionToCamera: function (camera, output) { diff --git a/src/input/keyboard/KeyboardManager.js b/src/input/keyboard/KeyboardManager.js index 21c250573..f20d1b00b 100644 --- a/src/input/keyboard/KeyboardManager.js +++ b/src/input/keyboard/KeyboardManager.js @@ -239,7 +239,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addKey * @since 3.0.0 * - * @param {string|integer} keyCode - [description] + * @param {(string|integer)} keyCode - [description] * * @return {Phaser.Input.Keyboard.Key} [description] */ @@ -262,7 +262,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeKey * @since 3.0.0 * - * @param {string|integer} keyCode - [description] + * @param {(string|integer)} keyCode - [description] */ removeKey: function (keyCode) { @@ -279,7 +279,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addKeyCapture * @since 3.0.0 * - * @param {string|integer|string[]|integer[]} keyCodes - [description] + * @param {(string|integer|string[]|integer[])} keyCodes - [description] */ addKeyCapture: function (keyCodes) { @@ -300,7 +300,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeKeyCapture * @since 3.0.0 * - * @param {string|integer|string[]|integer[]} keyCodes - [description] + * @param {(string|integer|string[]|integer[])} keyCodes - [description] */ removeKeyCapture: function (keyCodes) { @@ -321,7 +321,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#createCombo * @since 3.0.0 * - * @param {string|integer[]|object[]} keys - [description] + * @param {(string|integer[]|object[])} keys - [description] * @param {object} config - [description] * * @return {Phaser.Input.Keyboard.KeyCombo} [description] diff --git a/src/input/keyboard/combo/KeyCombo.js b/src/input/keyboard/combo/KeyCombo.js index 4b41c44b1..6f2791a37 100644 --- a/src/input/keyboard/combo/KeyCombo.js +++ b/src/input/keyboard/combo/KeyCombo.js @@ -31,7 +31,7 @@ var ResetKeyCombo = require('./ResetKeyCombo'); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardManager} keyboardManager - [description] - * @param {string|integer[]|object[]} keys - [description] + * @param {(string|integer[]|object[])} keys - [description] * @param {object} [config] - [description] */ var KeyCombo = new Class({ diff --git a/src/physics/arcade/ArcadeImage.js b/src/physics/arcade/ArcadeImage.js index 3fd39254e..828f3d9da 100644 --- a/src/physics/arcade/ArcadeImage.js +++ b/src/physics/arcade/ArcadeImage.js @@ -11,7 +11,7 @@ var Image = require('../../gameobjects/image/Image'); /** * @classdesc * An Arcade Physics Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an @@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ diff --git a/src/physics/arcade/ArcadePhysics.js b/src/physics/arcade/ArcadePhysics.js index 54420d02d..77cf1c0ff 100644 --- a/src/physics/arcade/ArcadePhysics.js +++ b/src/physics/arcade/ArcadePhysics.js @@ -142,8 +142,8 @@ var ArcadePhysics = new Class({ * @method Phaser.Physics.Arcade.ArcadePhysics#overlap * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. + * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. + * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. * @param {ArcadePhysicsCallback} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. * @param {object} [callbackContext] - The context in which to run the callbacks. @@ -165,8 +165,8 @@ var ArcadePhysics = new Class({ * @method Phaser.Physics.Arcade.ArcadePhysics#collide * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|array} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. - * @param {Phaser.GameObjects.GameObject|array} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. + * @param {(Phaser.GameObjects.GameObject|array)} object1 - The first object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. + * @param {(Phaser.GameObjects.GameObject|array)} object2 - The second object or array of objects to check. Can be any Game Object that has an Arcade Physics Body. * @param {ArcadePhysicsCallback} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. * @param {ArcadePhysicsCallback} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {object} [callbackContext] - The context in which to run the callbacks. diff --git a/src/physics/arcade/ArcadeSprite.js b/src/physics/arcade/ArcadeSprite.js index c31204c35..5530a1a8d 100644 --- a/src/physics/arcade/ArcadeSprite.js +++ b/src/physics/arcade/ArcadeSprite.js @@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ diff --git a/src/physics/arcade/Factory.js b/src/physics/arcade/Factory.js index 90c186164..624ae33f3 100644 --- a/src/physics/arcade/Factory.js +++ b/src/physics/arcade/Factory.js @@ -124,7 +124,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Image} The Image object that was created. */ @@ -148,7 +148,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Image} The Image object that was created. */ @@ -172,7 +172,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. */ @@ -197,7 +197,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Arcade.Sprite} The Sprite object that was created. */ diff --git a/src/physics/arcade/World.js b/src/physics/arcade/World.js index 297fa07d1..292c2f9c3 100644 --- a/src/physics/arcade/World.js +++ b/src/physics/arcade/World.js @@ -267,7 +267,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#enable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description] + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description] * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ enable: function (object, bodyType) @@ -357,7 +357,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#disable * @since 3.0.0 * - * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} object - [description] + * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[])} object - [description] */ disable: function (object) { @@ -1531,7 +1531,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Group} group - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description] + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description] * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {object} callbackContext - [description] @@ -1571,7 +1571,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} sprite - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - [description] + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - [description] * @param {ArcadePhysicsCallback} collideCallback - [description] * @param {ArcadePhysicsCallback} processCallback - [description] * @param {object} callbackContext - [description] diff --git a/src/physics/arcade/tilemap/SeparateTile.js b/src/physics/arcade/tilemap/SeparateTile.js index 4644c7740..ef94f5451 100644 --- a/src/physics/arcade/tilemap/SeparateTile.js +++ b/src/physics/arcade/tilemap/SeparateTile.js @@ -18,7 +18,7 @@ var TileIntersectsBody = require('./TileIntersectsBody'); * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. * @param {Phaser.Geom.Rectangle} tileWorldRect - [description] - * @param {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} tilemapLayer - The tilemapLayer to collide against. + * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. * @param {number} tileBias - [description] * * @return {boolean} Returns true if the body was separated, otherwise false. diff --git a/src/physics/impact/Factory.js b/src/physics/impact/Factory.js index 92bbee070..c8242d579 100644 --- a/src/physics/impact/Factory.js +++ b/src/physics/impact/Factory.js @@ -98,7 +98,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Impact.ImpactImage} The ImpactImage object that was created. */ @@ -120,7 +120,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Physics.Impact.ImpactSprite} The ImpactSprite object that was created. */ diff --git a/src/physics/impact/ImpactImage.js b/src/physics/impact/ImpactImage.js index 4a805d583..09fe6b09a 100644 --- a/src/physics/impact/ImpactImage.js +++ b/src/physics/impact/ImpactImage.js @@ -54,7 +54,7 @@ var Image = require('../../gameobjects/image/Image'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ImpactImage = new Class({ diff --git a/src/physics/impact/ImpactSprite.js b/src/physics/impact/ImpactSprite.js index 8e43c3d92..441d7826b 100644 --- a/src/physics/impact/ImpactSprite.js +++ b/src/physics/impact/ImpactSprite.js @@ -58,7 +58,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ImpactSprite = new Class({ diff --git a/src/physics/impact/World.js b/src/physics/impact/World.js index 0c5a5cd7c..92c129649 100644 --- a/src/physics/impact/World.js +++ b/src/physics/impact/World.js @@ -222,7 +222,7 @@ var World = new Class({ * @method Phaser.Physics.Impact.World#setCollisionMap * @since 3.0.0 * - * @param {string|integer[][]} key - Either a string key that corresponds to a Weltmeister level + * @param {(string|integer[][])} key - Either a string key that corresponds to a Weltmeister level * in the cache, or a 2D array of collision IDs. * @param {integer} tileSize - The size of a tile. This is optional if loading from a Weltmeister * level in the cache. @@ -278,7 +278,7 @@ var World = new Class({ * @method Phaser.Physics.Impact.World#setCollisionMapFromTilemapLayer * @since 3.0.0 * - * @param {StaticTilemapLayer|DynamicTilemapLayer} tilemapLayer - The tilemap layer to use. + * @param {(StaticTilemapLayer|DynamicTilemapLayer)} tilemapLayer - The tilemap layer to use. * @param {object} [options] - Options for controlling the mapping from tiles to slope IDs. * @param {string} [options.slopeTileProperty=null] - Slope IDs can be stored on tiles directly * using Tiled's tileset editor. If a tile has a property with the given slopeTileProperty string diff --git a/src/physics/matter-js/Factory.js b/src/physics/matter-js/Factory.js index 47377c5be..0b567bd7b 100644 --- a/src/physics/matter-js/Factory.js +++ b/src/physics/matter-js/Factory.js @@ -185,7 +185,7 @@ var Factory = new Class({ * @since 3.0.0 * * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {number} x - The horizontal position of this composite in the world. * @param {number} y - The vertical position of this composite in the world. * @param {number} columns - The number of columns in the grid. @@ -527,7 +527,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] * * @return {Phaser.Physics.Matter.MatterImage} [description] @@ -568,7 +568,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] * * @return {Phaser.Physics.Matter.MatterSprite} [description] diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index debbcaf73..1b1051d5f 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -59,7 +59,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] */ var MatterImage = new Class({ diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index f7c20334b..c24eddcb2 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -64,7 +64,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {object} options - [description] */ var MatterSprite = new Class({ diff --git a/src/physics/matter-js/World.js b/src/physics/matter-js/World.js index 2f1ee9616..a2eafcf4c 100644 --- a/src/physics/matter-js/World.js +++ b/src/physics/matter-js/World.js @@ -418,7 +418,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#add * @since 3.0.0 * - * @param {object|object[]} object - Can be single or an array, and can be a body, composite or constraint + * @param {(object|object[])} object - Can be single or an array, and can be a body, composite or constraint * * @return {Phaser.Physics.Matter.World} This Matter World object. */ @@ -474,7 +474,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#convertTilemapLayer * @since 3.0.0 * - * @param {Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer} tilemapLayer - + * @param {(Phaser.GameObjects.StaticTilemapLayer|Phaser.GameObjects.DynamicTilemapLayer)} tilemapLayer - * An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} * diff --git a/src/physics/matter-js/components/Collision.js b/src/physics/matter-js/components/Collision.js index 2384c679f..5843eda57 100644 --- a/src/physics/matter-js/components/Collision.js +++ b/src/physics/matter-js/components/Collision.js @@ -52,7 +52,7 @@ var Collision = { * @method Phaser.Physics.Matter.Components.Collision#setCollidesWith * @since 3.0.0 * - * @param {number|number[]} categories - A unique category bitfield, or an array of them. + * @param {(number|number[])} categories - A unique category bitfield, or an array of them. * * @return {Phaser.GameObjects.GameObject} This Game Object. */ diff --git a/src/physics/matter-js/lib/plugins/MatterAttractors.js b/src/physics/matter-js/lib/plugins/MatterAttractors.js index a4c40dbba..df13db45f 100644 --- a/src/physics/matter-js/lib/plugins/MatterAttractors.js +++ b/src/physics/matter-js/lib/plugins/MatterAttractors.js @@ -64,7 +64,7 @@ var MatterAttractors = { if (Matter.Common.isFunction(attractor)) { forceVector = attractor(bodyA, bodyB); } - + if (forceVector) { Matter.Body.applyForce(bodyB, bodyB.position, forceVector); } @@ -74,9 +74,9 @@ var MatterAttractors = { } } }, - + /** - * Defines some useful common attractor functions that can be used + * Defines some useful common attractor functions that can be used * by pushing them to your body's `body.plugin.attractors` array. * @namespace MatterAttractors.Attractors * @property {number} gravityConstant The gravitational constant used by the gravity attractor. @@ -87,7 +87,7 @@ var MatterAttractors = { /** * An attractor function that applies Newton's law of gravitation. * Use this by pushing `MatterAttractors.Attractors.gravity` to your body's `body.plugin.attractors` array. - * The gravitational constant defaults to `0.001` which you can change + * The gravitational constant defaults to `0.001` which you can change * at `MatterAttractors.Attractors.gravityConstant`. * @function MatterAttractors.Attractors.gravity * @param {Matter.Body} bodyA The first body. @@ -117,7 +117,7 @@ module.exports = MatterAttractors; */ /** - * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`. + * This plugin adds a new property `body.plugin.attractors` to instances of `Matter.Body`. * This is an array of callback functions that will be called automatically * for every pair of bodies, on every engine update. * @property {Function[]} body.plugin.attractors @@ -132,5 +132,5 @@ module.exports = MatterAttractors; * @callback AttractorFunction * @param {Matter.Body} bodyA * @param {Matter.Body} bodyB - * @returns {Vector|undefined} a force vector (optional) - */ \ No newline at end of file + * @returns {(Vector|undefined)} a force vector (optional) + */ diff --git a/src/textures/Frame.js b/src/textures/Frame.js index af1c17f2f..4a2cdf443 100644 --- a/src/textures/Frame.js +++ b/src/textures/Frame.js @@ -17,7 +17,7 @@ var Extend = require('../utils/object/Extend'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {integer|string} name - The name of this Frame. The name is unique within the Texture. + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. @@ -211,7 +211,7 @@ var Frame = new Class({ /** * **CURRENTLY UNSUPPORTED** - * + * * Is this frame is rotated or not in the Texture? * Rotation allows you to use rotated frames in texture atlas packing. * It has nothing to do with Sprite rotation. @@ -374,7 +374,7 @@ var Frame = new Class({ var tw = this.source.width; var th = this.source.height; var uvs = this.data.uvs; - + uvs.x0 = cx / tw; uvs.y0 = cy / th; @@ -403,16 +403,16 @@ var Frame = new Class({ var tw = this.source.width; var th = this.source.height; var uvs = this.data.uvs; - + uvs.x3 = (this.cutX + this.cutHeight) / tw; uvs.y3 = (this.cutY + this.cutWidth) / th; uvs.x2 = this.cutX / tw; uvs.y2 = (this.cutY + this.cutWidth) / th; - + uvs.x1 = this.cutX / tw; uvs.y1 = this.cutY / th; - + uvs.x0 = (this.cutX + this.cutHeight) / tw; uvs.y0 = this.cutY / th; @@ -525,7 +525,7 @@ var Frame = new Class({ /** * The radius of the Frame (derived from sqrt(w * w + h * h) / 2) - * + * * @name Phaser.Textures.Frame#radius * @type {number} * @readOnly @@ -542,7 +542,7 @@ var Frame = new Class({ /** * Is the Frame trimmed or not? - * + * * @name Phaser.Textures.Frame#trimmed * @type {boolean} * @readOnly @@ -559,7 +559,7 @@ var Frame = new Class({ /** * The Canvas drawImage data object. - * + * * @name Phaser.Textures.Frame#canvasData * @type {object} * @readOnly diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 9a8e41c80..d763b611f 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -27,7 +27,7 @@ var TextureSource = require('./TextureSource'); * * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. - * @param {Image|HTMLCanvasElement} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas. + * @param {(Image|HTMLCanvasElement)} source - The source that is used to create the texture. Usually an Image, but can also be a Canvas. * @param {number} [width] - The width of the Texture. This is optional and automatically derived from the source images. * @param {number} [height] - The height of the Texture. This is optional and automatically derived from the source images. */ @@ -133,7 +133,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#add * @since 3.0.0 * - * @param {integer|string} name - The name of this Frame. The name is unique within the Texture. + * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. @@ -187,7 +187,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#get * @since 3.0.0 * - * @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {Phaser.Textures.Frame} The Texture Frame. */ @@ -204,10 +204,10 @@ var Texture = new Class({ if (!frame) { console.warn('No Texture.frame found with name ' + name); - + frame = this.frames[this.firstFrame]; } - + return frame; }, @@ -271,7 +271,7 @@ var Texture = new Class({ /** * Returns an array with all of the names of the Frames in this Texture. - * + * * Useful if you want to randomly assign a Frame to a Game Object, as you can * pick a random element from the returned array. * @@ -309,9 +309,9 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getSourceImage * @since 3.0.0 * - * @param {string|integer} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * - * @return {HTMLImageElement|HTMLCanvasElement} The DOM Image or Canvas Element. + * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. */ getSourceImage: function (name) { @@ -336,14 +336,14 @@ var Texture = new Class({ /** * Adds a data source image to this Texture. - * + * * An example of a data source image would be a normal map, where all of the Frames for this Texture * equally apply to the normal map. * * @method Phaser.Textures.Texture#setDataSource * @since 3.0.0 * - * @param {Image|HTMLCanvasElement} data - The source image. + * @param {(Image|HTMLCanvasElement)} data - The source image. */ setDataSource: function (data) { @@ -372,7 +372,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#setFilter * @since 3.0.0 * - * @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode. + * @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode. */ setFilter: function (filterMode) { diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index 21ba55c1b..f27d17fa9 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -611,7 +611,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame to be cloned. + * @param {(string|integer)} frame - The string or index of the Frame to be cloned. * * @return {Phaser.Textures.Frame} A Clone of the given Frame. */ @@ -630,7 +630,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {Phaser.Textures.Frame} A Texture Frame object. */ @@ -677,7 +677,7 @@ var TextureManager = new Class({ * @param {integer} x - The x coordinate of the pixel within the Texture. * @param {integer} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. @@ -724,7 +724,7 @@ var TextureManager = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - [description] * @param {string} key - The unique string-based key of the Texture. - * @param {string|integer} frame - The string or index of the Frame. + * @param {(string|integer)} frame - The string or index of the Frame. * * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. */ diff --git a/src/textures/TextureSource.js b/src/textures/TextureSource.js index 18985e715..f71aae339 100644 --- a/src/textures/TextureSource.js +++ b/src/textures/TextureSource.js @@ -22,7 +22,7 @@ var ScaleModes = require('../renderer/ScaleModes'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. - * @param {Image|HTMLCanvasElement} source - The source image data. + * @param {(Image|HTMLCanvasElement)} source - The source image data. * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. */ @@ -47,7 +47,7 @@ var TextureSource = new Class({ * The source image data. This is either an Image Element, or a Canvas Element. * * @name Phaser.Textures.TextureSource#image - * @type {HTMLImageElement|HTMLCanvasElement} + * @type {(HTMLImageElement|HTMLCanvasElement)} * @since 3.0.0 */ this.image = source; @@ -164,7 +164,7 @@ var TextureSource = new Class({ * @method Phaser.Textures.TextureSource#setFilter * @since 3.0.0 * - * @param {Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST} filterMode - The Filter Mode. + * @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode. */ setFilter: function (filterMode) {