mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Merge pull request #5340 from 16patsle/Fix_object_types
Add more specific 'object' types, including GO Configs
This commit is contained in:
commit
93db763f69
26 changed files with 133 additions and 13 deletions
|
@ -16,7 +16,7 @@ var Layer3D = require('./Layer3D');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#layer3d
|
* @method Phaser.GameObjects.GameObjectCreator#layer3d
|
||||||
* @since 3.50.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Layer3D} The Game Object that was created.
|
||||||
|
|
|
@ -16,7 +16,7 @@ var GetValue = require('../../utils/object/GetValue');
|
||||||
* @param {Phaser.Scene} scene - A reference to the Phaser Scene.
|
* @param {Phaser.Scene} scene - A reference to the Phaser Scene.
|
||||||
* @param {Phaser.Types.GameObjects.BitmapText.RetroFontConfig} config - The font configuration object.
|
* @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)
|
var ParseRetroFont = function (scene, config)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#blitter
|
* @method Phaser.GameObjects.GameObjectCreator#blitter
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Blitter} The Game Object that was created.
|
||||||
|
|
|
@ -18,7 +18,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#container
|
* @method Phaser.GameObjects.GameObjectCreator#container
|
||||||
* @since 3.4.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Container} The Game Object that was created.
|
||||||
|
|
7
src/gameobjects/container/typedefs/ContainerConfig.js
Normal file
7
src/gameobjects/container/typedefs/ContainerConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/container/typedefs/index.js
Normal file
9
src/gameobjects/container/typedefs/index.js
Normal 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
|
||||||
|
*/
|
|
@ -15,7 +15,7 @@ var Graphics = require('./Graphics');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#graphics
|
* @method Phaser.GameObjects.GameObjectCreator#graphics
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Graphics} The Game Object that was created.
|
||||||
|
|
|
@ -17,7 +17,7 @@ var Image = require('./Image');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#image
|
* @method Phaser.GameObjects.GameObjectCreator#image
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Image} The Game Object that was created.
|
||||||
|
|
|
@ -17,7 +17,7 @@ var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#layer
|
* @method Phaser.GameObjects.GameObjectCreator#layer
|
||||||
* @since 3.50.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Layer} The Game Object that was created.
|
||||||
|
|
|
@ -18,7 +18,7 @@ var Mesh = require('./Mesh');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#mesh
|
* @method Phaser.GameObjects.GameObjectCreator#mesh
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Mesh} The Game Object that was created.
|
||||||
|
|
15
src/gameobjects/mesh/typedefs/MeshConfig.js
Normal file
15
src/gameobjects/mesh/typedefs/MeshConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/mesh/typedefs/index.js
Normal file
9
src/gameobjects/mesh/typedefs/index.js
Normal 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
|
||||||
|
*/
|
|
@ -17,7 +17,7 @@ var ParticleEmitterManager = require('./ParticleEmitterManager');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#particles
|
* @method Phaser.GameObjects.GameObjectCreator#particles
|
||||||
* @since 3.0.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created.
|
||||||
|
|
|
@ -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.
|
||||||
|
*/
|
|
@ -18,7 +18,7 @@ var Rope = require('./Rope');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#rope
|
* @method Phaser.GameObjects.GameObjectCreator#rope
|
||||||
* @since 3.23.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Rope} The Game Object that was created.
|
||||||
|
|
12
src/gameobjects/rope/typedefs/RopeConfig.js
Normal file
12
src/gameobjects/rope/typedefs/RopeConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/rope/typedefs/index.js
Normal file
9
src/gameobjects/rope/typedefs/index.js
Normal 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
|
||||||
|
*/
|
|
@ -17,7 +17,7 @@ var Shader = require('./Shader');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#shader
|
* @method Phaser.GameObjects.GameObjectCreator#shader
|
||||||
* @since 3.17.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Shader} The Game Object that was created.
|
||||||
|
|
9
src/gameobjects/shader/typedefs/ShaderConfig.js
Normal file
9
src/gameobjects/shader/typedefs/ShaderConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/shader/typedefs/index.js
Normal file
9
src/gameobjects/shader/typedefs/index.js
Normal 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
|
||||||
|
*/
|
|
@ -17,7 +17,7 @@ var Video = require('./Video');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#video
|
* @method Phaser.GameObjects.GameObjectCreator#video
|
||||||
* @since 3.20.0
|
* @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.
|
* @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.
|
* @return {Phaser.GameObjects.Video} The Game Object that was created.
|
||||||
|
|
7
src/gameobjects/video/typedefs/VideoConfig.js
Normal file
7
src/gameobjects/video/typedefs/VideoConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/video/typedefs/index.js
Normal file
9
src/gameobjects/video/typedefs/index.js
Normal 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
|
||||||
|
*/
|
|
@ -16,7 +16,7 @@ var Zone = require('./Zone');
|
||||||
* @method Phaser.GameObjects.GameObjectCreator#zone
|
* @method Phaser.GameObjects.GameObjectCreator#zone
|
||||||
* @since 3.0.0
|
* @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.
|
* @return {Phaser.GameObjects.Zone} The Game Object that was created.
|
||||||
*/
|
*/
|
||||||
|
|
8
src/gameobjects/zone/typedefs/ZoneConfig.js
Normal file
8
src/gameobjects/zone/typedefs/ZoneConfig.js
Normal 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.
|
||||||
|
*/
|
9
src/gameobjects/zone/typedefs/index.js
Normal file
9
src/gameobjects/zone/typedefs/index.js
Normal 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
|
||||||
|
*/
|
Loading…
Reference in a new issue