From f1e646c9eecca826d3832051c0743ddff35ffc2e Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Wed, 28 Mar 2018 15:39:57 +0100 Subject: [PATCH] jsdoc fixes --- src/physics/impact/TYPE.js | 10 ++--- src/physics/impact/World.js | 4 +- src/physics/matter-js/Factory.js | 8 ++-- src/physics/matter-js/MatterTileBody.js | 4 +- src/physics/matter-js/World.js | 4 +- src/physics/matter-js/index.js | 57 +++++++++++++++++++++++++ src/renderer/canvas/index.js | 2 +- src/scene/Systems.js | 2 +- src/textures/index.js | 23 ++++++++-- 9 files changed, 92 insertions(+), 22 deletions(-) diff --git a/src/physics/impact/TYPE.js b/src/physics/impact/TYPE.js index 9b99b1c06..0d89d0d53 100644 --- a/src/physics/impact/TYPE.js +++ b/src/physics/impact/TYPE.js @@ -13,7 +13,7 @@ * with other LITE or PASSIVE entities at all. The behavior for FIXED vs. * FIXED collisions is undefined. * - * @name Phaser.Physics.Impact.TYPES + * @name Phaser.Physics.Impact.TYPE * @type {object} * @since 3.0.0 */ @@ -22,7 +22,7 @@ module.exports = { /** * Collides with nothing. * - * @name Phaser.Physics.Impact.TYPES.NONE + * @name Phaser.Physics.Impact.TYPE.NONE * @type {integer} * @since 3.0.0 */ @@ -31,7 +31,7 @@ module.exports = { /** * Type A. Collides with Type B. * - * @name Phaser.Physics.Impact.TYPES.A + * @name Phaser.Physics.Impact.TYPE.A * @type {integer} * @since 3.0.0 */ @@ -40,7 +40,7 @@ module.exports = { /** * Type B. Collides with Type A. * - * @name Phaser.Physics.Impact.TYPES.B + * @name Phaser.Physics.Impact.TYPE.B * @type {integer} * @since 3.0.0 */ @@ -49,7 +49,7 @@ module.exports = { /** * Collides with both types A and B. * - * @name Phaser.Physics.Impact.TYPES.BOTH + * @name Phaser.Physics.Impact.TYPE.BOTH * @type {integer} * @since 3.0.0 */ diff --git a/src/physics/impact/World.js b/src/physics/impact/World.js index e0f63255a..57830ccc6 100644 --- a/src/physics/impact/World.js +++ b/src/physics/impact/World.js @@ -23,7 +23,6 @@ var TYPE = require('./TYPE'); * @property {number} [cellSize=64] - [description] * @property {number} [timeScale=1] - [description] * @property {float} [maxStep=0.05] - [description] - * @property {number} [gravity=0] - [description] * @property {boolean} [debug=false] - [description] * @property {number} [maxVelocity=100] - [description] * @property {boolean} [debugShowBody=true] - [description] @@ -38,7 +37,6 @@ var TYPE = require('./TYPE'); * @property {(object|boolean)} [setBounds] - [description] * @property {number} [setBounds.x=0] - [description] * @property {number} [setBounds.y=0] - [description] - * @property {number} [setBounds.x=0] - [description] * @property {number} [setBounds.width] - [description] * @property {number} [setBounds.height] - [description] * @property {number} [setBounds.thickness=64] - [description] @@ -334,7 +332,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 {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} 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 4b7c6180b..0f583ee3b 100644 --- a/src/physics/matter-js/Factory.js +++ b/src/physics/matter-js/Factory.js @@ -530,7 +530,7 @@ var Factory = new Class({ * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {object} [options={}] - [description] * - * @return {Phaser.Physics.Matter.MatterImage} [description] + * @return {Phaser.Physics.Matter.Image} [description] */ image: function (x, y, key, frame, options) { @@ -547,10 +547,10 @@ var Factory = new Class({ * @method Phaser.Physics.Matter.Factory#tileBody * @since 3.0.0 * - * @param {Phaser.GameObjects.Tile} tile - [description] + * @param {Phaser.Tilemaps.Tile} tile - [description] * @param {object} options - [description] * - * @return {Phaser.Physics.Matter.MatterTileBody} [description] + * @return {Phaser.Physics.Matter.TileBody} [description] */ tileBody: function (tile, options) { @@ -571,7 +571,7 @@ var Factory = new Class({ * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {object} [options={}] - [description] * - * @return {Phaser.Physics.Matter.MatterSprite} [description] + * @return {Phaser.Physics.Matter.Sprite} [description] */ sprite: function (x, y, key, frame, options) { diff --git a/src/physics/matter-js/MatterTileBody.js b/src/physics/matter-js/MatterTileBody.js index d2682e1df..a64a5fe90 100644 --- a/src/physics/matter-js/MatterTileBody.js +++ b/src/physics/matter-js/MatterTileBody.js @@ -40,7 +40,7 @@ var Vertices = require('./lib/geometry/Vertices'); * @extends Phaser.Physics.Matter.Components.Static * * @param {Phaser.Physics.Matter.World} world - [description] - * @param {Phaser.GameObjects.Tile} tile - The target tile that should have a Matter body. + * @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body. * @param {object} [options] - Options to be used when creating the Matter body. See * Phaser.Physics.Matter.Matter.Body for a list of what Matter accepts. * @param {Phaser.Physics.Matter.Matter.Body} [options.body=null] - An existing Matter body to @@ -71,7 +71,7 @@ var MatterTileBody = new Class({ * The tile object the body is associated with. * * @name Phaser.Physics.Matter.TileBody#tile - * @type {Phaser.GameObjects.Tile} + * @type {Phaser.Tilemaps.Tile} * @since 3.0.0 */ this.tile = tile; diff --git a/src/physics/matter-js/World.js b/src/physics/matter-js/World.js index f86d74208..3095959f6 100644 --- a/src/physics/matter-js/World.js +++ b/src/physics/matter-js/World.js @@ -530,7 +530,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.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - * An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@ee Phaser.Physics.Matter.TileBody} * @@ -553,7 +553,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#convertTiles * @since 3.0.0 * - * @param {Phaser.GameObjects.Tile[]} tiles - An array of tiles. + * @param {Phaser.Tilemaps.Tile[]} tiles - An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} * * @return {Phaser.Physics.Matter.World} This Matter World object. diff --git a/src/physics/matter-js/index.js b/src/physics/matter-js/index.js index ddb963488..c52f21259 100644 --- a/src/physics/matter-js/index.js +++ b/src/physics/matter-js/index.js @@ -20,3 +20,60 @@ module.exports = { World: require('./World') }; + +/** + * @namespace Matter + */ + +/** + * @classdesc + * The `Matter.Body` module contains methods for creating and manipulating body models. + * A `Matter.Body` is a rigid body that can be simulated by a `Matter.Engine`. + * Factories for commonly used body configurations (such as rectangles, circles and other polygons) can be found in the module `Matter.Bodies`. + * + * @class Body + * @memberOf Matter + */ + +/** + * @classdesc + * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. + * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. + * It is important to use the functions in this module to modify composites, rather than directly modifying their properties. + * Note that the `Matter.World` object is also a type of `Matter.Composite` and as such all composite methods here can also operate on a `Matter.World`. + * + * @class Composite + * @memberOf Matter + */ + +/** + * @classdesc + * The `Matter.World` module contains methods for creating and manipulating the world composite. + * A `Matter.World` is a `Matter.Composite` body, which is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`. + * A `Matter.World` has a few additional properties including `gravity` and `bounds`. + * It is important to use the functions in the `Matter.Composite` module to modify the world composite, rather than directly modifying its properties. + * There are also a few methods here that alias those in `Matter.Composite` for easier readability. + * + * @class World + * @extends Matter.Composite + * @memberOf Matter + */ + +/** + * @classdesc + * The `Matter.Constraint` module contains methods for creating and manipulating constraints. + * Constraints are used for specifying that a fixed distance must be maintained between two bodies (or a body and a fixed world-space position). + * The stiffness of constraints can be modified to create springs or elastic. + * + * @class Constraint + * @memberOf Matter + */ + +/** + * @classdesc + * The `Matter.Engine` module contains methods for creating and manipulating engines. + * An engine is a controller that manages updating the simulation of the world. + * + * @class Engine + * @memberOf Matter + */ diff --git a/src/renderer/canvas/index.js b/src/renderer/canvas/index.js index 9996a2555..8cec395ff 100644 --- a/src/renderer/canvas/index.js +++ b/src/renderer/canvas/index.js @@ -10,8 +10,8 @@ module.exports = { - CanvasRenderer: require('./CanvasRenderer'), BlitImage: require('./utils/BlitImage'), + CanvasRenderer: require('./CanvasRenderer'), DrawImage: require('./utils/DrawImage'), GetBlendModes: require('./utils/GetBlendModes') diff --git a/src/scene/Systems.js b/src/scene/Systems.js index dc067d0be..3704c72e2 100644 --- a/src/scene/Systems.js +++ b/src/scene/Systems.js @@ -111,7 +111,7 @@ var Systems = new Class({ * [description] * * @name Phaser.Scenes.Systems#plugins - * @type {Phaser.Plugins.PluginManager} + * @type {Phaser.Boot.PluginManager} * @since 3.0.0 */ this.plugins; diff --git a/src/textures/index.js b/src/textures/index.js index f5aa760b0..cc5a9963c 100644 --- a/src/textures/index.js +++ b/src/textures/index.js @@ -18,11 +18,26 @@ var Textures = { Frame: require('./Frame'), Texture: require('./Texture'), TextureManager: require('./TextureManager'), - TextureSource: require('./TextureSource') + TextureSource: require('./TextureSource'), + + /** + * Linear filter type. + * + * @name Phaser.Textures.LINEAR + * @type {integer} + * @since 3.0.0 + */ + LINEAR: 0, + + /** + * Nearest neighbor filter type. + * + * @name Phaser.Textures.NEAREST + * @type {integer} + * @since 3.0.0 + */ + NEAREST: 1 }; -// Merge in the consts -Textures = Extend(false, Textures, CONST); - module.exports = Textures;