diff --git a/plugins/layer3d/Layer3DCreator.js b/plugins/layer3d/Layer3DCreator.js index 547844caf..07e7da089 100644 --- a/plugins/layer3d/Layer3DCreator.js +++ b/plugins/layer3d/Layer3DCreator.js @@ -16,7 +16,7 @@ var Layer3D = require('./Layer3D'); * @method Phaser.GameObjects.GameObjectCreator#layer3d * @since 3.50.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Layer3D} The Game Object that was created. diff --git a/src/gameobjects/bitmaptext/ParseRetroFont.js b/src/gameobjects/bitmaptext/ParseRetroFont.js index b6ce7227a..ea18c1e44 100644 --- a/src/gameobjects/bitmaptext/ParseRetroFont.js +++ b/src/gameobjects/bitmaptext/ParseRetroFont.js @@ -16,7 +16,7 @@ var GetValue = require('../../utils/object/GetValue'); * @param {Phaser.Scene} scene - A reference to the Phaser Scene. * @param {Phaser.Types.GameObjects.BitmapText.RetroFontConfig} config - The font configuration object. * - * @return {object} A parsed Bitmap Font data entry for the Bitmap Font cache. + * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} A parsed Bitmap Font data entry for the Bitmap Font cache. */ var ParseRetroFont = function (scene, config) { diff --git a/src/gameobjects/blitter/BlitterCreator.js b/src/gameobjects/blitter/BlitterCreator.js index f7ed4a09e..68d8b979c 100644 --- a/src/gameobjects/blitter/BlitterCreator.js +++ b/src/gameobjects/blitter/BlitterCreator.js @@ -17,7 +17,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); * @method Phaser.GameObjects.GameObjectCreator#blitter * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Blitter} The Game Object that was created. diff --git a/src/gameobjects/container/ContainerCreator.js b/src/gameobjects/container/ContainerCreator.js index e1d6361a1..8c2e42304 100644 --- a/src/gameobjects/container/ContainerCreator.js +++ b/src/gameobjects/container/ContainerCreator.js @@ -18,7 +18,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); * @method Phaser.GameObjects.GameObjectCreator#container * @since 3.4.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Container.ContainerConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Container} The Game Object that was created. diff --git a/src/gameobjects/container/typedefs/ContainerConfig.js b/src/gameobjects/container/typedefs/ContainerConfig.js new file mode 100644 index 000000000..aabf189c2 --- /dev/null +++ b/src/gameobjects/container/typedefs/ContainerConfig.js @@ -0,0 +1,7 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Container.ContainerConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.50.0 + * + * @property {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to the Container. + */ diff --git a/src/gameobjects/container/typedefs/index.js b/src/gameobjects/container/typedefs/index.js new file mode 100644 index 000000000..5ec4169f8 --- /dev/null +++ b/src/gameobjects/container/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Container + */ diff --git a/src/gameobjects/graphics/GraphicsCreator.js b/src/gameobjects/graphics/GraphicsCreator.js index 0437ba08c..8cc4ec7b1 100644 --- a/src/gameobjects/graphics/GraphicsCreator.js +++ b/src/gameobjects/graphics/GraphicsCreator.js @@ -15,7 +15,7 @@ var Graphics = require('./Graphics'); * @method Phaser.GameObjects.GameObjectCreator#graphics * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Graphics.Options} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Graphics} The Game Object that was created. diff --git a/src/gameobjects/image/ImageCreator.js b/src/gameobjects/image/ImageCreator.js index a9487f96e..f95d376cc 100644 --- a/src/gameobjects/image/ImageCreator.js +++ b/src/gameobjects/image/ImageCreator.js @@ -17,7 +17,7 @@ var Image = require('./Image'); * @method Phaser.GameObjects.GameObjectCreator#image * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Image} The Game Object that was created. diff --git a/src/gameobjects/layer/LayerCreator.js b/src/gameobjects/layer/LayerCreator.js index 18fb8a58e..f21af7680 100644 --- a/src/gameobjects/layer/LayerCreator.js +++ b/src/gameobjects/layer/LayerCreator.js @@ -17,7 +17,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); * @method Phaser.GameObjects.GameObjectCreator#layer * @since 3.50.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Layer} The Game Object that was created. diff --git a/src/gameobjects/mesh/MeshCreator.js b/src/gameobjects/mesh/MeshCreator.js index 4125d4024..6f9634cb9 100644 --- a/src/gameobjects/mesh/MeshCreator.js +++ b/src/gameobjects/mesh/MeshCreator.js @@ -18,7 +18,7 @@ var Mesh = require('./Mesh'); * @method Phaser.GameObjects.GameObjectCreator#mesh * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Mesh.MeshConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. diff --git a/src/gameobjects/mesh/typedefs/MeshConfig.js b/src/gameobjects/mesh/typedefs/MeshConfig.js new file mode 100644 index 000000000..f16873783 --- /dev/null +++ b/src/gameobjects/mesh/typedefs/MeshConfig.js @@ -0,0 +1,15 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Mesh.MeshConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.0.0 + * + * @property {string} [key] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @property {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @property {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @property {number[]} [uvs] - The UVs pairs array. + * @property {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @property {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @property {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @property {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @property {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ diff --git a/src/gameobjects/mesh/typedefs/index.js b/src/gameobjects/mesh/typedefs/index.js new file mode 100644 index 000000000..be2056cb7 --- /dev/null +++ b/src/gameobjects/mesh/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Mesh + */ diff --git a/src/gameobjects/particles/ParticleManagerCreator.js b/src/gameobjects/particles/ParticleManagerCreator.js index 4c1c9f386..69b87c7f2 100644 --- a/src/gameobjects/particles/ParticleManagerCreator.js +++ b/src/gameobjects/particles/ParticleManagerCreator.js @@ -17,7 +17,7 @@ var ParticleEmitterManager = require('./ParticleEmitterManager'); * @method Phaser.GameObjects.GameObjectCreator#particles * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterManagerConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. diff --git a/src/gameobjects/particles/typedefs/ParticleEmitterManagerConfig.js b/src/gameobjects/particles/typedefs/ParticleEmitterManagerConfig.js new file mode 100644 index 000000000..e2fae4dab --- /dev/null +++ b/src/gameobjects/particles/typedefs/ParticleEmitterManagerConfig.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Particles.ParticleEmitterManagerConfig + * @since 3.0.0 + * + * @property {string} [key] - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. + * @property {(number|string)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. + * @property {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. + */ diff --git a/src/gameobjects/rope/RopeCreator.js b/src/gameobjects/rope/RopeCreator.js index b133dc605..263e29a71 100644 --- a/src/gameobjects/rope/RopeCreator.js +++ b/src/gameobjects/rope/RopeCreator.js @@ -18,7 +18,7 @@ var Rope = require('./Rope'); * @method Phaser.GameObjects.GameObjectCreator#rope * @since 3.23.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Rope.RopeConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Rope} The Game Object that was created. diff --git a/src/gameobjects/rope/typedefs/RopeConfig.js b/src/gameobjects/rope/typedefs/RopeConfig.js new file mode 100644 index 000000000..5580186b2 --- /dev/null +++ b/src/gameobjects/rope/typedefs/RopeConfig.js @@ -0,0 +1,12 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Rope.RopeConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.50.0 + * + * @property {string} [key] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. If not given, `__DEFAULT` is used. + * @property {(string|integer|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @property {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. + * @property {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? + * @property {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. + * @property {number[]} [alphas] - An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. + */ diff --git a/src/gameobjects/rope/typedefs/index.js b/src/gameobjects/rope/typedefs/index.js new file mode 100644 index 000000000..df11e152c --- /dev/null +++ b/src/gameobjects/rope/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Rope + */ diff --git a/src/gameobjects/shader/ShaderCreator.js b/src/gameobjects/shader/ShaderCreator.js index f9a80950a..ea8237ff3 100644 --- a/src/gameobjects/shader/ShaderCreator.js +++ b/src/gameobjects/shader/ShaderCreator.js @@ -17,7 +17,7 @@ var Shader = require('./Shader'); * @method Phaser.GameObjects.GameObjectCreator#shader * @since 3.17.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Shader.ShaderConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Shader} The Game Object that was created. diff --git a/src/gameobjects/shader/typedefs/ShaderConfig.js b/src/gameobjects/shader/typedefs/ShaderConfig.js new file mode 100644 index 000000000..22cd44365 --- /dev/null +++ b/src/gameobjects/shader/typedefs/ShaderConfig.js @@ -0,0 +1,9 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Shader.ShaderConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.50.0 + * + * @property {(string|Phaser.Display.BaseShader)} key - The key of the shader to use from the shader cache, or a BaseShader instance. + * @property {number} [width=128] - The width of the Game Object. + * @property {number} [height=128] - The height of the Game Object. + */ diff --git a/src/gameobjects/shader/typedefs/index.js b/src/gameobjects/shader/typedefs/index.js new file mode 100644 index 000000000..43bdf5975 --- /dev/null +++ b/src/gameobjects/shader/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Shader + */ diff --git a/src/gameobjects/video/VideoCreator.js b/src/gameobjects/video/VideoCreator.js index 24adcdbb6..237109fa1 100644 --- a/src/gameobjects/video/VideoCreator.js +++ b/src/gameobjects/video/VideoCreator.js @@ -17,7 +17,7 @@ var Video = require('./Video'); * @method Phaser.GameObjects.GameObjectCreator#video * @since 3.20.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Video.VideoConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * * @return {Phaser.GameObjects.Video} The Game Object that was created. diff --git a/src/gameobjects/video/typedefs/VideoConfig.js b/src/gameobjects/video/typedefs/VideoConfig.js new file mode 100644 index 000000000..37d75640e --- /dev/null +++ b/src/gameobjects/video/typedefs/VideoConfig.js @@ -0,0 +1,7 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Video.VideoConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.50.0 + * + * @property {string} [key] - Optional key of the Video this Game Object will play, as stored in the Video Cache. + */ diff --git a/src/gameobjects/video/typedefs/index.js b/src/gameobjects/video/typedefs/index.js new file mode 100644 index 000000000..894fb1df3 --- /dev/null +++ b/src/gameobjects/video/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Video + */ diff --git a/src/gameobjects/zone/ZoneCreator.js b/src/gameobjects/zone/ZoneCreator.js index 2b2ba09da..a7817b65c 100644 --- a/src/gameobjects/zone/ZoneCreator.js +++ b/src/gameobjects/zone/ZoneCreator.js @@ -16,7 +16,7 @@ var Zone = require('./Zone'); * @method Phaser.GameObjects.GameObjectCreator#zone * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {Phaser.Types.GameObjects.Zone.ZoneConfig} config - The configuration object this Game Object will use to create itself. * * @return {Phaser.GameObjects.Zone} The Game Object that was created. */ diff --git a/src/gameobjects/zone/typedefs/ZoneConfig.js b/src/gameobjects/zone/typedefs/ZoneConfig.js new file mode 100644 index 000000000..44f1d6959 --- /dev/null +++ b/src/gameobjects/zone/typedefs/ZoneConfig.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.GameObjects.Zone.ZoneConfig + * @extends Phaser.Types.GameObjects.GameObjectConfig + * @since 3.50.0 + * + * @property {number} [width=1] - The width of the Game Object. + * @property {number} [height=1] - The height of the Game Object. + */ diff --git a/src/gameobjects/zone/typedefs/index.js b/src/gameobjects/zone/typedefs/index.js new file mode 100644 index 000000000..98d3bb3c1 --- /dev/null +++ b/src/gameobjects/zone/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.GameObjects.Zone + */