Merge pull request #5340 from 16patsle/Fix_object_types

Add more specific 'object' types, including GO Configs
This commit is contained in:
Richard Davey 2021-09-23 15:30:43 +01:00 committed by GitHub
commit 93db763f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 133 additions and 13 deletions

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

@ -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)
{

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

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

View file

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

View file

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

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

View file

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

View file

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

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