Types.Actions
AddEffectBloomConfig
<static> AddEffectBloomConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| threshold | number | Yes | 0.5 | The lower brightness threshold for channels to contribute to the bloom, in the range 0-1. |
| blurRadius | number | Yes | 2 | The radius of light blur in the bloom. |
| blurSteps | number | Yes | 4 | The number of steps to run the blur in the bloom. This value should always be an integer. |
| blurQuality | number | Yes | 0 | The quality of the light blur: 0 (low), 1 (medium) or 2 (high). |
| blendAmount | number | Yes | 1 | The amount by which to blend the bloom over the original image. 0 is none, 1 is 100%. Higher values are allowed. |
| blendMode | Phaser.BlendModes | Yes | "Phaser.BlendModes.ADD" | The blend mode to use when applying the bloom. |
| useInternal | boolean | Yes | Whether to add filters to the internal filter list of the effect target. By default, filters are added to the external filter list, so they run relative to the screen. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/AddEffectBloomConfig.js#L1
Since: 4.0.0
AddEffectBloomReturn
<static> AddEffectBloomReturn
| name | type | optional | description |
|---|---|---|---|
| item | Phaser.Cameras.Scene2D.Camera | Phaser.GameObjects.GameObject | No | The object or camera to which the bloom is applied. |
| parallelFilters | Phaser.Filters.ParallelFilters | No | The ParallelFilters filter which blends the blurred light with the original image. |
| threshold | Phaser.Filters.Threshold | No | The Threshold filter which cuts off darker light from the image. |
| blur | Phaser.Filters.Blur | No | The Blur filter which spreads out bright light from the image. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/AddEffectBloomReturn.js#L1
Since: 4.0.0
AddEffectShineConfig
<static> AddEffectShineConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| radius | number | Yes | 0.5 | The width of the shine, as a proportion of the size of the target. |
| direction | number | Yes | 0.5 | The direction the shine travels in. 0 is to the right, increasing clockwise. Direction changes which corner of the target the shine travels from. This is the direction of the gradient shape vector. |
| scale | number | Yes | 2 | The length the shine travels, as a proportion of the size of the target. This is the length of the gradient shape vector. |
| width | number | Yes | 128 | The width of the gradient texture. By default, this is derived from the target. |
| height | number | Yes | 128 | The height of the gradient texture. By default, this is derived from the target. |
| bands | Phaser.Display.ColorBand | Phaser.Types.Display.ColorBandConfig | Array.<(Phaser.Display.ColorBand | Phaser.Types.Display.ColorBandConfig)> | Yes |
| colorFactor | Array.<number> | Yes | "[ 1.15, 0.85, 0.85, 1 ]" | The factor which multiplies the shiny part of the image. Must be 4 numbers (RGBA). Typical range is 0-1, but it's often useful to make them larger. |
| displacementMap | string | Yes | A displacement map to apply to the gradient. If not defined, no displacement is applied. | |
| displacement | number | Yes | If a displacement map is applied, this is its strength. | |
| duration | number | Yes | 2000 | Duration of the shine animation (via the tween), in milliseconds. |
| repeatDelay | number | Yes | Delay between repetitions of the shine animation. | |
| ease | string | function | Yes | Ease mode for the tween. | |
| yoyo | boolean | Yes | Whether to move the shine back and forth. If not set, the shine constantly crosses the image in the same direction every time. | |
| useExternal | boolean | Yes | Whether to add the shine effect in external space, where it relates to the screen. By default, it is in internal space, where it relates to the target. | |
| reveal | boolean | Yes | Whether to use reveal mode. In reveal mode, the effect only shows the shiny part of the image; the rest is hidden. As this is simpler, there is no parallelFilters in the return object when reveal mode is on. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/AddEffectShineConfig.js#L1
Since: 4.0.0
AddEffectShineReturn
<static> AddEffectShineReturn
| name | type | optional | description |
|---|---|---|---|
| item | Phaser.Cameras.Scene2D.Camera | Phaser.GameObjects.GameObject | No | The object or camera to which the shine is applied. |
| gradient | Phaser.GameObjects.Gradient | No | The gradient which controls the shine area. This is not added to the scene, so it will be garbage collected once all references and the tween are destroyed. |
| dynamicTexture | Phaser.Textures.DynamicTexture | No | The texture where the gradient is rendered, after any filters are applied. This will be destroyed when the target is destroyed. You can destroy it earlier, but it is accessed by the tween, so ensure the tween has stopped. |
| tween | Phaser.Tweens.Tween | No | The tween which controls the gradient motion. When this updates, the dynamicTexture is redrawn. This will be destroyed when the target is destroyed. You can destroy it earlier to stop the gradient from updating. |
| parallelFilters | Phaser.Filters.ParallelFilters | No | The ParallelFilters filter which adds the shine to the image. This will not be defined if the Shine is in reveal mode. This belongs to the target and will be removed when the target is destroyed. You can remove it yourself to remove the shine effect, if not in reveal mode. |
| blendFilter | Phaser.Filters.Blend | No | The Blend filter which makes the image shine by multiplying it by the gradient. This controls the brightness of the shine. In reveal mode, this belongs to the target and will be removed when the target is destroyed. You can remove if yourself to remove the shine effect. When not in reveal mode, this belongs to parallelFilters.top. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/AddEffectShineReturn.js#L1
Since: 4.0.0
AddMaskShapeConfig
<static> AddMaskShapeConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| shape | string | Yes | "'circle'" | The type of shape to create. This can be 'circle', 'ellipse', 'square' or 'rectangle'. |
| aspectRatio | number | Yes | 1 | The aspect ratio of width to height for ellipse and rectangle shapes. |
| invert | boolean | Yes | Whether to invert the mask, typically for creating borders. | |
| useInternal | boolean | Yes | Whether to use the internal or external filter list. Internal masks follow game objects, and are executed before external filters. | |
| blurRadius | number | Yes | 0 | The radius of blur to apply to the mask. If 0, no blur is applied. A good value is 2. |
| blurSteps | number | Yes | 4 | The number of steps to run blur on the mask. This value should always be an integer. |
| blurQuality | number | Yes | 0 | The quality of any blur: 0 (low), 1 (medium) or 2 (high). |
| scaleMode | number | Yes | 0 | The scale mode to use when fitting the shape. 0 sets each axis to fill the region independently. -1 scales both axes uniformly so the shape touches the inside of the region. 1 scales both axes uniformly so the shape touches the outside of the region. |
| padding | number | Yes | 0 | Padding applies an inset around the edge of the masked region. This provides space for blur to soften the edges of a mask. |
| region | Phaser.Geom.Rectangle | Yes | The region to fit. If not defined, it will be inferred from the target's scene scale. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/AddMaskShapeConfig.js#L1
Since: 4.0.0
CallCallback
<static> CallCallback
Type: function
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/CallCallback.js#L1
Since: 3.0.0
FitToRegionItemCoverage
<static> FitToRegionItemCoverage
| name | type | optional | default | description |
|---|---|---|---|---|
| width | number | Yes | 1 | Override the effective width of the item. |
| height | number | Yes | 1 | Override the effective height of the item. |
| originX | number | Yes | 0.5 | Override the effective horizontal origin of the item. |
| originY | number | Yes | 0.5 | Override the effective vertical origin of the item. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/FitToRegionItemCoverage.js#L1
Since: 4.0.0
GridAlignConfig
<static> GridAlignConfig
| name | type | optional | default | description |
|---|---|---|---|---|
| width | number | Yes | -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. |
| height | number | Yes | -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. |
| cellWidth | number | Yes | 1 | The width of the cell, in pixels, in which the item is positioned. |
| cellHeight | number | Yes | 1 | The height of the cell, in pixels, in which the item is positioned. |
| position | number | Yes | 0 | The alignment position. One of the Phaser.Display.Align consts such as TOP_LEFT or RIGHT_CENTER. |
| x | number | Yes | 0 | Optionally place the top-left of the final grid at this coordinate. |
| y | number | Yes | 0 | Optionally place the top-left of the final grid at this coordinate. |
Type: object
Member of: Phaser.Types.Actions
Source: src/actions/typedefs/GridAlignConfig.js#L1
Since: 3.0.0