phaser
Version:
A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers from the team at Phaser Studio Inc.
741 lines • 46.2 MB
JSON
[
{
"comment": "/**\n * Adds a Bloom effect to a Camera or GameObject or list thereof.\n *\n * Bloom is a phenomenon where bright light spreads across an image.\n * It can be used to add to the realism of a scene,\n * although too much is obvious and a subtle effect is best.\n *\n * This Action creates a Bloom effect by applying several Filters to the target.\n *\n * - `ParallelFilters` splits the filter stream, allowing us to combine\n * the results of other filters with the original image.\n * The other filters are added to the `top` stream.\n * - `Threshold` removes darker colors.\n * - `Blur` spreads the remaining bright colors out.\n *\n * This Action returns an object containing references to these filters.\n * You can control their properties directly,\n * e.g. if you want to animate the Bloom,\n * or if you want to set properties this Action doesn't surface.\n *\n * The Bloom effect will be destroyed like any other filter on target shutdown.\n * To disable or remove the Bloom effect manually, access the `parallelFilters`\n * controller in the return object. It holds the other filters.\n *\n * - `parallelFilters.active = false`: deactivate Bloom\n * - `parallelFilters.destroy()`: destroy Bloom\n *\n * Bloom is best as a full-screen effect. If you apply it to a GameObject with\n * alpha regions, it cannot blend the light glow properly with the background.\n * This is because the glow should use ADD blend, but the object itself should\n * use NORMAL blend, and it can't do both.\n * You can still apply bloom to a GameObject,\n * but it works best on a solid texture.\n *\n * @example\n * // Apply bloom to the scene camera.\n * Phaser.Actions.AddEffectBloom(this.cameras.main);\n *\n * @example\n * // Access the filters that make up a Bloom effect.\n * const { parallelFilters, threshold, blur } = Phaser.Actions.AddEffectBloom(this.cameras.main)[0]; // The return is an array.\n *\n * // Destroy the bloom effect.\n * parallelFilters.destroy();\n *\n * @example\n * // Emulate the Phaser 3 Bloom effect,\n * // including the way bloom strength darkens instead of mixes.\n * const { parallelFilters, threshold, blur } = Phaser.Actions.AddEffectBloom(\n * image,\n * {\n * blendAmount: 0.5,\n * blurQuality: 1,\n * }\n * );\n *\n * threshold.active = false;\n * parallelFilters.bottom.addBlend(undefined, Phaser.BlendModes.MULTIPLY, 1, [ 0. * 5, 0.5, 0.5, 0.5 ]);\n *\n * @function Phaser.Actions.AddEffectBloom\n * @since 4.0.0\n *\n * @param {Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject|Array.<(Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject)>} items - Recipients of the Bloom effect\n * @param {Phaser.Types.Actions.AddEffectBloomConfig} [config] - Initial configuration of the Bloom effect.\n *\n * @return {Phaser.Types.Actions.AddEffectBloomReturn[]} A list of objects containing the filters which were created.\n */",
"meta": {
"filename": "AddEffectBloom.js",
"lineno": 9,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Adds a Bloom effect to a Camera or GameObject or list thereof.\n\nBloom is a phenomenon where bright light spreads across an image.\nIt can be used to add to the realism of a scene,\nalthough too much is obvious and a subtle effect is best.\n\nThis Action creates a Bloom effect by applying several Filters to the target.\n\n- `ParallelFilters` splits the filter stream, allowing us to combine\n the results of other filters with the original image.\n The other filters are added to the `top` stream.\n- `Threshold` removes darker colors.\n- `Blur` spreads the remaining bright colors out.\n\nThis Action returns an object containing references to these filters.\nYou can control their properties directly,\ne.g. if you want to animate the Bloom,\nor if you want to set properties this Action doesn't surface.\n\nThe Bloom effect will be destroyed like any other filter on target shutdown.\nTo disable or remove the Bloom effect manually, access the `parallelFilters`\ncontroller in the return object. It holds the other filters.\n\n- `parallelFilters.active = false`: deactivate Bloom\n- `parallelFilters.destroy()`: destroy Bloom\n\nBloom is best as a full-screen effect. If you apply it to a GameObject with\nalpha regions, it cannot blend the light glow properly with the background.\nThis is because the glow should use ADD blend, but the object itself should\nuse NORMAL blend, and it can't do both.\nYou can still apply bloom to a GameObject,\nbut it works best on a solid texture.",
"examples": [
"// Apply bloom to the scene camera.\nPhaser.Actions.AddEffectBloom(this.cameras.main);",
"// Access the filters that make up a Bloom effect.\nconst { parallelFilters, threshold, blur } = Phaser.Actions.AddEffectBloom(this.cameras.main)[0]; // The return is an array.\n\n// Destroy the bloom effect.\nparallelFilters.destroy();",
"// Emulate the Phaser 3 Bloom effect,\n// including the way bloom strength darkens instead of mixes.\nconst { parallelFilters, threshold, blur } = Phaser.Actions.AddEffectBloom(\n image,\n {\n blendAmount: 0.5,\n blurQuality: 1,\n }\n);\n\nthreshold.active = false;\nparallelFilters.bottom.addBlend(undefined, Phaser.BlendModes.MULTIPLY, 1, [ 0. * 5, 0.5, 0.5, 0.5 ]);"
],
"kind": "function",
"name": "AddEffectBloom",
"since": "4.0.0",
"params": [
{
"type": {
"names": [
"Phaser.Cameras.Scene2D.Camera",
"Phaser.GameObjects.GameObject",
"Array.<(Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject)>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
},
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
},
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
}
]
}
]
}
]
}
},
"description": "Recipients of the Bloom effect",
"name": "items"
},
{
"type": {
"names": [
"Phaser.Types.Actions.AddEffectBloomConfig"
],
"parsedType": {
"type": "NameExpression",
"name": "Phaser.Types.Actions.AddEffectBloomConfig"
}
},
"optional": true,
"description": "Initial configuration of the Bloom effect.",
"name": "config"
}
],
"returns": [
{
"type": {
"names": [
"Array.<Phaser.Types.Actions.AddEffectBloomReturn>"
],
"parsedType": {
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.Types.Actions.AddEffectBloomReturn",
"type": "NameExpression"
}
]
}
},
"description": "A list of objects containing the filters which were created."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.AddEffectBloom",
"scope": "static",
"___id": "T000002R000003",
"___s": true
},
{
"comment": "/**\n * Adds a Shine effect to a Camera or GameObject or list thereof.\n *\n * Shine simulates a highlight glancing from a surface.\n * It's a brief specular reflection of a bright light,\n * typically from a fairly flat surface which only reflects the highlight\n * from certain angles.\n * In a game, you might use this to highlight an important object,\n * convey a sense of glossiness,\n * or move an interference band across a transmission.\n *\n * This Action works by creating several resources.\n *\n * - A Gradient object generates the region of the shine.\n * - A DynamicTexture holds the shine region.\n * - A Tween animates the shine region.\n * - A Blend filter combines the shine and the image.\n * - (Optional) A ParallelFilters filter adds the rest of the image back in.\n *\n * You may configure the effect in several ways using the `config` parameter.\n *\n * Use `radius`, `direction` and `scale` to set the gradient orientation.\n * Scale defaults to 2, twice the size of the target,\n * to guarantee that the highlight leaves the image completely before repeating.\n * The radius also adds an extra offset on either side of the image\n * so the gradient has space to enter and exit the image.\n *\n * Use `colorFactor` to control the RGBA color of the highlight.\n * You can overdrive this to values greater than 1 to create very bright shine.\n * By default, it has a slight red tint to create warm highlights.\n *\n * Use `displacementMap` and `displacement` to add a Displacement filter\n * to the Gradient. This creates the impression of a slightly scuffed surface.\n * You may add other filters to the Gradient; they will be rendered into the\n * DynamicTexture for use in the final blend.\n *\n * Use `reveal` to put the effect into reveal mode.\n * In this mode, the image is only visible under the shine.\n *\n * Use `duration`, `yoyo` and `ease` to control the Tween animation.\n *\n * The resources created in this way will be automatically destroyed\n * when the target is destroyed. You may remove them earlier yourself.\n * Unless you use them in other systems, they are isolated and safe to destroy.\n * (The Tween requires the other resources to exist while it exists.)\n *\n * When you target multiple objects with this method,\n * each creates its own set of resources. Each set is independent,\n * and may be destroyed or manipulated without affecting the others.\n *\n * You can create your own Shine effects using this as a base or as inspiration.\n *\n * @example\n * // Slowly move a cyan highlight up and down an image.\n * // Use a displacement map to dirty up the highlight.\n * const { dynamicTexture, gradient, tween } = Phaser.Actions.AddEffectShine(this.image, {\n * duration: 5000,\n * direction: Math.PI / 2,\n * scale: 1,\n * displacementMap: 'displace',\n * colorFactor: [ 0.5,2,2,1 ],\n * yoyo: true,\n * ease: 'Quad.inout'\n * })[0]; // The return is an array.\n *\n * @function Phaser.Actions.AddEffectShine\n * @since 4.0.0\n *\n * @param {Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject|Array.<(Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject)>} items - Recipients of the Shine effect\n * @param {Phaser.Types.Actions.AddEffectShineConfig} [config] - Initial configuration of the Shine effect.\n *\n * @return {Phaser.Types.Actions.AddEffectShineReturn[]} A list of objects containing the resources which were created.\n */",
"meta": {
"filename": "AddEffectShine.js",
"lineno": 13,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Adds a Shine effect to a Camera or GameObject or list thereof.\n\nShine simulates a highlight glancing from a surface.\nIt's a brief specular reflection of a bright light,\ntypically from a fairly flat surface which only reflects the highlight\nfrom certain angles.\nIn a game, you might use this to highlight an important object,\nconvey a sense of glossiness,\nor move an interference band across a transmission.\n\nThis Action works by creating several resources.\n\n- A Gradient object generates the region of the shine.\n- A DynamicTexture holds the shine region.\n- A Tween animates the shine region.\n- A Blend filter combines the shine and the image.\n- (Optional) A ParallelFilters filter adds the rest of the image back in.\n\nYou may configure the effect in several ways using the `config` parameter.\n\nUse `radius`, `direction` and `scale` to set the gradient orientation.\nScale defaults to 2, twice the size of the target,\nto guarantee that the highlight leaves the image completely before repeating.\nThe radius also adds an extra offset on either side of the image\nso the gradient has space to enter and exit the image.\n\nUse `colorFactor` to control the RGBA color of the highlight.\nYou can overdrive this to values greater than 1 to create very bright shine.\nBy default, it has a slight red tint to create warm highlights.\n\nUse `displacementMap` and `displacement` to add a Displacement filter\nto the Gradient. This creates the impression of a slightly scuffed surface.\nYou may add other filters to the Gradient; they will be rendered into the\nDynamicTexture for use in the final blend.\n\nUse `reveal` to put the effect into reveal mode.\nIn this mode, the image is only visible under the shine.\n\nUse `duration`, `yoyo` and `ease` to control the Tween animation.\n\nThe resources created in this way will be automatically destroyed\nwhen the target is destroyed. You may remove them earlier yourself.\nUnless you use them in other systems, they are isolated and safe to destroy.\n(The Tween requires the other resources to exist while it exists.)\n\nWhen you target multiple objects with this method,\neach creates its own set of resources. Each set is independent,\nand may be destroyed or manipulated without affecting the others.\n\nYou can create your own Shine effects using this as a base or as inspiration.",
"examples": [
"// Slowly move a cyan highlight up and down an image.\n// Use a displacement map to dirty up the highlight.\nconst { dynamicTexture, gradient, tween } = Phaser.Actions.AddEffectShine(this.image, {\n duration: 5000,\n direction: Math.PI / 2,\n scale: 1,\n displacementMap: 'displace',\n colorFactor: [ 0.5,2,2,1 ],\n yoyo: true,\n ease: 'Quad.inout'\n})[0]; // The return is an array."
],
"kind": "function",
"name": "AddEffectShine",
"since": "4.0.0",
"params": [
{
"type": {
"names": [
"Phaser.Cameras.Scene2D.Camera",
"Phaser.GameObjects.GameObject",
"Array.<(Phaser.Cameras.Scene2D.Camera|Phaser.GameObjects.GameObject)>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
},
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
},
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
}
]
}
]
}
]
}
},
"description": "Recipients of the Shine effect",
"name": "items"
},
{
"type": {
"names": [
"Phaser.Types.Actions.AddEffectShineConfig"
],
"parsedType": {
"type": "NameExpression",
"name": "Phaser.Types.Actions.AddEffectShineConfig"
}
},
"optional": true,
"description": "Initial configuration of the Shine effect.",
"name": "config"
}
],
"returns": [
{
"type": {
"names": [
"Array.<Phaser.Types.Actions.AddEffectShineReturn>"
],
"parsedType": {
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.Types.Actions.AddEffectShineReturn",
"type": "NameExpression"
}
]
}
},
"description": "A list of objects containing the resources which were created."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.AddEffectShine",
"scope": "static",
"___id": "T000002R000032",
"___s": true
},
{
"comment": "/**\n * Apply a Mask to a GameObject or Camera or list thereof using a Shape.\n *\n * This is a quick way to add a mask to an object/camera.\n * It creates a Shape and uses FitToRegion to size it correctly.\n *\n * By default, the Mask is a circle, scaled to fit both X and Y axes\n * of the game canvas (so it's not really a circle any more).\n *\n * You can change the shape to 'square', 'rectangle', or 'ellipse'.\n * Control the shape of rectangles or ellipses via `config.aspectRatio`.\n *\n * You can change the coverage much like FitToRegion.\n * You can scale to fit inside, outside, or both axes.\n * You can set the target region; if you do not, the action will choose\n * an appropriate region for you.\n *\n * The action supports an optional Blur effect, applied to the shape.\n * This is good for soft edges on masks.\n * You can use `config.padding` to shrink the shape region inward, leaving room for the blur to spread outward to the intended boundary.\n *\n * The Shape is removed from the scene upon creation.\n * You don't need to manage its life cycle; it should be garbage collected\n * once the Mask filter is destroyed, usually when the scene or target\n * is shut down.\n * If you want to access the Shape, it is available on the mask filter.\n *\n * If you apply this to multiple objects at once,\n * they all have their own shape and mask filter.\n * Note that, if you use external filters, the masks will seem to line up.\n * In this case, it might be more efficient to put all the targets into\n * a Layer or Container and mask that instead.\n *\n * @example\n * const mask = Phaser.Actions.AddMaskShape(target, {\n * blurRadius: 2,\n * padding: 2\n * })[0]; // The return is an array.\n * const shape = mask.maskGameObject; // This reference prevents garbage collection until `shape` is dropped.\n * const blur = shape.filters.external.list[0]; // Nothing else should be in this list.\n *\n * @function Phaser.Actions.AddMaskShape\n * @since 4.0.0\n *\n * @param {Phaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera | Array.<(Phaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera)>} items - The GameObject or Camera or list thereof to which to apply a mask.\n * @param {Phaser.Types.Actions.AddMaskShapeConfig} config - The configuration of the mask shape.\n *\n * @return {Phaser.Filters.Mask[]} The new Mask filters, in order of target.\n */",
"meta": {
"filename": "AddMaskShape.js",
"lineno": 11,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Apply a Mask to a GameObject or Camera or list thereof using a Shape.\n\nThis is a quick way to add a mask to an object/camera.\nIt creates a Shape and uses FitToRegion to size it correctly.\n\nBy default, the Mask is a circle, scaled to fit both X and Y axes\nof the game canvas (so it's not really a circle any more).\n\nYou can change the shape to 'square', 'rectangle', or 'ellipse'.\nControl the shape of rectangles or ellipses via `config.aspectRatio`.\n\nYou can change the coverage much like FitToRegion.\nYou can scale to fit inside, outside, or both axes.\nYou can set the target region; if you do not, the action will choose\nan appropriate region for you.\n\nThe action supports an optional Blur effect, applied to the shape.\nThis is good for soft edges on masks.\nYou can use `config.padding` to shrink the shape region inward, leaving room for the blur to spread outward to the intended boundary.\n\nThe Shape is removed from the scene upon creation.\nYou don't need to manage its life cycle; it should be garbage collected\nonce the Mask filter is destroyed, usually when the scene or target\nis shut down.\nIf you want to access the Shape, it is available on the mask filter.\n\nIf you apply this to multiple objects at once,\nthey all have their own shape and mask filter.\nNote that, if you use external filters, the masks will seem to line up.\nIn this case, it might be more efficient to put all the targets into\na Layer or Container and mask that instead.",
"examples": [
"const mask = Phaser.Actions.AddMaskShape(target, {\n blurRadius: 2,\n padding: 2\n})[0]; // The return is an array.\nconst shape = mask.maskGameObject; // This reference prevents garbage collection until `shape` is dropped.\nconst blur = shape.filters.external.list[0]; // Nothing else should be in this list."
],
"kind": "function",
"name": "AddMaskShape",
"since": "4.0.0",
"params": [
{
"type": {
"names": [
"Phaser.GameObjects.GameObject",
"Phaser.Cameras.Scene2D.Camera",
"Array.<(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
},
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "Phaser.GameObjects.GameObject"
},
{
"type": "NameExpression",
"name": "Phaser.Cameras.Scene2D.Camera"
}
]
}
]
}
]
}
},
"description": "The GameObject or Camera or list thereof to which to apply a mask.",
"name": "items"
},
{
"type": {
"names": [
"Phaser.Types.Actions.AddMaskShapeConfig"
],
"parsedType": {
"type": "NameExpression",
"name": "Phaser.Types.Actions.AddMaskShapeConfig"
}
},
"description": "The configuration of the mask shape.",
"name": "config"
}
],
"returns": [
{
"type": {
"names": [
"Array.<Phaser.Filters.Mask>"
],
"parsedType": {
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.Filters.Mask",
"type": "NameExpression"
}
]
}
},
"description": "The new Mask filters, in order of target."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.AddMaskShape",
"scope": "static",
"___id": "T000002R000106",
"___s": true
},
{
"comment": "/**\n * Takes an array of Game Objects and aligns them next to each other.\n *\n * The alignment position is controlled by the `position` parameter, which should be one\n * of the Phaser.Display.Align constants, such as `Phaser.Display.Align.TOP_LEFT`,\n * `Phaser.Display.Align.TOP_CENTER`, etc.\n *\n * The first item isn't moved. The second item is aligned next to the first,\n * then the third next to the second, and so on.\n *\n * @function Phaser.Actions.AlignTo\n * @since 3.22.0\n *\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\n *\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\n * @param {number} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`.\n * @param {number} [offsetX=0] - Optional horizontal offset from the position, in pixels.\n * @param {number} [offsetY=0] - Optional vertical offset from the position, in pixels.\n *\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\n */",
"meta": {
"filename": "AlignTo.js",
"lineno": 9,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Takes an array of Game Objects and aligns them next to each other.\n\nThe alignment position is controlled by the `position` parameter, which should be one\nof the Phaser.Display.Align constants, such as `Phaser.Display.Align.TOP_LEFT`,\n`Phaser.Display.Align.TOP_CENTER`, etc.\n\nThe first item isn't moved. The second item is aligned next to the first,\nthen the third next to the second, and so on.",
"kind": "function",
"name": "AlignTo",
"since": "3.22.0",
"tags": [
{
"originalTitle": "generic",
"title": "generic",
"text": "{Phaser.GameObjects.GameObject[]} G - [items,$return]",
"value": "{Phaser.GameObjects.GameObject[]} G - [items,$return]"
}
],
"params": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of items to be updated by this action.",
"name": "items"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"description": "The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`.",
"name": "position"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"optional": true,
"defaultvalue": 0,
"description": "Optional horizontal offset from the position, in pixels.",
"name": "offsetX"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"optional": true,
"defaultvalue": 0,
"description": "Optional vertical offset from the position, in pixels.",
"name": "offsetY"
}
],
"returns": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of objects that were passed to this Action."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.AlignTo",
"scope": "static",
"___id": "T000002R000129",
"___s": true
},
{
"comment": "/**\n * Takes an array of Game Objects, or any objects that have a public `angle` property,\n * and then adds the given value to each of their `angle` properties.\n *\n * The optional `step` property is applied incrementally, multiplied by each item in the array.\n *\n * To use this with a Group: `Angle(group.getChildren(), value, step)`\n *\n * @function Phaser.Actions.Angle\n * @since 3.0.0\n *\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\n *\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\n * @param {number} value - The amount, in degrees, to be added to the `angle` property.\n * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. For example, a `step` of 10 will add 0 to the first item, 10 to the second, 20 to the third, and so on.\n * @param {number} [index=0] - An optional offset to start searching from within the items array.\n * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.\n *\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action.\n */",
"meta": {
"filename": "Angle.js",
"lineno": 9,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Takes an array of Game Objects, or any objects that have a public `angle` property,\nand then adds the given value to each of their `angle` properties.\n\nThe optional `step` property is applied incrementally, multiplied by each item in the array.\n\nTo use this with a Group: `Angle(group.getChildren(), value, step)`",
"kind": "function",
"name": "Angle",
"since": "3.0.0",
"tags": [
{
"originalTitle": "generic",
"title": "generic",
"text": "{Phaser.GameObjects.GameObject[]} G - [items,$return]",
"value": "{Phaser.GameObjects.GameObject[]} G - [items,$return]"
}
],
"params": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of items to be updated by this action.",
"name": "items"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"description": "The amount, in degrees, to be added to the `angle` property.",
"name": "value"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"optional": true,
"defaultvalue": 0,
"description": "This is added to the `value` amount, multiplied by the iteration counter. For example, a `step` of 10 will add 0 to the first item, 10 to the second, 20 to the third, and so on.",
"name": "step"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"optional": true,
"defaultvalue": 0,
"description": "An optional offset to start searching from within the items array.",
"name": "index"
},
{
"type": {
"names": [
"number"
],
"parsedType": {
"type": "NameExpression",
"name": "number"
}
},
"optional": true,
"defaultvalue": 1,
"description": "The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning.",
"name": "direction"
}
],
"returns": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of objects that were passed to this Action."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.Angle",
"scope": "static",
"___id": "T000002R000137",
"___s": true
},
{
"comment": "/**\n * Takes an array of objects and passes each of them to the given callback.\n *\n * @function Phaser.Actions.Call\n * @since 3.0.0\n *\n * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]\n *\n * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.\n * @param {Phaser.Types.Actions.CallCallback} callback - The callback to be invoked. It will be passed just one argument: the item from the array.\n * @param {*} context - The scope in which the callback will be invoked.\n *\n * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that was passed to this Action.\n */",
"meta": {
"filename": "Call.js",
"lineno": 7,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Takes an array of objects and passes each of them to the given callback.",
"kind": "function",
"name": "Call",
"since": "3.0.0",
"tags": [
{
"originalTitle": "generic",
"title": "generic",
"text": "{Phaser.GameObjects.GameObject[]} G - [items,$return]",
"value": "{Phaser.GameObjects.GameObject[]} G - [items,$return]"
}
],
"params": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of items to be updated by this action.",
"name": "items"
},
{
"type": {
"names": [
"Phaser.Types.Actions.CallCallback"
],
"parsedType": {
"type": "NameExpression",
"name": "Phaser.Types.Actions.CallCallback"
}
},
"description": "The callback to be invoked. It will be passed just one argument: the item from the array.",
"name": "callback"
},
{
"type": {
"names": [
"*"
],
"parsedType": {
"type": "AllLiteral"
}
},
"description": "The scope in which the callback will be invoked.",
"name": "context"
}
],
"returns": [
{
"type": {
"names": [
"array",
"Array.<Phaser.GameObjects.GameObject>"
],
"parsedType": {
"type": "TypeUnion",
"elements": [
{
"type": "NameExpression",
"name": "array"
},
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"name": "Phaser.GameObjects.GameObject",
"type": "NameExpression"
}
]
}
]
}
},
"description": "The array of objects that was passed to this Action."
}
],
"memberof": "Phaser.Actions",
"longname": "Phaser.Actions.Call",
"scope": "static",
"___id": "T000002R000140",
"___s": true
},
{
"comment": "/**\n * Fit GameObjects to a region.\n *\n * This is a quick way to fit a background to a scene,\n * move an object without worrying about origins,\n * or cover a hole of known size.\n *\n * This will transform each object to fit into a rectangular region.\n * Rotation is ignored, but translation and scale are changed.\n * Note that negative scale will become positive; use flip to resolve this.\n * The object must support transformation.\n *\n * The fit can scale proportionally, to touch the inside or outside of the region;\n * but by default it scales both axes independently to touch all sides.\n *\n * The region is an axis-aligned bounding box (AABB).\n * By default, it is derived from the object, via the scene scale properties,\n * i.e. `{ x: 0, y: 0, width: scene.scale.width, height: scene.scale.height }`.\n *\n * If the game object has no size or origin, e.g. a Container,\n * then it is tricky to figure out how to resize it to fit.\n * The `itemCoverage` parameter allows you to set `width`, `height`, `originX`\n * and/or `originY` properties to supplement available data.\n * These settings take precedence over original item properties, even if they exist.\n *\n * @function Phaser.Actions.FitToRegion\n * @since 4.0.0\n *\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} items - The GameObject or GameObjects to fit to the region. Each must have the Phaser.GameObjects.Components.Transform component.\n * @param {number} [scaleMode=0] - The scale mode. 0 sets each axis to fill the region independently. -1 scales both axes uniformly so the item touches the _inside_ of the region. 1 scales both axes uniformly so the item touches the _outside_ of the region.\n * @param {Phaser.Types.Math.RectangleLike} [region] - The region to fit. If not defined, it will be inferred from the first item's scene scale.\n * @param {Phaser.Types.Actions.FitToRegionItemCoverage} [itemCoverage] - Override or define the region covered by the item. This is intended to provide dimensions for objects which don't have them, such as Containers, allowing them to resize.\n *\n * @return {Phaser.GameObjects.GameObject[]} - The items that were fitted.\n */",
"meta": {
"filename": "FitToRegion.js",
"lineno": 10,
"columnno": 0,
"path": "/Users/rich/Documents/GitHub/phaser/src/actions",
"code": {}
},
"description": "Fit GameObjects to a region.\n\nThis is a quick way to fit a background to a scene,\nmove an object without worrying about origins,\nor cover a hole of known size.\n\nThis will transform each object to fit into a rectangular region.\nRotation is ignored, but translation and scale are changed.\nNote that negative scale will become positive; use flip to resolve this.\nThe object must support transformation.\n\nThe fit can scale proportionally, to touch the inside or outside of the region;\nbut by default it scales both axes independently to touch all sides.\n\nThe region is an axis-aligned bounding box (AABB).\nBy default, it is derived from the object, via the scene scale properties,\ni.e. `{ x: 0, y: 0, width: scene.scale.width, height: scene.scale.height }`.\n\nIf the game object has no size or origin, e.g. a Container,\nthen it is tricky to figure out how to resize it to fit.\nThe `itemCoverage` parameter allows you to set `width`, `height`, `originX`\nand/or `originY` properties to supplement available data.\nThese settings tak