Add Config typedefs for a bunch of GO Creators

This commit is contained in:
Patrick Sletvold 2020-10-03 10:40:24 +02:00
parent 79114a00e5
commit c1d63d32dd
No known key found for this signature in database
GPG key ID: 804D4E1435C33225
20 changed files with 98 additions and 10 deletions

View file

@ -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.

View file

@ -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.

View file

@ -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.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Types.GameObjects.Container
*/

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -17,7 +17,7 @@ var Quad = require('./Quad');
* @method Phaser.GameObjects.GameObjectCreator#quad
* @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.Quad} The Game Object that was created.

View file

@ -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.

View file

@ -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.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Types.GameObjects.Rope
*/

View file

@ -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.

View file

@ -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.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Types.GameObjects.Shader
*/

View file

@ -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.

View file

@ -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.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Types.GameObjects.Video
*/

View file

@ -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.
*/

View file

@ -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.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* @namespace Phaser.Types.GameObjects.Zone
*/