mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Moving all of the typedefs to properly namespaced scopes, rather than globals
\o/ ~ "Someone, save me!"
This commit is contained in:
parent
b50e1c78b5
commit
e7b1d086e7
141 changed files with 1031 additions and 906 deletions
|
@ -12,20 +12,6 @@ var Zone = require('../gameobjects/zone/Zone');
|
|||
|
||||
var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1);
|
||||
|
||||
/**
|
||||
* @typedef {object} GridAlignConfig
|
||||
*
|
||||
* @property {integer} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity.
|
||||
* If both this value and height are set to -1 then this value overrides it and the `height` value is ignored.
|
||||
* @property {integer} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity.
|
||||
* If both this value and `width` are set to -1 then `width` overrides it and this value is ignored.
|
||||
* @property {integer} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned.
|
||||
* @property {integer} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned.
|
||||
* @property {integer} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`.
|
||||
* @property {number} [x=0] - Optionally place the top-left of the final grid at this coordinate.
|
||||
* @property {number} [y=0] - Optionally place the top-left of the final grid at this coordinate.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Takes an array of Game Objects, or any objects that have public `x` and `y` properties,
|
||||
* and then aligns them based on the grid configuration given to this action.
|
||||
|
@ -36,7 +22,7 @@ var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } }
|
|||
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
|
||||
*
|
||||
* @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.
|
||||
* @param {GridAlignConfig} options - The GridAlign Configuration object.
|
||||
* @param {Phaser.Actions.Types.GridAlignConfig} options - The GridAlign Configuration object.
|
||||
*
|
||||
* @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.
|
||||
*/
|
||||
|
|
14
src/actions/typedefs/GridAlignConfig.js
Normal file
14
src/actions/typedefs/GridAlignConfig.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Actions.Types.GridAlignConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {integer} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity.
|
||||
* If both this value and height are set to -1 then this value overrides it and the `height` value is ignored.
|
||||
* @property {integer} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity.
|
||||
* If both this value and `width` are set to -1 then `width` overrides it and this value is ignored.
|
||||
* @property {integer} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned.
|
||||
* @property {integer} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned.
|
||||
* @property {integer} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`.
|
||||
* @property {number} [x=0] - Optionally place the top-left of the final grid at this coordinate.
|
||||
* @property {number} [y=0] - Optionally place the top-left of the final grid at this coordinate.
|
||||
*/
|
6
src/actions/typedefs/GroupCallback.js
Normal file
6
src/actions/typedefs/GroupCallback.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* @callback Phaser.GameObjects.Group.Types.GroupCallback
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} item - A group member
|
||||
*/
|
14
src/actions/typedefs/GroupClassTypeConstructor.js
Normal file
14
src/actions/typedefs/GroupClassTypeConstructor.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* A constructor function (class) that can be assigned to `classType`.
|
||||
*
|
||||
* @callback Phaser.GameObjects.Group.Types.GroupClassTypeConstructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
|
||||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @see Phaser.GameObjects.Group#classType
|
||||
*/
|
6
src/actions/typedefs/GroupMultipleCreateCallback.js
Normal file
6
src/actions/typedefs/GroupMultipleCreateCallback.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* @callback Phaser.GameObjects.Group.Types.GroupMultipleCreateCallback
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject[]} items - The newly created group members
|
||||
*/
|
9
src/actions/typedefs/index.js
Normal file
9
src/actions/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Actions.Types
|
||||
*/
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.Animation
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} [key] - The key that the animation will be associated with. i.e. sprite.animations.play(key)
|
||||
* @property {Phaser.Animations.Types.AnimationFrame[]} [frames] - An object containing data used to generate the frames for the animation
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.AnimationFrame
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
|
||||
* @property {(string|number)} frame - [description]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.GenerateFrameNames
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} [prefix=''] - The string to append to every resulting frame name if using a range or an array of `frames`.
|
||||
* @property {integer} [start=0] - If `frames` is not provided, the number of the first frame to return.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.GenerateFrameNumbers
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {integer} [start=0] - The starting frame of the animation.
|
||||
* @property {integer} [end=-1] - The ending frame of the animation.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.JSONAnimation
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
|
||||
* @property {string} type - A frame based animation (as opposed to a bone based animation)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.JSONAnimationFrame
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} key - The key of the Texture this AnimationFrame uses.
|
||||
* @property {(string|integer)} frame - The key of the Frame within the Texture that this AnimationFrame uses.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Animations.Types.JSONAnimations
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.Animations.Types.JSONAnimation[]} anims - An array of all Animations added to the Animation Manager.
|
||||
* @property {number} globalTimeScale - The global time scale of the Animation Manager.
|
||||
|
|
|
@ -14,31 +14,6 @@ var TransformMatrix = require('../../gameobjects/components/TransformMatrix');
|
|||
var ValueToColor = require('../../display/color/ValueToColor');
|
||||
var Vector2 = require('../../math/Vector2');
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONCameraBounds
|
||||
* @property {number} x - The horizontal position of camera
|
||||
* @property {number} y - The vertical position of camera
|
||||
* @property {number} width - The width size of camera
|
||||
* @property {number} height - The height size of camera
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONCamera
|
||||
*
|
||||
* @property {string} name - The name of the camera
|
||||
* @property {number} x - The horizontal position of camera
|
||||
* @property {number} y - The vertical position of camera
|
||||
* @property {number} width - The width size of camera
|
||||
* @property {number} height - The height size of camera
|
||||
* @property {number} zoom - The zoom of camera
|
||||
* @property {number} rotation - The rotation of camera
|
||||
* @property {boolean} roundPixels - The round pixels st status of camera
|
||||
* @property {number} scrollX - The horizontal scroll of camera
|
||||
* @property {number} scrollY - The vertical scroll of camera
|
||||
* @property {string} backgroundColor - The background color of camera
|
||||
* @property {(JSONCameraBounds|undefined)} [bounds] - The bounds of camera
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Base Camera class.
|
||||
|
@ -1079,7 +1054,7 @@ var BaseCamera = new Class({
|
|||
* @method Phaser.Cameras.Scene2D.BaseCamera#setBackgroundColor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|number|InputColorObject)} [color='rgba(0,0,0,0)'] - The color value. In CSS, hex or numeric color notation.
|
||||
* @param {(string|number|Phaser.Display.Types.InputColorObject)} [color='rgba(0,0,0,0)'] - The color value. In CSS, hex or numeric color notation.
|
||||
*
|
||||
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
|
||||
*/
|
||||
|
@ -1423,7 +1398,7 @@ var BaseCamera = new Class({
|
|||
* @method Phaser.Cameras.Scene2D.BaseCamera#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONCamera} A well-formed object suitable for conversion to JSON.
|
||||
* @return {Phaser.Cameras.Scene2D.Types.JSONCamera} A well-formed object suitable for conversion to JSON.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -11,27 +11,6 @@ var PluginCache = require('../../plugins/PluginCache');
|
|||
var RectangleContains = require('../../geom/rectangle/Contains');
|
||||
var SceneEvents = require('../../scene/events');
|
||||
|
||||
/**
|
||||
* @typedef {object} InputJSONCameraObject
|
||||
*
|
||||
* @property {string} [name=''] - The name of the Camera.
|
||||
* @property {integer} [x=0] - The horizontal position of the Camera viewport.
|
||||
* @property {integer} [y=0] - The vertical position of the Camera viewport.
|
||||
* @property {integer} [width] - The width of the Camera viewport.
|
||||
* @property {integer} [height] - The height of the Camera viewport.
|
||||
* @property {number} [zoom=1] - The default zoom level of the Camera.
|
||||
* @property {number} [rotation=0] - The rotation of the Camera, in radians.
|
||||
* @property {boolean} [roundPixels=false] - Should the Camera round pixels before rendering?
|
||||
* @property {number} [scrollX=0] - The horizontal scroll position of the Camera.
|
||||
* @property {number} [scrollY=0] - The vertical scroll position of the Camera.
|
||||
* @property {(false|string)} [backgroundColor=false] - A CSS color string controlling the Camera background color.
|
||||
* @property {?object} [bounds] - Defines the Camera bounds.
|
||||
* @property {number} [bounds.x=0] - The top-left extent of the Camera bounds.
|
||||
* @property {number} [bounds.y=0] - The top-left extent of the Camera bounds.
|
||||
* @property {number} [bounds.width] - The width of the Camera bounds.
|
||||
* @property {number} [bounds.height] - The height of the Camera bounds.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras.
|
||||
|
@ -391,12 +370,12 @@ var CameraManager = new Class({
|
|||
/**
|
||||
* Populates this Camera Manager based on the given configuration object, or an array of config objects.
|
||||
*
|
||||
* See the `InputJSONCameraObject` documentation for details of the object structure.
|
||||
* See the `Phaser.Cameras.Scene2D.Types.CameraConfig` documentation for details of the object structure.
|
||||
*
|
||||
* @method Phaser.Cameras.Scene2D.CameraManager#fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(InputJSONCameraObject|InputJSONCameraObject[])} config - A Camera configuration object, or an array of them, to be added to this Camera Manager.
|
||||
* @param {(Phaser.Cameras.Scene2D.Types.CameraConfig|Phaser.Cameras.Scene2D.Types.CameraConfig[])} config - A Camera configuration object, or an array of them, to be added to this Camera Manager.
|
||||
*
|
||||
* @return {Phaser.Cameras.Scene2D.CameraManager} This Camera Manager instance.
|
||||
*/
|
||||
|
|
21
src/cameras/2d/typedefs/CameraConfig.js
Normal file
21
src/cameras/2d/typedefs/CameraConfig.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Cameras.Scene2D.Types.CameraConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} [name=''] - The name of the Camera.
|
||||
* @property {integer} [x=0] - The horizontal position of the Camera viewport.
|
||||
* @property {integer} [y=0] - The vertical position of the Camera viewport.
|
||||
* @property {integer} [width] - The width of the Camera viewport.
|
||||
* @property {integer} [height] - The height of the Camera viewport.
|
||||
* @property {number} [zoom=1] - The default zoom level of the Camera.
|
||||
* @property {number} [rotation=0] - The rotation of the Camera, in radians.
|
||||
* @property {boolean} [roundPixels=false] - Should the Camera round pixels before rendering?
|
||||
* @property {number} [scrollX=0] - The horizontal scroll position of the Camera.
|
||||
* @property {number} [scrollY=0] - The vertical scroll position of the Camera.
|
||||
* @property {(false|string)} [backgroundColor=false] - A CSS color string controlling the Camera background color.
|
||||
* @property {?object} [bounds] - Defines the Camera bounds.
|
||||
* @property {number} [bounds.x=0] - The top-left extent of the Camera bounds.
|
||||
* @property {number} [bounds.y=0] - The top-left extent of the Camera bounds.
|
||||
* @property {number} [bounds.width] - The width of the Camera bounds.
|
||||
* @property {number} [bounds.height] - The height of the Camera bounds.
|
||||
*/
|
17
src/cameras/2d/typedefs/JSONCamera.js
Normal file
17
src/cameras/2d/typedefs/JSONCamera.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Cameras.Scene2D.Types.JSONCamera
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} name - The name of the camera
|
||||
* @property {number} x - The horizontal position of camera
|
||||
* @property {number} y - The vertical position of camera
|
||||
* @property {number} width - The width size of camera
|
||||
* @property {number} height - The height size of camera
|
||||
* @property {number} zoom - The zoom of camera
|
||||
* @property {number} rotation - The rotation of camera
|
||||
* @property {boolean} roundPixels - The round pixels st status of camera
|
||||
* @property {number} scrollX - The horizontal scroll of camera
|
||||
* @property {number} scrollY - The vertical scroll of camera
|
||||
* @property {string} backgroundColor - The background color of camera
|
||||
* @property {(Phaser.Cameras.Scene2D.Types.JSONCameraBounds|undefined)} [bounds] - The bounds of camera
|
||||
*/
|
9
src/cameras/2d/typedefs/JSONCameraBounds.js
Normal file
9
src/cameras/2d/typedefs/JSONCameraBounds.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Cameras.Scene2D.Types.JSONCameraBounds
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} x - The horizontal position of camera
|
||||
* @property {number} y - The vertical position of camera
|
||||
* @property {number} width - The width size of camera
|
||||
* @property {number} height - The height size of camera
|
||||
*/
|
9
src/cameras/2d/typedefs/index.js
Normal file
9
src/cameras/2d/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Cameras.Scene2D.Types
|
||||
*/
|
|
@ -7,20 +7,6 @@
|
|||
var Class = require('../../utils/Class');
|
||||
var GetValue = require('../../utils/object/GetValue');
|
||||
|
||||
/**
|
||||
* @typedef {object} FixedKeyControlConfig
|
||||
*
|
||||
* @property {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera that this Control will update.
|
||||
* @property {Phaser.Input.Keyboard.Key} [left] - The Key to be pressed that will move the Camera left.
|
||||
* @property {Phaser.Input.Keyboard.Key} [right] - The Key to be pressed that will move the Camera right.
|
||||
* @property {Phaser.Input.Keyboard.Key} [up] - The Key to be pressed that will move the Camera up.
|
||||
* @property {Phaser.Input.Keyboard.Key} [down] - The Key to be pressed that will move the Camera down.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out.
|
||||
* @property {number} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.
|
||||
* @property {(number|{x:number,y:number})} [speed=0] - The horizontal and vertical speed the camera will move.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Fixed Key Camera Control.
|
||||
|
@ -45,7 +31,7 @@ var GetValue = require('../../utils/object/GetValue');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {FixedKeyControlConfig} config - The Fixed Key Control configuration object.
|
||||
* @param {Phaser.Cameras.Controls.Types.FixedKeyControlConfig} config - The Fixed Key Control configuration object.
|
||||
*/
|
||||
var FixedKeyControl = new Class({
|
||||
|
||||
|
|
|
@ -7,21 +7,6 @@
|
|||
var Class = require('../../utils/Class');
|
||||
var GetValue = require('../../utils/object/GetValue');
|
||||
|
||||
/**
|
||||
* @typedef {object} SmoothedKeyControlConfig
|
||||
*
|
||||
* @property {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera that this Control will update.
|
||||
* @property {Phaser.Input.Keyboard.Key} [left] - The Key to be pressed that will move the Camera left.
|
||||
* @property {Phaser.Input.Keyboard.Key} [right] - The Key to be pressed that will move the Camera right.
|
||||
* @property {Phaser.Input.Keyboard.Key} [up] - The Key to be pressed that will move the Camera up.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out.
|
||||
* @property {number} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.
|
||||
* @property {(number|{x:number,y:number})} [acceleration=0] - The horizontal and vertical acceleration the camera will move.
|
||||
* @property {(number|{x:number,y:number})} [drag=0] - The horizontal and vertical drag applied to the camera when it is moving.
|
||||
* @property {(number|{x:number,y:number})} [maxSpeed=0] - The maximum horizontal and vertical speed the camera will move.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Smoothed Key Camera Control.
|
||||
|
@ -30,7 +15,6 @@ var GetValue = require('../../utils/object/GetValue');
|
|||
* Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects.
|
||||
*
|
||||
* ```javascript
|
||||
*
|
||||
* var controlConfig = {
|
||||
* camera: this.cameras.main,
|
||||
* left: cursors.left,
|
||||
|
@ -53,7 +37,7 @@ var GetValue = require('../../utils/object/GetValue');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {SmoothedKeyControlConfig} config - The Smoothed Key Control configuration object.
|
||||
* @param {Phaser.Cameras.Controls.Types.SmoothedKeyControlConfig} config - The Smoothed Key Control configuration object.
|
||||
*/
|
||||
var SmoothedKeyControl = new Class({
|
||||
|
||||
|
|
14
src/cameras/controls/typedefs/FixedKeyControlConfig.js
Normal file
14
src/cameras/controls/typedefs/FixedKeyControlConfig.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Cameras.Controls.Types.FixedKeyControlConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera that this Control will update.
|
||||
* @property {Phaser.Input.Keyboard.Key} [left] - The Key to be pressed that will move the Camera left.
|
||||
* @property {Phaser.Input.Keyboard.Key} [right] - The Key to be pressed that will move the Camera right.
|
||||
* @property {Phaser.Input.Keyboard.Key} [up] - The Key to be pressed that will move the Camera up.
|
||||
* @property {Phaser.Input.Keyboard.Key} [down] - The Key to be pressed that will move the Camera down.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out.
|
||||
* @property {number} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.
|
||||
* @property {(number|{x:number,y:number})} [speed=0] - The horizontal and vertical speed the camera will move.
|
||||
*/
|
15
src/cameras/controls/typedefs/SmoothedKeyControlConfig.js
Normal file
15
src/cameras/controls/typedefs/SmoothedKeyControlConfig.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Cameras.Controls.Types.SmoothedKeyControlConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera that this Control will update.
|
||||
* @property {Phaser.Input.Keyboard.Key} [left] - The Key to be pressed that will move the Camera left.
|
||||
* @property {Phaser.Input.Keyboard.Key} [right] - The Key to be pressed that will move the Camera right.
|
||||
* @property {Phaser.Input.Keyboard.Key} [up] - The Key to be pressed that will move the Camera up.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomIn] - The Key to be pressed that will zoom the Camera in.
|
||||
* @property {Phaser.Input.Keyboard.Key} [zoomOut] - The Key to be pressed that will zoom the Camera out.
|
||||
* @property {number} [zoomSpeed=0.01] - The speed at which the camera will zoom if the `zoomIn` or `zoomOut` keys are pressed.
|
||||
* @property {(number|{x:number,y:number})} [acceleration=0] - The horizontal and vertical acceleration the camera will move.
|
||||
* @property {(number|{x:number,y:number})} [drag=0] - The horizontal and vertical drag applied to the camera when it is moving.
|
||||
* @property {(number|{x:number,y:number})} [maxSpeed=0] - The maximum horizontal and vertical speed the camera will move.
|
||||
*/
|
9
src/cameras/controls/typedefs/index.js
Normal file
9
src/cameras/controls/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Cameras.Controls.Types
|
||||
*/
|
|
@ -8,34 +8,13 @@ var Arne16 = require('./palettes/Arne16');
|
|||
var CanvasPool = require('../display/canvas/CanvasPool');
|
||||
var GetValue = require('../utils/object/GetValue');
|
||||
|
||||
/**
|
||||
* @callback GenerateTextureRendererCallback
|
||||
*
|
||||
* @param {HTMLCanvasElement} canvas - [description]
|
||||
* @param {CanvasRenderingContext2D} context - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} GenerateTextureConfig
|
||||
*
|
||||
* @property {array} [data=[]] - [description]
|
||||
* @property {HTMLCanvasElement} [canvas=null] - [description]
|
||||
* @property {Palette} [palette=Arne16] - [description]
|
||||
* @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture.
|
||||
* @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture.
|
||||
* @property {boolean} [resizeCanvas=true] - [description]
|
||||
* @property {boolean} [clearCanvas=true] - [description]
|
||||
* @property {GenerateTextureRendererCallback} [preRender] - [description]
|
||||
* @property {GenerateTextureRendererCallback} [postRender] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
*
|
||||
* @function Phaser.Create.GenerateTexture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {GenerateTextureConfig} config - [description]
|
||||
* @param {Phaser.Create.Types.GenerateTextureConfig} config - [description]
|
||||
*
|
||||
* @return {HTMLCanvasElement} [description]
|
||||
*/
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* @name Phaser.Create.Palettes.ARNE16
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {Palette}
|
||||
* @type {Phaser.Create.Types.Palette}
|
||||
*/
|
||||
module.exports = {
|
||||
0: '#000',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* @name Phaser.Create.Palettes.C64
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {Palette}
|
||||
* @type {Phaser.Create.Types.Palette}
|
||||
*/
|
||||
module.exports = {
|
||||
0: '#000',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* @name Phaser.Create.Palettes.CGA
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {Palette}
|
||||
* @type {Phaser.Create.Types.Palette}
|
||||
*/
|
||||
module.exports = {
|
||||
0: '#000',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* @name Phaser.Create.Palettes.JMP
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {Palette}
|
||||
* @type {Phaser.Create.Types.Palette}
|
||||
*/
|
||||
module.exports = {
|
||||
0: '#000',
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* @name Phaser.Create.Palettes.MSX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @type {Palette}
|
||||
* @type {Phaser.Create.Types.Palette}
|
||||
*/
|
||||
module.exports = {
|
||||
0: '#000',
|
||||
|
|
|
@ -4,27 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} Palette
|
||||
*
|
||||
* @property {string} 0 - Color value 1.
|
||||
* @property {string} 1 - Color value 2.
|
||||
* @property {string} 2 - Color value 3.
|
||||
* @property {string} 3 - Color value 4.
|
||||
* @property {string} 4 - Color value 5.
|
||||
* @property {string} 5 - Color value 6.
|
||||
* @property {string} 6 - Color value 7.
|
||||
* @property {string} 7 - Color value 8.
|
||||
* @property {string} 8 - Color value 9.
|
||||
* @property {string} 9 - Color value 10.
|
||||
* @property {string} A - Color value 11.
|
||||
* @property {string} B - Color value 12.
|
||||
* @property {string} C - Color value 13.
|
||||
* @property {string} D - Color value 14.
|
||||
* @property {string} E - Color value 15.
|
||||
* @property {string} F - Color value 16.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Create.Palettes
|
||||
*/
|
||||
|
|
22
src/create/typedefs/GenerateTextureConfig.js
Normal file
22
src/create/typedefs/GenerateTextureConfig.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* @callback Phaser.Create.Types.GenerateTextureCallback
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {HTMLCanvasElement} canvas - [description]
|
||||
* @param {CanvasRenderingContext2D} context - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} Phaser.Create.Types.GenerateTextureConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {array} [data=[]] - [description]
|
||||
* @property {HTMLCanvasElement} [canvas=null] - [description]
|
||||
* @property {Phaser.Create.Types.Palette} [palette=Arne16] - [description]
|
||||
* @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture.
|
||||
* @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture.
|
||||
* @property {boolean} [resizeCanvas=true] - [description]
|
||||
* @property {boolean} [clearCanvas=true] - [description]
|
||||
* @property {Phaser.Create.Types.GenerateTextureCallback} [preRender] - [description]
|
||||
* @property {Phaser.Create.Types.GenerateTextureCallback} [postRender] - [description]
|
||||
*/
|
21
src/create/typedefs/Palette.js
Normal file
21
src/create/typedefs/Palette.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Create.Types.Palette
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} 0 - Color value 1.
|
||||
* @property {string} 1 - Color value 2.
|
||||
* @property {string} 2 - Color value 3.
|
||||
* @property {string} 3 - Color value 4.
|
||||
* @property {string} 4 - Color value 5.
|
||||
* @property {string} 5 - Color value 6.
|
||||
* @property {string} 6 - Color value 7.
|
||||
* @property {string} 7 - Color value 8.
|
||||
* @property {string} 8 - Color value 9.
|
||||
* @property {string} 9 - Color value 10.
|
||||
* @property {string} A - Color value 11.
|
||||
* @property {string} B - Color value 12.
|
||||
* @property {string} C - Color value 13.
|
||||
* @property {string} D - Color value 14.
|
||||
* @property {string} E - Color value 15.
|
||||
* @property {string} F - Color value 16.
|
||||
*/
|
9
src/create/typedefs/index.js
Normal file
9
src/create/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Create.Types
|
||||
*/
|
|
@ -179,7 +179,7 @@ var CubicBezierCurve = new Class({
|
|||
* @method Phaser.Curves.CubicBezier#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONCurve} The JSON object containing this curve data.
|
||||
* @return {Phaser.Curves.Types.JSONCurve} The JSON object containing this curve data.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ var CubicBezierCurve = new Class({
|
|||
* @function Phaser.Curves.CubicBezier.fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {JSONCurve} data - The JSON object containing this curve data.
|
||||
* @param {Phaser.Curves.Types.JSONCurve} data - The JSON object containing this curve data.
|
||||
*
|
||||
* @return {Phaser.Curves.CubicBezier} The curve generated from the JSON object.
|
||||
*/
|
||||
|
|
|
@ -13,33 +13,6 @@ var GetValue = require('../utils/object/GetValue');
|
|||
var RadToDeg = require('../math/RadToDeg');
|
||||
var Vector2 = require('../math/Vector2');
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONEllipseCurve
|
||||
*
|
||||
* @property {string} type - The of the curve.
|
||||
* @property {number} x - The x coordinate of the ellipse.
|
||||
* @property {number} y - The y coordinate of the ellipse.
|
||||
* @property {number} xRadius - The horizontal radius of ellipse.
|
||||
* @property {number} yRadius - The vertical radius of ellipse.
|
||||
* @property {integer} startAngle - The start angle of the ellipse, in degrees.
|
||||
* @property {integer} endAngle - The end angle of the ellipse, in degrees.
|
||||
* @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false)
|
||||
* @property {integer} rotation - The rotation of ellipse, in degrees.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} EllipseCurveConfig
|
||||
*
|
||||
* @property {number} [x=0] - The x coordinate of the ellipse.
|
||||
* @property {number} [y=0] - The y coordinate of the ellipse.
|
||||
* @property {number} [xRadius=0] - The horizontal radius of the ellipse.
|
||||
* @property {number} [yRadius=0] - The vertical radius of the ellipse.
|
||||
* @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees.
|
||||
* @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees.
|
||||
* @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false)
|
||||
* @property {integer} [rotation=0] - The rotation of the ellipse, in degrees.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* An Elliptical Curve derived from the Base Curve class.
|
||||
|
@ -52,7 +25,7 @@ var Vector2 = require('../math/Vector2');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(number|EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object.
|
||||
* @param {(number|Phaser.Curves.Types.EllipseCurveConfig)} [x=0] - The x coordinate of the ellipse, or an Ellipse Curve configuration object.
|
||||
* @param {number} [y=0] - The y coordinate of the ellipse.
|
||||
* @param {number} [xRadius=0] - The horizontal radius of ellipse.
|
||||
* @param {number} [yRadius=0] - The vertical radius of ellipse.
|
||||
|
@ -608,7 +581,7 @@ var EllipseCurve = new Class({
|
|||
* @method Phaser.Curves.Ellipse#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONEllipseCurve} The JSON object containing this curve data.
|
||||
* @return {Phaser.Curves.Types.JSONEllipseCurve} The JSON object containing this curve data.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
@ -633,7 +606,7 @@ var EllipseCurve = new Class({
|
|||
* @function Phaser.Curves.Ellipse.fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {JSONEllipseCurve} data - The JSON object containing this curve data.
|
||||
* @param {Phaser.Curves.Types.JSONEllipseCurve} data - The JSON object containing this curve data.
|
||||
*
|
||||
* @return {Phaser.Curves.Ellipse} The ellipse curve constructed from the configuration object.
|
||||
*/
|
||||
|
|
|
@ -213,7 +213,7 @@ var LineCurve = new Class({
|
|||
* @method Phaser.Curves.Line#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONCurve} The JSON object containing this curve data.
|
||||
* @return {Phaser.Curves.Types.JSONCurve} The JSON object containing this curve data.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
@ -234,7 +234,7 @@ var LineCurve = new Class({
|
|||
* @function Phaser.Curves.Line.fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {JSONCurve} data - The JSON object containing this curve data.
|
||||
* @param {Phaser.Curves.Types.JSONCurve} data - The JSON object containing this curve data.
|
||||
*
|
||||
* @return {Phaser.Curves.Line} A new LineCurve object.
|
||||
*/
|
||||
|
|
|
@ -168,7 +168,7 @@ var QuadraticBezier = new Class({
|
|||
* @method Phaser.Curves.QuadraticBezier#toJSON
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @return {JSONCurve} The JSON object containing this curve data.
|
||||
* @return {Phaser.Curves.Types.JSONCurve} The JSON object containing this curve data.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
@ -190,7 +190,7 @@ var QuadraticBezier = new Class({
|
|||
* @function Phaser.Curves.QuadraticBezier.fromJSON
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @param {JSONCurve} data - The JSON object containing this curve data.
|
||||
* @param {Phaser.Curves.Types.JSONCurve} data - The JSON object containing this curve data.
|
||||
*
|
||||
* @return {Phaser.Curves.QuadraticBezier} The created curve instance.
|
||||
*/
|
||||
|
|
|
@ -181,7 +181,7 @@ var SplineCurve = new Class({
|
|||
* @method Phaser.Curves.Spline#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONCurve} The JSON object containing this curve data.
|
||||
* @return {Phaser.Curves.Types.JSONCurve} The JSON object containing this curve data.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ var SplineCurve = new Class({
|
|||
* @function Phaser.Curves.Spline.fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {JSONCurve} data - The JSON object containing this curve data.
|
||||
* @param {Phaser.Curves.Types.JSONCurve} data - The JSON object containing this curve data.
|
||||
*
|
||||
* @return {Phaser.Curves.Spline} [description]
|
||||
*/
|
||||
|
|
|
@ -8,13 +8,6 @@
|
|||
* @namespace Phaser.Curves
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONCurve
|
||||
*
|
||||
* @property {string} type - The of the curve
|
||||
* @property {number[]} points - The arrays of points like `[x1, y1, x2, y2]`
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
Path: require('./path/Path'),
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ var MoveTo = new Class({
|
|||
* @method Phaser.Curves.MoveTo#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONCurve} A primitive object with the curve's type and only point.
|
||||
* @return {Phaser.Curves.Types.JSONCurve} A primitive object with the curve's type and only point.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -17,28 +17,20 @@ var Rectangle = require('../../geom/rectangle/Rectangle');
|
|||
var SplineCurve = require('../SplineCurve');
|
||||
var Vector2 = require('../../math/Vector2');
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONPath
|
||||
*
|
||||
* @property {string} type - The of the curve.
|
||||
* @property {number} x - The X coordinate of the curve's starting point.
|
||||
* @property {number} y - The Y coordinate of the path's starting point.
|
||||
* @property {boolean} autoClose - The path is auto closed.
|
||||
* @property {JSONCurve[]} curves - The list of the curves
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Path combines multiple Curves into one continuous compound curve. It does not matter how many Curves are in the Path or what type they are.
|
||||
* A Path combines multiple Curves into one continuous compound curve.
|
||||
* It does not matter how many Curves are in the Path or what type they are.
|
||||
*
|
||||
* A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path.
|
||||
* A Curve in a Path does not have to start where the previous Curve ends - that is to say, a Path does not
|
||||
* have to be an uninterrupted curve. Only the order of the Curves influences the actual points on the Path.
|
||||
*
|
||||
* @class Path
|
||||
* @memberof Phaser.Curves
|
||||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [x=0] - The X coordinate of the Path's starting point or a {@link JSONPath}.
|
||||
* @param {number} [x=0] - The X coordinate of the Path's starting point or a {@link Phaser.Curves.Types.JSONPath}.
|
||||
* @param {number} [y=0] - The Y coordinate of the Path's starting point.
|
||||
*/
|
||||
var Path = new Class({
|
||||
|
@ -339,12 +331,12 @@ var Path = new Class({
|
|||
/**
|
||||
* Creates a Path from a Path Configuration object.
|
||||
*
|
||||
* The provided object should be a {@link JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors.
|
||||
* The provided object should be a {@link Phaser.Curves.Types.JSONPath}, as returned by {@link #toJSON}. Providing a malformed object may cause errors.
|
||||
*
|
||||
* @method Phaser.Curves.Path#fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} data - The JSON object containing the Path data.
|
||||
* @param {Phaser.Curves.Types.JSONPath} data - The JSON object containing the Path data.
|
||||
*
|
||||
* @return {Phaser.Curves.Path} This Path object.
|
||||
*/
|
||||
|
@ -768,7 +760,7 @@ var Path = new Class({
|
|||
* @method Phaser.Curves.Path#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONPath} [description]
|
||||
* @return {Phaser.Curves.Types.JSONPath} [description]
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
12
src/curves/typedefs/EllipseCurveConfig.js
Normal file
12
src/curves/typedefs/EllipseCurveConfig.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Curves.Types.EllipseCurveConfig
|
||||
*
|
||||
* @property {number} [x=0] - The x coordinate of the ellipse.
|
||||
* @property {number} [y=0] - The y coordinate of the ellipse.
|
||||
* @property {number} [xRadius=0] - The horizontal radius of the ellipse.
|
||||
* @property {number} [yRadius=0] - The vertical radius of the ellipse.
|
||||
* @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees.
|
||||
* @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees.
|
||||
* @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false)
|
||||
* @property {integer} [rotation=0] - The rotation of the ellipse, in degrees.
|
||||
*/
|
7
src/curves/typedefs/JSONCurve.js
Normal file
7
src/curves/typedefs/JSONCurve.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Curves.Types.JSONCurve
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} type - The of the curve
|
||||
* @property {number[]} points - The arrays of points like `[x1, y1, x2, y2]`
|
||||
*/
|
14
src/curves/typedefs/JSONEllipseCurve.js
Normal file
14
src/curves/typedefs/JSONEllipseCurve.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Curves.Types.JSONEllipseCurve
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} type - The of the curve.
|
||||
* @property {number} x - The x coordinate of the ellipse.
|
||||
* @property {number} y - The y coordinate of the ellipse.
|
||||
* @property {number} xRadius - The horizontal radius of ellipse.
|
||||
* @property {number} yRadius - The vertical radius of ellipse.
|
||||
* @property {integer} startAngle - The start angle of the ellipse, in degrees.
|
||||
* @property {integer} endAngle - The end angle of the ellipse, in degrees.
|
||||
* @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false)
|
||||
* @property {integer} rotation - The rotation of ellipse, in degrees.
|
||||
*/
|
10
src/curves/typedefs/JSONPath.js
Normal file
10
src/curves/typedefs/JSONPath.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Curves.Types.JSONPath
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} type - The of the curve.
|
||||
* @property {number} x - The X coordinate of the curve's starting point.
|
||||
* @property {number} y - The Y coordinate of the path's starting point.
|
||||
* @property {boolean} autoClose - The path is auto closed.
|
||||
* @property {Phaser.Curves.Types.JSONCurve[]} curves - The list of the curves
|
||||
*/
|
9
src/curves/typedefs/index.js
Normal file
9
src/curves/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.Curves.Types
|
||||
*/
|
|
@ -262,7 +262,7 @@ var Color = new Class({
|
|||
* @method Phaser.Display.Color#setFromRGB
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {InputColorObject} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255.
|
||||
* @param {Phaser.Display.Types.InputColorObject} color - An object containing `r`, `g`, `b` and optionally `a` values in the range 0 to 255.
|
||||
*
|
||||
* @return {Phaser.Display.Color} This Color object.
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
*
|
||||
* @param {number} color - A color value, optionally including the alpha value.
|
||||
*
|
||||
* @return {ColorObject} An object containing the parsed color values.
|
||||
* @return {Phaser.Display.Types.ColorObject} An object containing the parsed color values.
|
||||
*/
|
||||
var ColorToRGBA = function (color)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ var HSVToRGB = require('./HSVToRGB');
|
|||
* @param {number} [s=1] - The saturation, in the range 0 - 1.
|
||||
* @param {number} [v=1] - The value, in the range 0 - 1.
|
||||
*
|
||||
* @return {ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel.
|
||||
* @return {Phaser.Display.Types.ColorObject[]} An array containing 360 elements, where each contains a single numeric value corresponding to the color at that point in the HSV color wheel.
|
||||
*/
|
||||
var HSVColorWheel = function (s, v)
|
||||
{
|
||||
|
|
|
@ -18,9 +18,9 @@ var GetColor = require('./GetColor');
|
|||
* @param {number} h - The hue, in the range 0 - 1. This is the base color.
|
||||
* @param {number} s - The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white.
|
||||
* @param {number} v - The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black.
|
||||
* @param {(ColorObject|Phaser.Display.Color)} [out] - A Color object to store the results in. If not given a new ColorObject will be created.
|
||||
* @param {(Phaser.Display.Types.ColorObject|Phaser.Display.Color)} [out] - A Color object to store the results in. If not given a new ColorObject will be created.
|
||||
*
|
||||
* @return {(ColorObject|Phaser.Display.Color)} An object with the red, green and blue values set in the r, g and b properties.
|
||||
* @return {(Phaser.Display.Types.ColorObject|Phaser.Display.Color)} An object with the red, green and blue values set in the r, g and b properties.
|
||||
*/
|
||||
var HSVToRGB = function (h, s, v, out)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*
|
||||
* @param {integer} input - The color value to convert into a Color object.
|
||||
*
|
||||
* @return {ColorObject} An object with the red, green and blue values set in the r, g and b properties.
|
||||
* @return {Phaser.Display.Types.ColorObject} An object with the red, green and blue values set in the r, g and b properties.
|
||||
*/
|
||||
var IntegerToRGB = function (color)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ var Linear = require('../../math/Linear');
|
|||
* @param {number} [length=100] - Distance to interpolate over.
|
||||
* @param {number} [index=0] - Index to start from.
|
||||
*
|
||||
* @return {ColorObject} An object containing the interpolated color values.
|
||||
* @return {Phaser.Display.Types.ColorObject} An object containing the interpolated color values.
|
||||
*/
|
||||
var RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ var RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index)
|
|||
* @param {number} [length=100] - Distance to interpolate over.
|
||||
* @param {number} [index=0] - Index to start from.
|
||||
*
|
||||
* @return {ColorObject} An object containing the interpolated color values.
|
||||
* @return {Phaser.Display.Types.ColorObject} An object containing the interpolated color values.
|
||||
*/
|
||||
var ColorWithColor = function (color1, color2, length, index)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ var ColorWithColor = function (color1, color2, length, index)
|
|||
* @param {number} [length=100] - Distance to interpolate over.
|
||||
* @param {number} [index=0] - Index to start from.
|
||||
*
|
||||
* @return {ColorObject} An object containing the interpolated color values.
|
||||
* @return {Phaser.Display.Types.ColorObject} An object containing the interpolated color values.
|
||||
*/
|
||||
var ColorWithRGB = function (color, r, g, b, length, index)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ var Color = require('./Color');
|
|||
* @function Phaser.Display.Color.ObjectToColor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {InputColorObject} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255.
|
||||
* @param {Phaser.Display.Types.InputColorObject} input - An object containing `r`, `g`, `b` and `a` properties in the range 0 to 255.
|
||||
*
|
||||
* @return {Phaser.Display.Color} A Color object.
|
||||
*/
|
||||
|
|
|
@ -4,14 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} HSVColorObject
|
||||
*
|
||||
* @property {number} h - The hue color value. A number between 0 and 1
|
||||
* @property {number} s - The saturation color value. A number between 0 and 1
|
||||
* @property {number} v - The lightness color value. A number between 0 and 1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Converts an RGB color value to HSV (hue, saturation and value).
|
||||
* Conversion forumla from http://en.wikipedia.org/wiki/HSL_color_space.
|
||||
|
@ -24,9 +16,9 @@
|
|||
* @param {integer} r - The red color value. A number between 0 and 255.
|
||||
* @param {integer} g - The green color value. A number between 0 and 255.
|
||||
* @param {integer} b - The blue color value. A number between 0 and 255.
|
||||
* @param {(HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created.
|
||||
* @param {(Phaser.Display.Types.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created.
|
||||
*
|
||||
* @return {(HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set.
|
||||
* @return {(Phaser.Display.Types.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set.
|
||||
*/
|
||||
var RGBToHSV = function (r, g, b, out)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ var RGBStringToColor = require('./RGBStringToColor');
|
|||
* @function Phaser.Display.Color.ValueToColor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(string|number|InputColorObject)} input - The source color value to convert.
|
||||
* @param {(string|number|Phaser.Display.Types.InputColorObject)} input - The source color value to convert.
|
||||
*
|
||||
* @return {Phaser.Display.Color} A Color object.
|
||||
*/
|
||||
|
|
|
@ -4,24 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} InputColorObject
|
||||
*
|
||||
* @property {number} [r] - The red color value in the range 0 to 255.
|
||||
* @property {number} [g] - The green color value in the range 0 to 255.
|
||||
* @property {number} [b] - The blue color value in the range 0 to 255.
|
||||
* @property {number} [a] - The alpha color value in the range 0 to 255.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ColorObject
|
||||
*
|
||||
* @property {number} r - The red color value in the range 0 to 255.
|
||||
* @property {number} g - The green color value in the range 0 to 255.
|
||||
* @property {number} b - The blue color value in the range 0 to 255.
|
||||
* @property {number} a - The alpha color value in the range 0 to 255.
|
||||
*/
|
||||
|
||||
var Color = require('./Color');
|
||||
|
||||
Color.ColorToRGBA = require('./ColorToRGBA');
|
||||
|
|
9
src/display/typedefs/ColorObject.js
Normal file
9
src/display/typedefs/ColorObject.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Display.Types.ColorObject
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} r - The red color value in the range 0 to 255.
|
||||
* @property {number} g - The green color value in the range 0 to 255.
|
||||
* @property {number} b - The blue color value in the range 0 to 255.
|
||||
* @property {number} a - The alpha color value in the range 0 to 255.
|
||||
*/
|
8
src/display/typedefs/HSVColorObject.js
Normal file
8
src/display/typedefs/HSVColorObject.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Display.Types.HSVColorObject
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} h - The hue color value. A number between 0 and 1
|
||||
* @property {number} s - The saturation color value. A number between 0 and 1
|
||||
* @property {number} v - The lightness color value. A number between 0 and 1
|
||||
*/
|
9
src/display/typedefs/InputColorObject.js
Normal file
9
src/display/typedefs/InputColorObject.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.Display.Types.InputColorObject
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} [r] - The red color value in the range 0 to 255.
|
||||
* @property {number} [g] - The green color value in the range 0 to 255.
|
||||
* @property {number} [b] - The blue color value in the range 0 to 255.
|
||||
* @property {number} [a] - The alpha color value in the range 0 to 255.
|
||||
*/
|
3
src/display/typedefs/index.js
Normal file
3
src/display/typedefs/index.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
/**
|
||||
* @namespace Phaser.Display.Types
|
||||
*/
|
|
@ -8,26 +8,6 @@ var BlendModes = require('../renderer/BlendModes');
|
|||
var GetAdvancedValue = require('../utils/object/GetAdvancedValue');
|
||||
var ScaleModes = require('../renderer/ScaleModes');
|
||||
|
||||
/**
|
||||
* @typedef {object} GameObjectConfig
|
||||
*
|
||||
* @property {number} [x=0] - The x position of the Game Object.
|
||||
* @property {number} [y=0] - The y position of the Game Object.
|
||||
* @property {number} [depth=0] - The depth of the GameObject.
|
||||
* @property {boolean} [flipX=false] - The horizontally flipped state of the Game Object.
|
||||
* @property {boolean} [flipY=false] - The vertically flipped state of the Game Object.
|
||||
* @property {?(number|object)} [scale=null] - The scale of the GameObject.
|
||||
* @property {?(number|object)} [scrollFactor=null] - The scroll factor of the GameObject.
|
||||
* @property {number} [rotation=0] - The rotation angle of the Game Object, in radians.
|
||||
* @property {?number} [angle=null] - The rotation angle of the Game Object, in degrees.
|
||||
* @property {number} [alpha=1] - The alpha (opacity) of the Game Object.
|
||||
* @property {?(number|object)} [origin=null] - The origin of the Game Object.
|
||||
* @property {number} [scaleMode=ScaleModes.DEFAULT] - The scale mode of the GameObject.
|
||||
* @property {number} [blendMode=BlendModes.DEFAULT] - The blend mode of the GameObject.
|
||||
* @property {boolean} [visible=true] - The visible state of the Game Object.
|
||||
* @property {boolean} [add=true] - Add the GameObject to the scene.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Builds a Game Object using the provided configuration object.
|
||||
*
|
||||
|
@ -36,7 +16,7 @@ var ScaleModes = require('../renderer/ScaleModes');
|
|||
*
|
||||
* @param {Phaser.Scene} scene - A reference to the Scene.
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.
|
||||
* @param {GameObjectConfig} config - The config to build the GameObject with.
|
||||
* @param {Phaser.GameObjects.Types.GameObjectConfig} config - The config to build the GameObject with.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} The built Game Object.
|
||||
*/
|
||||
|
|
|
@ -475,7 +475,7 @@ var GameObject = new Class({
|
|||
* @method Phaser.GameObjects.GameObject#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONGameObject} A JSON representation of the Game Object.
|
||||
* @return {Phaser.GameObjects.Types.JSONGameObject} A JSON representation of the Game Object.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -4,35 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} BitmapTextSize
|
||||
*
|
||||
* @property {GlobalBitmapTextSize} global - The position and size of the BitmapText, taking into account the position and scale of the Game Object.
|
||||
* @property {LocalBitmapTextSize} local - The position and size of the BitmapText, taking just the font size into account.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position.
|
||||
*
|
||||
* @typedef {object} GlobalBitmapTextSize
|
||||
*
|
||||
* @property {number} x - The x position of the BitmapText, taking into account the x position and scale of the Game Object.
|
||||
* @property {number} y - The y position of the BitmapText, taking into account the y position and scale of the Game Object.
|
||||
* @property {number} width - The width of the BitmapText, taking into account the x scale of the Game Object.
|
||||
* @property {number} height - The height of the BitmapText, taking into account the y scale of the Game Object.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The position and size of the Bitmap Text in local space, taking just the font size into account.
|
||||
*
|
||||
* @typedef {object} LocalBitmapTextSize
|
||||
*
|
||||
* @property {number} x - The x position of the BitmapText.
|
||||
* @property {number} y - The y position of the BitmapText.
|
||||
* @property {number} width - The width of the BitmapText.
|
||||
* @property {number} height - The height of the BitmapText.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Calculate the position, width and height of a BitmapText Game Object.
|
||||
*
|
||||
|
@ -51,7 +22,7 @@
|
|||
* @param {boolean} [round] - Whether to round the results to the nearest integer.
|
||||
* @param {object} [out] - Optional object to store the results in, to save constant object creation.
|
||||
*
|
||||
* @return {BitmapTextSize} The calculated position, width and height of the BitmapText.
|
||||
* @return {Phaser.GameObjects.BitmapText.Types.BitmapTextSize} The calculated position, width and height of the BitmapText.
|
||||
*/
|
||||
var GetBitmapTextSize = function (src, round, out)
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ var GetValue = require('../../utils/object/GetValue');
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Scene} scene - A reference to the Phaser Scene.
|
||||
* @param {Phaser.GameObjects.RetroFont.Config} config - The font configuration object.
|
||||
* @param {Phaser.GameObjects.BitmapText.Types.RetroFontConfig} config - The font configuration object.
|
||||
*
|
||||
* @return {object} A parsed Bitmap Font data entry for the Bitmap Font cache.
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ function getValue (node, attribute)
|
|||
* @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height.
|
||||
* @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing.
|
||||
*
|
||||
* @return {BitmapFontData} The parsed Bitmap Font data.
|
||||
* @return {Phaser.GameObjects.BitmapText.Types.BitmapFontData} The parsed Bitmap Font data.
|
||||
*/
|
||||
var ParseXMLBitmapFont = function (xml, xSpacing, ySpacing, frame)
|
||||
{
|
||||
|
|
|
@ -7,21 +7,6 @@
|
|||
var RETRO_FONT_CONST = require('./const');
|
||||
var Extend = require('../../utils/object/Extend');
|
||||
|
||||
/**
|
||||
* @typedef {object} Phaser.GameObjects.RetroFont.Config
|
||||
*
|
||||
* @property {string} image - The key of the image containing the font.
|
||||
* @property {number} offset.x - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
|
||||
* @property {number} offset.y - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
|
||||
* @property {number} width - The width of each character in the font set.
|
||||
* @property {number} height - The height of each character in the font set.
|
||||
* @property {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
|
||||
* @property {number} charsPerRow - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
|
||||
* @property {number} spacing.x - If the characters in the font set have horizontal spacing between them set the required amount here.
|
||||
* @property {number} spacing.y - If the characters in the font set have vertical spacing between them set the required amount here.
|
||||
* @property {number} lineSpacing - The amount of vertical space to add to the line height of the font.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.GameObjects.RetroFont
|
||||
* @since 3.6.0
|
||||
|
|
|
@ -8,28 +8,6 @@ var BitmapText = require('../static/BitmapText');
|
|||
var Class = require('../../../utils/Class');
|
||||
var Render = require('./DynamicBitmapTextRender');
|
||||
|
||||
/**
|
||||
* @typedef {object} DisplayCallbackConfig
|
||||
*
|
||||
* @property {Phaser.GameObjects.DynamicBitmapText} parent - The Dynamic Bitmap Text object that owns this character being rendered.
|
||||
* @property {{topLeft:number, topRight:number, bottomLeft:number, bottomRight:number}} tint - The tint of the character being rendered. Always zero in Canvas.
|
||||
* @property {number} index - The index of the character being rendered.
|
||||
* @property {number} charCode - The character code of the character being rendered.
|
||||
* @property {number} x - The x position of the character being rendered.
|
||||
* @property {number} y - The y position of the character being rendered.
|
||||
* @property {number} scale - The scale of the character being rendered.
|
||||
* @property {number} rotation - The rotation of the character being rendered.
|
||||
* @property {any} data - Custom data stored with the character being rendered.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback DisplayCallback
|
||||
*
|
||||
* @param {DisplayCallbackConfig} display - Settings of the character that is about to be rendered.
|
||||
*
|
||||
* @return {{x:number, y:number, scale:number, rotation:number}} Altered position, scale and rotation values for the character that is about to be rendered.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.
|
||||
|
@ -132,7 +110,7 @@ var DynamicBitmapText = new Class({
|
|||
* A callback that alters how each character of the Bitmap Text is rendered.
|
||||
*
|
||||
* @name Phaser.GameObjects.DynamicBitmapText#displayCallback
|
||||
* @type {DisplayCallback}
|
||||
* @type {Phaser.GameObjects.BitmapText.Types.DisplayCallback}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.displayCallback;
|
||||
|
@ -146,7 +124,7 @@ var DynamicBitmapText = new Class({
|
|||
* should shallow copy it, as it's updated and re-used for every glyph in the text.
|
||||
*
|
||||
* @name Phaser.GameObjects.DynamicBitmapText#callbackData
|
||||
* @type {DisplayCallbackConfig}
|
||||
* @type {Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig}
|
||||
* @since 3.11.0
|
||||
*/
|
||||
this.callbackData = {
|
||||
|
@ -190,7 +168,7 @@ var DynamicBitmapText = new Class({
|
|||
/**
|
||||
* Set a callback that alters how each character of the Bitmap Text is rendered.
|
||||
*
|
||||
* The callback receives a {@link DisplayCallbackConfig} object that contains information about the character that's
|
||||
* The callback receives a {@link Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig} object that contains information about the character that's
|
||||
* about to be rendered.
|
||||
*
|
||||
* It should return an object with `x`, `y`, `scale` and `rotation` properties that will be used instead of the
|
||||
|
@ -199,7 +177,7 @@ var DynamicBitmapText = new Class({
|
|||
* @method Phaser.GameObjects.DynamicBitmapText#setDisplayCallback
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {DisplayCallback} callback - The display callback to set.
|
||||
* @param {Phaser.GameObjects.BitmapText.Types.DisplayCallback} callback - The display callback to set.
|
||||
*
|
||||
* @return {Phaser.GameObjects.DynamicBitmapText} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -9,15 +9,6 @@ var BuildGameObject = require('../../BuildGameObject');
|
|||
var GameObjectCreator = require('../../GameObjectCreator');
|
||||
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
|
||||
|
||||
/**
|
||||
* @typedef {object} BitmapTextConfig
|
||||
* @extends GameObjectConfig
|
||||
*
|
||||
* @property {string} [font=''] - The key of the font to use from the BitmapFont cache.
|
||||
* @property {string} [text=''] - The string, or array of strings, to be set as the content of this Bitmap Text.
|
||||
* @property {(number|false)} [size=false] - The font size to set.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new Dynamic Bitmap Text Game Object and returns it.
|
||||
*
|
||||
|
@ -26,7 +17,7 @@ var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#dynamicBitmapText
|
||||
* @since 3.0.0
|
||||
*²
|
||||
* @param {BitmapTextConfig} config - The configuration object this Game Object will use to create itself.
|
||||
* @param {Phaser.GameObjects.BitmapText.Types.BitmapTextConfig} 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.DynamicBitmapText} The Game Object that was created.
|
||||
|
|
|
@ -11,48 +11,6 @@ var GetBitmapTextSize = require('../GetBitmapTextSize');
|
|||
var ParseFromAtlas = require('../ParseFromAtlas');
|
||||
var Render = require('./BitmapTextRender');
|
||||
|
||||
/**
|
||||
* The font data for an individual character of a Bitmap Font.
|
||||
*
|
||||
* Describes the character's position, size, offset and kerning.
|
||||
*
|
||||
* @typedef {object} BitmapFontCharacterData
|
||||
*
|
||||
* @property {number} x - The x position of the character.
|
||||
* @property {number} y - The y position of the character.
|
||||
* @property {number} width - The width of the character.
|
||||
* @property {number} height - The height of the character.
|
||||
* @property {number} centerX - The center x position of the character.
|
||||
* @property {number} centerY - The center y position of the character.
|
||||
* @property {number} xOffset - The x offset of the character.
|
||||
* @property {number} yOffset - The y offset of the character.
|
||||
* @property {object} data - Extra data for the character.
|
||||
* @property {Object.<number>} kerning - Kerning values, keyed by character code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Bitmap Font data that can be used by a BitmapText Game Object.
|
||||
*
|
||||
* @typedef {object} BitmapFontData
|
||||
*
|
||||
* @property {string} font - The name of the font.
|
||||
* @property {number} size - The size of the font.
|
||||
* @property {number} lineHeight - The line height of the font.
|
||||
* @property {boolean} retroFont - Whether this font is a retro font (monospace).
|
||||
* @property {Object.<number, BitmapFontCharacterData>} chars - The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONBitmapText
|
||||
* @extends {JSONGameObject}
|
||||
*
|
||||
* @property {string} font - The name of the font.
|
||||
* @property {string} text - The text that this Bitmap Text displays.
|
||||
* @property {number} fontSize - The size of the font.
|
||||
* @property {number} letterSpacing - Adds / Removes spacing between characters.
|
||||
* @property {integer} align - The alignment of the text in a multi-line BitmapText object.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure.
|
||||
|
@ -148,7 +106,7 @@ var BitmapText = new Class({
|
|||
* The data of the Bitmap Font used by this Bitmap Text.
|
||||
*
|
||||
* @name Phaser.GameObjects.BitmapText#fontData
|
||||
* @type {BitmapFontData}
|
||||
* @type {Phaser.GameObjects.BitmapText.Types.BitmapFontData}
|
||||
* @readonly
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -210,7 +168,7 @@ var BitmapText = new Class({
|
|||
* An object that describes the size of this Bitmap Text.
|
||||
*
|
||||
* @name Phaser.GameObjects.BitmapText#_bounds
|
||||
* @type {BitmapTextSize}
|
||||
* @type {Phaser.GameObjects.BitmapText.Types.BitmapTextSize}
|
||||
* @private
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -383,7 +341,7 @@ var BitmapText = new Class({
|
|||
*
|
||||
* @param {boolean} [round] - Whether to round the results to the nearest integer.
|
||||
*
|
||||
* @return {BitmapTextSize} An object that describes the size of this Bitmap Text.
|
||||
* @return {Phaser.GameObjects.BitmapText.Types.BitmapTextSize} An object that describes the size of this Bitmap Text.
|
||||
*/
|
||||
getTextBounds: function (round)
|
||||
{
|
||||
|
@ -589,7 +547,7 @@ var BitmapText = new Class({
|
|||
* @method Phaser.GameObjects.BitmapText#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONBitmapText} A JSON representation of this Bitmap Text.
|
||||
* @return {Phaser.GameObjects.BitmapText.Types.JSONBitmapText} A JSON representation of this Bitmap Text.
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ var GetValue = require('../../../utils/object/GetValue');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#bitmapText
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {BitmapTextConfig} config - The configuration object this Game Object will use to create itself.
|
||||
* @param {Phaser.GameObjects.BitmapText.Types.BitmapTextConfig} 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.BitmapText} The Game Object that was created.
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* The font data for an individual character of a Bitmap Font.
|
||||
*
|
||||
* Describes the character's position, size, offset and kerning.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.BitmapFontCharacterData
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} x - The x position of the character.
|
||||
* @property {number} y - The y position of the character.
|
||||
* @property {number} width - The width of the character.
|
||||
* @property {number} height - The height of the character.
|
||||
* @property {number} centerX - The center x position of the character.
|
||||
* @property {number} centerY - The center y position of the character.
|
||||
* @property {number} xOffset - The x offset of the character.
|
||||
* @property {number} yOffset - The y offset of the character.
|
||||
* @property {object} data - Extra data for the character.
|
||||
* @property {Object.<number>} kerning - Kerning values, keyed by character code.
|
||||
*/
|
12
src/gameobjects/bitmaptext/typedefs/BitmapFontData.js
Normal file
12
src/gameobjects/bitmaptext/typedefs/BitmapFontData.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Bitmap Font data that can be used by a BitmapText Game Object.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.BitmapFontData
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} font - The name of the font.
|
||||
* @property {number} size - The size of the font.
|
||||
* @property {number} lineHeight - The line height of the font.
|
||||
* @property {boolean} retroFont - Whether this font is a retro font (monospace).
|
||||
* @property {Object.<number, Phaser.GameObjects.BitmapText.Types.BitmapFontCharacterData>} chars - The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more.
|
||||
*/
|
9
src/gameobjects/bitmaptext/typedefs/BitmapTextConfig.js
Normal file
9
src/gameobjects/bitmaptext/typedefs/BitmapTextConfig.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.BitmapTextConfig
|
||||
* @extends Phaser.GameObjects.Types.GameObjectConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} [font=''] - The key of the font to use from the BitmapFont cache.
|
||||
* @property {string} [text=''] - The string, or array of strings, to be set as the content of this Bitmap Text.
|
||||
* @property {(number|false)} [size=false] - The font size to set.
|
||||
*/
|
7
src/gameobjects/bitmaptext/typedefs/BitmapTextSize.js
Normal file
7
src/gameobjects/bitmaptext/typedefs/BitmapTextSize.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.BitmapTextSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.GameObjects.BitmapText.Types.GlobalBitmapTextSize} global - The position and size of the BitmapText, taking into account the position and scale of the Game Object.
|
||||
* @property {Phaser.GameObjects.BitmapText.Types.LocalBitmapTextSize} local - The position and size of the BitmapText, taking just the font size into account.
|
||||
*/
|
22
src/gameobjects/bitmaptext/typedefs/DisplayCallbackConfig.js
Normal file
22
src/gameobjects/bitmaptext/typedefs/DisplayCallbackConfig.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.GameObjects.DynamicBitmapText} parent - The Dynamic Bitmap Text object that owns this character being rendered.
|
||||
* @property {Phaser.GameObjects.BitmapText.Types.TintConfig} tint - The tint of the character being rendered. Always zero in Canvas.
|
||||
* @property {number} index - The index of the character being rendered.
|
||||
* @property {number} charCode - The character code of the character being rendered.
|
||||
* @property {number} x - The x position of the character being rendered.
|
||||
* @property {number} y - The y position of the character being rendered.
|
||||
* @property {number} scale - The scale of the character being rendered.
|
||||
* @property {number} rotation - The rotation of the character being rendered.
|
||||
* @property {any} data - Custom data stored with the character being rendered.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback Phaser.GameObjects.BitmapText.Types.DisplayCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig} display - Settings of the character that is about to be rendered.
|
||||
*
|
||||
* @return {Phaser.GameObjects.BitmapText.Types.DisplayCallbackConfig} Altered position, scale and rotation values for the character that is about to be rendered.
|
||||
*/
|
11
src/gameobjects/bitmaptext/typedefs/GlobalBitmapTextSize.js
Normal file
11
src/gameobjects/bitmaptext/typedefs/GlobalBitmapTextSize.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.GlobalBitmapTextSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} x - The x position of the BitmapText, taking into account the x position and scale of the Game Object.
|
||||
* @property {number} y - The y position of the BitmapText, taking into account the y position and scale of the Game Object.
|
||||
* @property {number} width - The width of the BitmapText, taking into account the x scale of the Game Object.
|
||||
* @property {number} height - The height of the BitmapText, taking into account the y scale of the Game Object.
|
||||
*/
|
11
src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js
Normal file
11
src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.JSONBitmapText
|
||||
* @extends {Phaser.GameObjects.Types.JSONGameObject}
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {string} font - The name of the font.
|
||||
* @property {string} text - The text that this Bitmap Text displays.
|
||||
* @property {number} fontSize - The size of the font.
|
||||
* @property {number} letterSpacing - Adds / Removes spacing between characters.
|
||||
* @property {integer} align - The alignment of the text in a multi-line BitmapText object.
|
||||
*/
|
11
src/gameobjects/bitmaptext/typedefs/LocalBitmapTextSize.js
Normal file
11
src/gameobjects/bitmaptext/typedefs/LocalBitmapTextSize.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* The position and size of the Bitmap Text in local space, taking just the font size into account.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.LocalBitmapTextSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} x - The x position of the BitmapText.
|
||||
* @property {number} y - The y position of the BitmapText.
|
||||
* @property {number} width - The width of the BitmapText.
|
||||
* @property {number} height - The height of the BitmapText.
|
||||
*/
|
15
src/gameobjects/bitmaptext/typedefs/RetroFontConfig.js
Normal file
15
src/gameobjects/bitmaptext/typedefs/RetroFontConfig.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.RetroFontConfig
|
||||
* @since 3.6.0
|
||||
*
|
||||
* @property {string} image - The key of the image containing the font.
|
||||
* @property {number} offset.x - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
|
||||
* @property {number} offset.y - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
|
||||
* @property {number} width - The width of each character in the font set.
|
||||
* @property {number} height - The height of each character in the font set.
|
||||
* @property {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
|
||||
* @property {number} charsPerRow - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
|
||||
* @property {number} spacing.x - If the characters in the font set have horizontal spacing between them set the required amount here.
|
||||
* @property {number} spacing.y - If the characters in the font set have vertical spacing between them set the required amount here.
|
||||
* @property {number} lineSpacing - The amount of vertical space to add to the line height of the font.
|
||||
*/
|
9
src/gameobjects/bitmaptext/typedefs/TintConfig.js
Normal file
9
src/gameobjects/bitmaptext/typedefs/TintConfig.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.BitmapText.Types.TintConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} topLeft - The top left tint value. Always zero in canvas.
|
||||
* @property {number} topRight - The top right tint value. Always zero in canvas.
|
||||
* @property {number} bottomLeft - The bottom left tint value. Always zero in canvas.
|
||||
* @property {number} bottomRight - The bottom right tint value. Always zero in canvas.
|
||||
*/
|
9
src/gameobjects/bitmaptext/typedefs/index.js
Normal file
9
src/gameobjects/bitmaptext/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.GameObjects.BitmapText.Types
|
||||
*/
|
|
@ -4,31 +4,6 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONGameObject
|
||||
*
|
||||
* @property {string} name - The name of this Game Object.
|
||||
* @property {string} type - A textual representation of this Game Object, i.e. `sprite`.
|
||||
* @property {number} x - The x position of this Game Object.
|
||||
* @property {number} y - The y position of this Game Object.
|
||||
* @property {object} scale - The scale of this Game Object
|
||||
* @property {number} scale.x - The horizontal scale of this Game Object.
|
||||
* @property {number} scale.y - The vertical scale of this Game Object.
|
||||
* @property {object} origin - The origin of this Game Object.
|
||||
* @property {number} origin.x - The horizontal origin of this Game Object.
|
||||
* @property {number} origin.y - The vertical origin of this Game Object.
|
||||
* @property {boolean} flipX - The horizontally flipped state of the Game Object.
|
||||
* @property {boolean} flipY - The vertically flipped state of the Game Object.
|
||||
* @property {number} rotation - The angle of this Game Object in radians.
|
||||
* @property {number} alpha - The alpha value of the Game Object.
|
||||
* @property {boolean} visible - The visible state of the Game Object.
|
||||
* @property {integer} scaleMode - The Scale Mode being used by this Game Object.
|
||||
* @property {(integer|string)} blendMode - Sets the Blend Mode being used by this Game Object.
|
||||
* @property {string} textureKey - The texture key of this Game Object.
|
||||
* @property {string} frameKey - The frame key of this Game Object.
|
||||
* @property {object} data - The data of this Game Object.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Build a JSON representation of the given Game Object.
|
||||
*
|
||||
|
@ -39,7 +14,7 @@
|
|||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.
|
||||
*
|
||||
* @return {JSONGameObject} A JSON representation of the Game Object.
|
||||
* @return {Phaser.GameObjects.Types.JSONGameObject} A JSON representation of the Game Object.
|
||||
*/
|
||||
var ToJSON = function (gameObject)
|
||||
{
|
||||
|
|
|
@ -23,44 +23,6 @@ var GetValue = require('../../utils/object/GetValue');
|
|||
var MATH_CONST = require('../../math/const');
|
||||
var Render = require('./GraphicsRender');
|
||||
|
||||
/**
|
||||
* Graphics line style (or stroke style) settings.
|
||||
*
|
||||
* @typedef {object} GraphicsLineStyle
|
||||
*
|
||||
* @property {number} [width] - The stroke width.
|
||||
* @property {number} [color] - The stroke color.
|
||||
* @property {number} [alpha] - The stroke alpha.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Graphics fill style settings.
|
||||
*
|
||||
* @typedef {object} GraphicsFillStyle
|
||||
*
|
||||
* @property {number} [color] - The fill color.
|
||||
* @property {number} [alpha] - The fill alpha.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Graphics style settings.
|
||||
*
|
||||
* @typedef {object} GraphicsStyles
|
||||
*
|
||||
* @property {GraphicsLineStyle} [lineStyle] - The style applied to shape outlines.
|
||||
* @property {GraphicsFillStyle} [fillStyle] - The style applied to shape areas.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options for the Graphics game Object.
|
||||
*
|
||||
* @typedef {object} GraphicsOptions
|
||||
* @extends GraphicsStyles
|
||||
*
|
||||
* @property {number} [x] - The x coordinate of the Graphics.
|
||||
* @property {number} [y] - The y coordinate of the Graphics.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as
|
||||
|
@ -118,7 +80,7 @@ var Render = require('./GraphicsRender');
|
|||
* @extends Phaser.GameObjects.Components.ScrollFactor
|
||||
*
|
||||
* @param {Phaser.Scene} scene - The Scene to which this Graphics object belongs.
|
||||
* @param {GraphicsOptions} [options] - Options that set the position and default style of this Graphics object.
|
||||
* @param {Phaser.GameObjects.Graphics.Types.Options} [options] - Options that set the position and default style of this Graphics object.
|
||||
*/
|
||||
var Graphics = new Class({
|
||||
|
||||
|
@ -247,7 +209,7 @@ var Graphics = new Class({
|
|||
* @method Phaser.GameObjects.Graphics#setDefaultStyles
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {GraphicsStyles} options - The styles to set as defaults.
|
||||
* @param {Phaser.GameObjects.Graphics.Types.Styles} options - The styles to set as defaults.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} This Game Object.
|
||||
*/
|
||||
|
@ -730,15 +692,6 @@ var Graphics = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} RoundedRectRadius
|
||||
*
|
||||
* @property {number} [tl=20] - Top left
|
||||
* @property {number} [tr=20] - Top right
|
||||
* @property {number} [br=20] - Bottom right
|
||||
* @property {number} [bl=20] - Bottom left
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fill a rounded rectangle with the given position, size and radius.
|
||||
*
|
||||
|
@ -749,7 +702,7 @@ var Graphics = new Class({
|
|||
* @param {number} y - The y coordinate of the top-left of the rectangle.
|
||||
* @param {number} width - The width of the rectangle.
|
||||
* @param {number} height - The height of the rectangle.
|
||||
* @param {(RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
* @param {(Phaser.GameObjects.Graphics.Types.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} This Game Object.
|
||||
*/
|
||||
|
@ -795,7 +748,7 @@ var Graphics = new Class({
|
|||
* @param {number} y - The y coordinate of the top-left of the rectangle.
|
||||
* @param {number} width - The width of the rectangle.
|
||||
* @param {number} height - The height of the rectangle.
|
||||
* @param {(RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
* @param {(Phaser.GameObjects.Graphics.Types.RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
* @method Phaser.GameObjects.GameObjectFactory#graphics
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {GraphicsOptions} [config] - The Graphics configuration.
|
||||
* @param {Phaser.GameObjects.Graphics.Types.Options} [config] - The Graphics configuration.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} The Game Object that was created.
|
||||
*/
|
||||
|
|
9
src/gameobjects/graphics/typedefs/FillStyle.js
Normal file
9
src/gameobjects/graphics/typedefs/FillStyle.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Graphics fill style settings.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.Graphics.Types.FillStyle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} [color] - The fill color.
|
||||
* @property {number} [alpha] - The fill alpha.
|
||||
*/
|
10
src/gameobjects/graphics/typedefs/LineStyle.js
Normal file
10
src/gameobjects/graphics/typedefs/LineStyle.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Graphics line style (or stroke style) settings.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.Graphics.Types.LineStyle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} [width] - The stroke width.
|
||||
* @property {number} [color] - The stroke color.
|
||||
* @property {number} [alpha] - The stroke alpha.
|
||||
*/
|
10
src/gameobjects/graphics/typedefs/Options.js
Normal file
10
src/gameobjects/graphics/typedefs/Options.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Options for the Graphics game Object.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.Graphics.Types.Options
|
||||
* @extends Phaser.GameObjects.Graphics.Types.Styles
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {number} [x] - The x coordinate of the Graphics.
|
||||
* @property {number} [y] - The y coordinate of the Graphics.
|
||||
*/
|
9
src/gameobjects/graphics/typedefs/RoundedRectRadius.js
Normal file
9
src/gameobjects/graphics/typedefs/RoundedRectRadius.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.Graphics.Types.RoundedRectRadius
|
||||
* @since 3.11.0
|
||||
*
|
||||
* @property {number} [tl=20] - Top left
|
||||
* @property {number} [tr=20] - Top right
|
||||
* @property {number} [br=20] - Bottom right
|
||||
* @property {number} [bl=20] - Bottom left
|
||||
*/
|
9
src/gameobjects/graphics/typedefs/Styles.js
Normal file
9
src/gameobjects/graphics/typedefs/Styles.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* Graphics style settings.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.Graphics.Types.Styles
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {Phaser.GameObjects.Graphics.Types.LineStyle} [lineStyle] - The style applied to shape outlines.
|
||||
* @property {Phaser.GameObjects.Graphics.Types.FillStyle} [fillStyle] - The style applied to shape areas.
|
||||
*/
|
9
src/gameobjects/graphics/typedefs/index.js
Normal file
9
src/gameobjects/graphics/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.GameObjects.Graphics.Types
|
||||
*/
|
|
@ -15,99 +15,8 @@ var Set = require('../../structs/Set');
|
|||
var Sprite = require('../sprite/Sprite');
|
||||
|
||||
/**
|
||||
* @callback GroupCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} item - A group member
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback GroupMultipleCreateCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject[]} items - The newly created group members
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} GroupConfig
|
||||
*
|
||||
* @property {?GroupClassTypeConstructor} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
|
||||
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
|
||||
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
|
||||
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.
|
||||
* @property {?(string|integer)} [defaultFrame=null] - Sets {@link Phaser.GameObjects.Group#defaultFrame}.
|
||||
* @property {?boolean} [runChildUpdate=false] - Sets {@link Phaser.GameObjects.Group#runChildUpdate}.
|
||||
* @property {?GroupCallback} [createCallback=null] - Sets {@link Phaser.GameObjects.Group#createCallback}.
|
||||
* @property {?GroupCallback} [removeCallback=null] - Sets {@link Phaser.GameObjects.Group#removeCallback}.
|
||||
* @property {?GroupMultipleCreateCallback} [createMultipleCallback=null] - Sets {@link Phaser.GameObjects.Group#createMultipleCallback}.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} GroupCreateConfig
|
||||
*
|
||||
* The total number of objects created will be
|
||||
*
|
||||
* key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat)
|
||||
*
|
||||
* In the simplest case, 1 + `repeat` objects will be created.
|
||||
*
|
||||
* If `max` is positive, then the total created will not exceed `max`.
|
||||
*
|
||||
* `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used.
|
||||
*
|
||||
* @property {?GroupClassTypeConstructor} [classType] - The class of each new Game Object.
|
||||
* @property {string} [key] - The texture key of each new Game Object.
|
||||
* @property {?(string|integer)} [frame=null] - The texture frame of each new Game Object.
|
||||
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
|
||||
* @property {?boolean} [active=true] - The active state of each new Game Object.
|
||||
* @property {?number} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination).
|
||||
* @property {?boolean} [randomKey=false] - Select a `key` at random.
|
||||
* @property {?boolean} [randomFrame=false] - Select a `frame` at random.
|
||||
* @property {?boolean} [yoyo=false] - Select keys and frames by moving forward then backward through `key` and `frame`.
|
||||
* @property {?number} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`.
|
||||
* @property {?number} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum.
|
||||
* @property {?object} [setXY]
|
||||
* @property {?number} [setXY.x=0] - The horizontal position of each new Game Object.
|
||||
* @property {?number} [setXY.y=0] - The vertical position of each new Game Object.
|
||||
* @property {?number} [setXY.stepX=0] - Increment each Game Object's horizontal position from the previous by this amount, starting from `setXY.x`.
|
||||
* @property {?number} [setXY.stepY=0] - Increment each Game Object's vertical position from the previous by this amount, starting from `setXY.y`.
|
||||
* @property {?object} [setRotation]
|
||||
* @property {?number} [setRotation.value=0] - Rotation of each new Game Object.
|
||||
* @property {?number} [setRotation.step=0] - Increment each Game Object's rotation from the previous by this amount, starting at `setRotation.value`.
|
||||
* @property {?object} [setScale]
|
||||
* @property {?number} [setScale.x=0] - The horizontal scale of each new Game Object.
|
||||
* @property {?number} [setScale.y=0] - The vertical scale of each new Game Object.
|
||||
* @property {?number} [setScale.stepX=0] - Increment each Game Object's horizontal scale from the previous by this amount, starting from `setScale.x`.
|
||||
* @property {?number} [setScale.stepY=0] - Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`.
|
||||
* @property {?object} [setAlpha]
|
||||
* @property {?number} [setAlpha.value=0] - The alpha value of each new Game Object.
|
||||
* @property {?number} [setAlpha.step=0] - Increment each Game Object's alpha from the previous by this amount, starting from `setAlpha.value`.
|
||||
* @property {?*} [hitArea] - A geometric shape that defines the hit area for the Game Object.
|
||||
* @property {?HitAreaCallback} [hitAreaCallback] - A callback to be invoked when the Game Object is interacted with.
|
||||
* @property {?(false|GridAlignConfig)} [gridAlign=false] - Align the new Game Objects in a grid using these settings.
|
||||
*
|
||||
* @see Phaser.Actions.GridAlign
|
||||
* @see Phaser.Actions.SetAlpha
|
||||
* @see Phaser.Actions.SetHitArea
|
||||
* @see Phaser.Actions.SetRotation
|
||||
* @see Phaser.Actions.SetScale
|
||||
* @see Phaser.Actions.SetXY
|
||||
* @see Phaser.GameObjects.Group#createFromConfig
|
||||
* @see Phaser.Utils.Array.Range
|
||||
*/
|
||||
|
||||
/**
|
||||
* A constructor function (class) that can be assigned to `classType`.
|
||||
* @callback GroupClassTypeConstructor
|
||||
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
|
||||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
|
||||
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
|
||||
*
|
||||
* @see Phaser.GameObjects.Group#classType
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc A Group is a way for you to create, manipulate, or recycle similar Game Objects.
|
||||
* @classdesc
|
||||
* A Group is a way for you to create, manipulate, or recycle similar Game Objects.
|
||||
*
|
||||
* Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none.
|
||||
*
|
||||
|
@ -118,8 +27,8 @@ var Sprite = require('../sprite/Sprite');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
* @param {Phaser.Scene} scene - The scene this group belongs to.
|
||||
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
|
||||
* @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings.
|
||||
* @param {(Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group.Types.GroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
|
||||
* @param {Phaser.GameObjects.Group.Types.GroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings.
|
||||
*
|
||||
* @see Phaser.Physics.Arcade.Group
|
||||
* @see Phaser.Physics.Arcade.StaticGroup
|
||||
|
|
|
@ -15,7 +15,7 @@ var Group = require('./Group');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#group
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {GroupConfig|GroupCreateConfig} config - The configuration object this Game Object will use to create itself.
|
||||
* @param {Phaser.GameObjects.Group.Types.GroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig} config - The configuration object this Game Object will use to create itself.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Group} The Game Object that was created.
|
||||
*/
|
||||
|
|
|
@ -15,8 +15,8 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
* @method Phaser.GameObjects.GameObjectFactory#group
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument.
|
||||
* @param {GroupConfig|GroupCreateConfig} [config] - A Group Configuration object.
|
||||
* @param {(Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group.Types.GroupConfig|Phaser.GameObjects.Group.Types.GroupConfig[])} [children] - Game Objects to add to this Group; or the `config` argument.
|
||||
* @param {Phaser.GameObjects.Group.Types.GroupConfig|Phaser.GameObjects.Group.Types.GroupCreateConfig} [config] - A Group Configuration object.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Group} The Game Object that was created.
|
||||
*/
|
||||
|
|
14
src/gameobjects/group/typedefs/GroupConfig.js
Normal file
14
src/gameobjects/group/typedefs/GroupConfig.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* @typedef {object} Phaser.GameObjects.Group.Types.GroupConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {?Phaser.GameObjects.Group.Types.GroupClassTypeConstructor} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
|
||||
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
|
||||
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
|
||||
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.
|
||||
* @property {?(string|integer)} [defaultFrame=null] - Sets {@link Phaser.GameObjects.Group#defaultFrame}.
|
||||
* @property {?boolean} [runChildUpdate=false] - Sets {@link Phaser.GameObjects.Group#runChildUpdate}.
|
||||
* @property {?Phaser.GameObjects.Group.Types.GroupCallback} [createCallback=null] - Sets {@link Phaser.GameObjects.Group#createCallback}.
|
||||
* @property {?Phaser.GameObjects.Group.Types.GroupCallback} [removeCallback=null] - Sets {@link Phaser.GameObjects.Group#removeCallback}.
|
||||
* @property {?Phaser.GameObjects.Group.Types.GroupMultipleCreateCallback} [createMultipleCallback=null] - Sets {@link Phaser.GameObjects.Group#createMultipleCallback}.
|
||||
*/
|
54
src/gameobjects/group/typedefs/GroupCreateConfig.js
Normal file
54
src/gameobjects/group/typedefs/GroupCreateConfig.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* The total number of objects created will be
|
||||
*
|
||||
* key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat)
|
||||
*
|
||||
* In the simplest case, 1 + `repeat` objects will be created.
|
||||
*
|
||||
* If `max` is positive, then the total created will not exceed `max`.
|
||||
*
|
||||
* `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used.
|
||||
*
|
||||
* @typedef {object} Phaser.GameObjects.Group.Types.GroupCreateConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @property {?Phaser.GameObjects.Group.Types.GroupClassTypeConstructor} [classType] - The class of each new Game Object.
|
||||
* @property {string} [key] - The texture key of each new Game Object.
|
||||
* @property {?(string|integer)} [frame=null] - The texture frame of each new Game Object.
|
||||
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
|
||||
* @property {?boolean} [active=true] - The active state of each new Game Object.
|
||||
* @property {?number} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination).
|
||||
* @property {?boolean} [randomKey=false] - Select a `key` at random.
|
||||
* @property {?boolean} [randomFrame=false] - Select a `frame` at random.
|
||||
* @property {?boolean} [yoyo=false] - Select keys and frames by moving forward then backward through `key` and `frame`.
|
||||
* @property {?number} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`.
|
||||
* @property {?number} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum.
|
||||
* @property {?object} [setXY]
|
||||
* @property {?number} [setXY.x=0] - The horizontal position of each new Game Object.
|
||||
* @property {?number} [setXY.y=0] - The vertical position of each new Game Object.
|
||||
* @property {?number} [setXY.stepX=0] - Increment each Game Object's horizontal position from the previous by this amount, starting from `setXY.x`.
|
||||
* @property {?number} [setXY.stepY=0] - Increment each Game Object's vertical position from the previous by this amount, starting from `setXY.y`.
|
||||
* @property {?object} [setRotation]
|
||||
* @property {?number} [setRotation.value=0] - Rotation of each new Game Object.
|
||||
* @property {?number} [setRotation.step=0] - Increment each Game Object's rotation from the previous by this amount, starting at `setRotation.value`.
|
||||
* @property {?object} [setScale]
|
||||
* @property {?number} [setScale.x=0] - The horizontal scale of each new Game Object.
|
||||
* @property {?number} [setScale.y=0] - The vertical scale of each new Game Object.
|
||||
* @property {?number} [setScale.stepX=0] - Increment each Game Object's horizontal scale from the previous by this amount, starting from `setScale.x`.
|
||||
* @property {?number} [setScale.stepY=0] - Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`.
|
||||
* @property {?object} [setAlpha]
|
||||
* @property {?number} [setAlpha.value=0] - The alpha value of each new Game Object.
|
||||
* @property {?number} [setAlpha.step=0] - Increment each Game Object's alpha from the previous by this amount, starting from `setAlpha.value`.
|
||||
* @property {?*} [hitArea] - A geometric shape that defines the hit area for the Game Object.
|
||||
* @property {?HitAreaCallback} [hitAreaCallback] - A callback to be invoked when the Game Object is interacted with.
|
||||
* @property {?(false|Phaser.Actions.Types.GridAlignConfig)} [gridAlign=false] - Align the new Game Objects in a grid using these settings.
|
||||
*
|
||||
* @see Phaser.Actions.GridAlign
|
||||
* @see Phaser.Actions.SetAlpha
|
||||
* @see Phaser.Actions.SetHitArea
|
||||
* @see Phaser.Actions.SetRotation
|
||||
* @see Phaser.Actions.SetScale
|
||||
* @see Phaser.Actions.SetXY
|
||||
* @see Phaser.GameObjects.Group#createFromConfig
|
||||
* @see Phaser.Utils.Array.Range
|
||||
*/
|
9
src/gameobjects/group/typedefs/index.js
Normal file
9
src/gameobjects/group/typedefs/index.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @author Richard Davey <rich@photonstorm.com>
|
||||
* @copyright 2019 Photon Storm Ltd.
|
||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.GameObjects.Group.Types
|
||||
*/
|
|
@ -10,84 +10,6 @@ var GetEaseFunction = require('../../tweens/builders/GetEaseFunction');
|
|||
var GetFastValue = require('../../utils/object/GetFastValue');
|
||||
var Wrap = require('../../math/Wrap');
|
||||
|
||||
/**
|
||||
* The returned value sets what the property will be at the START of the particle's life, on emit.
|
||||
* @callback EmitterOpOnEmitCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.Particles.Particle} particle - The particle.
|
||||
* @param {string} key - The name of the property.
|
||||
* @param {number} value - The current value of the property.
|
||||
*
|
||||
* @return {number} The new value of the property.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The returned value updates the property for the duration of the particle's life.
|
||||
* @callback EmitterOpOnUpdateCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.Particles.Particle} particle - The particle.
|
||||
* @param {string} key - The name of the property.
|
||||
* @param {number} t - The normalized lifetime of the particle, between 0 (start) and 1 (end).
|
||||
* @param {number} value - The current value of the property.
|
||||
*
|
||||
* @return {number} The new value of the property.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a random value within a range.
|
||||
* @typedef {object} EmitterOpRandomConfig
|
||||
*
|
||||
* @property {number[]} random - The minimum and maximum values, as [min, max].
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a random value within a range.
|
||||
* @typedef {object} EmitterOpRandomMinMaxConfig
|
||||
*
|
||||
* @property {number} min - The minimum value.
|
||||
* @property {number} max - The maximum value.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a random value within a range.
|
||||
* @typedef {object} EmitterOpRandomStartEndConfig
|
||||
*
|
||||
* @property {number} start - The starting value.
|
||||
* @property {number} end - The ending value.
|
||||
* @property {boolean} random - If false, this becomes {@link EmitterOpEaseConfig}.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a value incremented continuously across a range.
|
||||
* @typedef {object} EmitterOpEaseConfig
|
||||
*
|
||||
* @property {number} start - The starting value.
|
||||
* @property {number} end - The ending value.
|
||||
* @property {string} [ease='Linear'] - The name of the easing function.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Defines an operation yielding a value incremented by steps across a range.
|
||||
* @typedef {object} EmitterOpSteppedConfig
|
||||
*
|
||||
* @property {number} start - The starting value.
|
||||
* @property {number} end - The ending value.
|
||||
* @property {number} steps - The number of steps between start and end.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} EmitterOpCustomEmitConfig
|
||||
*
|
||||
* @property {EmitterOpOnEmitCallback} onEmit - A callback that is invoked each time the emitter emits a particle.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} EmitterOpCustomUpdateConfig
|
||||
*
|
||||
* @property {EmitterOpOnEmitCallback} [onEmit] - A callback that is invoked each time the emitter emits a particle.
|
||||
* @property {EmitterOpOnUpdateCallback} onUpdate - A callback that is invoked each time the emitter updates.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A Particle Emitter property.
|
||||
|
@ -99,7 +21,7 @@ var Wrap = require('../../math/Wrap');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterConfig} config - Settings for the Particle Emitter that owns this property.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterConfig} config - Settings for the Particle Emitter that owns this property.
|
||||
* @param {string} key - The name of the property.
|
||||
* @param {number} defaultValue - The default value of the property.
|
||||
* @param {boolean} [emitOnly=false] - Whether the property can only be modified when a Particle is emitted.
|
||||
|
@ -211,7 +133,7 @@ var EmitterOp = new Class({
|
|||
* The callback to run for Particles when they are emitted from the Particle Emitter.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.EmitterOp#onEmit
|
||||
* @type {EmitterOpOnEmitCallback}
|
||||
* @type {Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.onEmit = this.defaultEmit;
|
||||
|
@ -220,7 +142,7 @@ var EmitterOp = new Class({
|
|||
* The callback to run for Particles when they are updated.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.EmitterOp#onUpdate
|
||||
* @type {EmitterOpOnUpdateCallback}
|
||||
* @type {Phaser.GameObjects.Particles.Types.EmitterOpOnUpdateCallback}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.onUpdate = this.defaultUpdate;
|
||||
|
@ -236,7 +158,7 @@ var EmitterOp = new Class({
|
|||
* @method Phaser.GameObjects.Particles.EmitterOp#loadConfig
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterConfig} [config] - Settings for the Particle Emitter that owns this property.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterConfig} [config] - Settings for the Particle Emitter that owns this property.
|
||||
* @param {string} [newKey] - The new key to use for this property, if any.
|
||||
*/
|
||||
loadConfig: function (config, newKey)
|
||||
|
@ -501,7 +423,7 @@ var EmitterOp = new Class({
|
|||
* @param {string} key - The name of the property.
|
||||
* @param {number} [value] - The current value of the property.
|
||||
*
|
||||
* @return {number} The new value of hte property.
|
||||
* @return {number} The new value of the property.
|
||||
*/
|
||||
defaultEmit: function (particle, key, value)
|
||||
{
|
||||
|
|
|
@ -7,16 +7,6 @@
|
|||
var Class = require('../../utils/Class');
|
||||
var GetFastValue = require('../../utils/object/GetFastValue');
|
||||
|
||||
/**
|
||||
* @typedef {object} GravityWellConfig
|
||||
*
|
||||
* @property {number} [x=0] - The x coordinate of the Gravity Well, in world space.
|
||||
* @property {number} [y=0] - The y coordinate of the Gravity Well, in world space.
|
||||
* @property {number} [power=0] - The strength of the gravity force - larger numbers produce a stronger force.
|
||||
* @property {number} [epsilon=100] - The minimum distance for which the gravity force is calculated.
|
||||
* @property {number} [gravity=50] - The gravitational force of this Gravity Well.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* The GravityWell action applies a force on the particle to draw it towards, or repel it from, a single point.
|
||||
|
@ -30,7 +20,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(number|GravityWellConfig)} [x=0] - The x coordinate of the Gravity Well, in world space.
|
||||
* @param {(number|Phaser.GameObjects.Particles.Types.GravityWellConfig)} [x=0] - The x coordinate of the Gravity Well, in world space.
|
||||
* @param {number} [y=0] - The y coordinate of the Gravity Well, in world space.
|
||||
* @param {number} [power=0] - The strength of the gravity force - larger numbers produce a stronger force.
|
||||
* @param {number} [epsilon=100] - The minimum distance for which the gravity force is calculated.
|
||||
|
|
|
@ -21,131 +21,6 @@ var StableSort = require('../../utils/array/StableSort');
|
|||
var Vector2 = require('../../math/Vector2');
|
||||
var Wrap = require('../../math/Wrap');
|
||||
|
||||
/**
|
||||
* @callback ParticleEmitterCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.Particles.Particle} particle - The particle associated with the call.
|
||||
* @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - This particle emitter associated with the call.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @callback ParticleDeathCallback
|
||||
*
|
||||
* @param {Phaser.GameObjects.Particles.Particle} particle - The particle that died.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterBounds
|
||||
*
|
||||
* @property {number} x - The left edge of the rectangle.
|
||||
* @property {number} y - The top edge of the rectangle.
|
||||
* @property {number} width - The width of the rectangle.
|
||||
* @property {number} height - The height of the rectangle.
|
||||
*
|
||||
* @see Phaser.GameObjects.Particles.ParticleEmitter#setBounds
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterBoundsAlt
|
||||
*
|
||||
* @property {number} x - The left edge of the rectangle.
|
||||
* @property {number} y - The top edge of the rectangle.
|
||||
* @property {number} w - The width of the rectangle.
|
||||
* @property {number} h - The height of the rectangle.
|
||||
*
|
||||
* @see Phaser.GameObjects.Particles.ParticleEmitter#setBounds
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterDeathZoneConfig
|
||||
*
|
||||
* @property {DeathZoneSource} source - A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.DeathZone#source}.
|
||||
* @property {string} [type='onEnter'] - 'onEnter' or 'onLeave'.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterEdgeZoneConfig
|
||||
*
|
||||
* @property {EdgeZoneSource} source - A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}.
|
||||
* @property {string} type - 'edge'.
|
||||
* @property {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead.
|
||||
* @property {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to 0.
|
||||
* @property {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start.
|
||||
* @property {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterRandomZoneConfig
|
||||
*
|
||||
* @property {RandomZoneSource} source - A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.RandomZone#source}.
|
||||
* @property {string} [type] - 'random'.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterConfig
|
||||
*
|
||||
* @property {boolean} [active] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#active}.
|
||||
* @property {(Phaser.BlendModes|string)} [blendMode] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#blendMode}.
|
||||
* @property {*} [callbackScope] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope} and {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}.
|
||||
* @property {boolean} [collideBottom] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideBottom}.
|
||||
* @property {boolean} [collideLeft] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideLeft}.
|
||||
* @property {boolean} [collideRight] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideRight}.
|
||||
* @property {boolean} [collideTop] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#collideTop}.
|
||||
* @property {boolean} [deathCallback] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallback}.
|
||||
* @property {*} [deathCallbackScope] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#deathCallbackScope}.
|
||||
* @property {function} [emitCallback] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallback}.
|
||||
* @property {*} [emitCallbackScope] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitCallbackScope}.
|
||||
* @property {Phaser.GameObjects.GameObject} [follow] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#follow}.
|
||||
* @property {number} [frequency] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}.
|
||||
* @property {number} [gravityX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityX}.
|
||||
* @property {number} [gravityY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityY}.
|
||||
* @property {integer} [maxParticles] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}.
|
||||
* @property {string} [name] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#name}.
|
||||
* @property {boolean} [on] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#on}.
|
||||
* @property {boolean} [particleBringToTop] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop}.
|
||||
* @property {Phaser.GameObjects.Particles.Particle} [particleClass] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleClass}.
|
||||
* @property {boolean} [radial] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#radial}.
|
||||
* @property {number} [timeScale] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#timeScale}.
|
||||
* @property {boolean} [trackVisible] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#trackVisible}.
|
||||
* @property {boolean} [visible] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#visible}.
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [accelerationX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationX} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [accelerationY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#accelerationY} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnUpdateCallback|object} [alpha] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#alpha}.
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [angle] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#angle} (emit only)
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [bounce] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#bounce} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [delay] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#delay} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [lifespan] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#lifespan} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [maxVelocityX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityX} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [maxVelocityY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxVelocityY} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [moveToX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToX} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [moveToY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#moveToY} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [quantity] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnUpdateCallback|object} [rotate] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#rotate}.
|
||||
* @property {number|number[]|EmitterOpOnUpdateCallback|object} [scale] - As {@link Phaser.GameObjects.Particles.ParticleEmitter#setScale}.
|
||||
* @property {number|number[]|EmitterOpOnUpdateCallback|object} [scaleX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleX}.
|
||||
* @property {number|number[]|EmitterOpOnUpdateCallback|object} [scaleY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#scaleY}.
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [speed] - As {@link Phaser.GameObjects.Particles.ParticleEmitter#setSpeed} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [speedX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedX} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [speedY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#speedY} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [tint] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#tint}.
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [x] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#x} (emit only).
|
||||
* @property {number|number[]|EmitterOpOnEmitCallback|object} [y] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#y} (emit only).
|
||||
* @property {object} [emitZone] - As {@link Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone}.
|
||||
* @property {ParticleEmitterBounds|ParticleEmitterBoundsAlt} [bounds] - As {@link Phaser.GameObjects.Particles.ParticleEmitter#setBounds}.
|
||||
* @property {object} [followOffset] - Assigns to {@link Phaser.GameObjects.Particles.ParticleEmitter#followOffset}.
|
||||
* @property {number} [followOffset.x] - x-coordinate of the offset.
|
||||
* @property {number} [followOffset.y] - y-coordinate of the offset.
|
||||
* @property {number|number[]|string|string[]|Phaser.Textures.Frame|Phaser.Textures.Frame[]|ParticleEmitterFrameConfig} [frame] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} ParticleEmitterFrameConfig
|
||||
*
|
||||
* @property {number|number[]|string|string[]|Phaser.Textures.Frame|Phaser.Textures.Frame[]} [frames] - One or more texture frames.
|
||||
* @property {boolean} [cycle] - Whether texture frames will be assigned consecutively (true) or at random (false).
|
||||
* @property {integer} [quantity] - The number of consecutive particles receiving each texture frame, when `cycle` is true.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A particle emitter represents a single particle stream.
|
||||
|
@ -162,7 +37,7 @@ var Wrap = require('../../math/Wrap');
|
|||
* @extends Phaser.GameObjects.Components.Visible
|
||||
*
|
||||
* @param {Phaser.GameObjects.Particles.ParticleEmitterManager} manager - The Emitter Manager this Emitter belongs to.
|
||||
* @param {ParticleEmitterConfig} config - Settings for this emitter.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterConfig} config - Settings for this emitter.
|
||||
*/
|
||||
var ParticleEmitter = new Class({
|
||||
|
||||
|
@ -548,7 +423,7 @@ var ParticleEmitter = new Class({
|
|||
* A function to call when a particle is emitted.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.ParticleEmitter#emitCallback
|
||||
* @type {?ParticleEmitterCallback}
|
||||
* @type {?Phaser.GameObjects.Particles.Types.ParticleEmitterCallback}
|
||||
* @default null
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -568,7 +443,7 @@ var ParticleEmitter = new Class({
|
|||
* A function to call when a particle dies.
|
||||
*
|
||||
* @name Phaser.GameObjects.Particles.ParticleEmitter#deathCallback
|
||||
* @type {?ParticleDeathCallback}
|
||||
* @type {?Phaser.GameObjects.Particles.Types.ParticleDeathCallback}
|
||||
* @default null
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -893,7 +768,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#fromJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterConfig} config - Settings for this emitter.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterConfig} config - Settings for this emitter.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1130,7 +1005,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(array|string|integer|ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object.
|
||||
* @param {(array|string|integer|Phaser.GameObjects.Particles.Types.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object.
|
||||
* @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`.
|
||||
* @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame.
|
||||
*
|
||||
|
@ -1207,8 +1082,8 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setPosition
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} x - The x-coordinate of the particle origin.
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} y - The y-coordinate of the particle origin.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} x - The x-coordinate of the particle origin.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} y - The y-coordinate of the particle origin.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1228,7 +1103,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setBounds
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(number|ParticleEmitterBounds|ParticleEmitterBoundsAlt)} x - The x-coordinate of the left edge of the boundary, or an object representing a rectangle.
|
||||
* @param {(number|Phaser.GameObjects.Particles.Types.ParticleEmitterBounds|Phaser.GameObjects.Particles.Types.ParticleEmitterBoundsAlt)} x - The x-coordinate of the left edge of the boundary, or an object representing a rectangle.
|
||||
* @param {number} y - The y-coordinate of the top edge of the boundary.
|
||||
* @param {number} width - The width of the boundary.
|
||||
* @param {number} height - The height of the boundary.
|
||||
|
@ -1266,7 +1141,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1287,7 +1162,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeedY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1311,7 +1186,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setSpeed
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The speed, in pixels per second.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1332,7 +1207,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1349,7 +1224,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setScaleY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1366,7 +1241,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setScale
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnUpdateCallback|object} value - The scale, relative to 1.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1437,7 +1312,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setAlpha
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnUpdateCallback|object} value - A value between 0 (transparent) and 1 (opaque).
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnUpdateCallback|object} value - A value between 0 (transparent) and 1 (opaque).
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1454,7 +1329,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitterAngle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The angle of the initial velocity of emitted particles.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The angle of the initial velocity of emitted particles.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1471,7 +1346,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setAngle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The angle of the initial velocity of emitted particles.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The angle of the initial velocity of emitted particles.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1488,7 +1363,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setLifespan
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} value - The particle lifespan, in ms.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} value - The particle lifespan, in ms.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1505,7 +1380,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setQuantity
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} quantity - The number of particles to release at each flow cycle or explosion.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} quantity - The number of particles to release at each flow cycle or explosion.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1524,7 +1399,7 @@ var ParticleEmitter = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms; or -1 to put the emitter in explosion mode.
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} [quantity] - The number of particles to release at each flow cycle or explosion.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} [quantity] - The number of particles to release at each flow cycle or explosion.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1545,14 +1420,14 @@ var ParticleEmitter = new Class({
|
|||
/**
|
||||
* Sets or removes the {@link Phaser.GameObjects.Particles.ParticleEmitter#emitZone}.
|
||||
*
|
||||
* An {@link ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link EdgeZoneSourceCallback getPoints} method.
|
||||
* An {@link Phaser.GameObjects.Particles.Types.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. Its {@link EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.GameObjects.Particles.Types.EdgeZoneSourceCallback getPoints} method.
|
||||
*
|
||||
* A {@link ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link RandomZoneSourceCallback getRandomPoint} method.
|
||||
* A {@link Phaser.GameObjects.Particles.Types.ParticleEmitterRandomZoneConfig RandomZone} places randomly within its interior. Its {@link RandomZoneSource source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.GameObjects.Particles.Types.RandomZoneSourceCallback getRandomPoint} method.
|
||||
*
|
||||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterEdgeZoneConfig|ParticleEmitterRandomZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current emit zone.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterEdgeZoneConfig|Phaser.GameObjects.Particles.Types.ParticleEmitterRandomZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current emit zone.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1601,7 +1476,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterDeathZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current death zone.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterDeathZoneConfig} [zoneConfig] - An object describing the zone, or `undefined` to remove any current death zone.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
@ -1711,7 +1586,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleEmit
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterCallback} callback - The function.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterCallback} callback - The function.
|
||||
* @param {*} [context] - The calling context.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
|
@ -1743,7 +1618,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#onParticleDeath
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleDeathCallback} callback - The function.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleDeathCallback} callback - The function.
|
||||
* @param {*} [context] - The function's calling context.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
|
@ -1796,7 +1671,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#forEachAlive
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterCallback} callback - The function.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterCallback} callback - The function.
|
||||
* @param {*} context - The function's calling context.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
|
@ -1821,7 +1696,7 @@ var ParticleEmitter = new Class({
|
|||
* @method Phaser.GameObjects.Particles.ParticleEmitter#forEachDead
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {ParticleEmitterCallback} callback - The function.
|
||||
* @param {Phaser.GameObjects.Particles.Types.ParticleEmitterCallback} callback - The function.
|
||||
* @param {*} context - The function's calling context.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
|
@ -1931,7 +1806,7 @@ var ParticleEmitter = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} frequency - The time interval (>= 0) of each flow cycle, in ms.
|
||||
* @param {number|float[]|EmitterOpOnEmitCallback|object} [count=1] - The number of particles to emit at each flow cycle.
|
||||
* @param {number|float[]|Phaser.GameObjects.Particles.Types.EmitterOpOnEmitCallback|object} [count=1] - The number of particles to emit at each flow cycle.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Particles.ParticleEmitter} This Particle Emitter.
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue