Skip to main content
Version: Phaser v4.0.0

Types.Actions

AddEffectBloomConfig

<static> AddEffectBloomConfig

nametypeoptionaldefaultdescription
thresholdnumberYes0.5The lower brightness threshold for channels to contribute to the bloom, in the range 0-1.
blurRadiusnumberYes2The radius of light blur in the bloom.
blurStepsnumberYes4The number of steps to run the blur in the bloom. This value should always be an integer.
blurQualitynumberYes0The quality of the light blur: 0 (low), 1 (medium) or 2 (high).
blendAmountnumberYes1The amount by which to blend the bloom over the original image. 0 is none, 1 is 100%. Higher values are allowed.
blendModePhaser.BlendModesYes"Phaser.BlendModes.ADD"The blend mode to use when applying the bloom.
useInternalbooleanYesWhether 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

nametypeoptionaldescription
itemPhaser.Cameras.Scene2D.Camera | Phaser.GameObjects.GameObjectNoThe object or camera to which the bloom is applied.
parallelFiltersPhaser.Filters.ParallelFiltersNoThe ParallelFilters filter which blends the blurred light with the original image.
thresholdPhaser.Filters.ThresholdNoThe Threshold filter which cuts off darker light from the image.
blurPhaser.Filters.BlurNoThe 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

nametypeoptionaldefaultdescription
radiusnumberYes0.5The width of the shine, as a proportion of the size of the target.
directionnumberYes0.5The 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.
scalenumberYes2The length the shine travels, as a proportion of the size of the target. This is the length of the gradient shape vector.
widthnumberYes128The width of the gradient texture. By default, this is derived from the target.
heightnumberYes128The height of the gradient texture. By default, this is derived from the target.
bandsPhaser.Display.ColorBand | Phaser.Types.Display.ColorBandConfigArray.<(Phaser.Display.ColorBandPhaser.Types.Display.ColorBandConfig)>Yes
colorFactorArray.<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.
displacementMapstringYesA displacement map to apply to the gradient. If not defined, no displacement is applied.
displacementnumberYesIf a displacement map is applied, this is its strength.
durationnumberYes2000Duration of the shine animation (via the tween), in milliseconds.
repeatDelaynumberYesDelay between repetitions of the shine animation.
easestring | functionYesEase mode for the tween.
yoyobooleanYesWhether to move the shine back and forth. If not set, the shine constantly crosses the image in the same direction every time.
useExternalbooleanYesWhether 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.
revealbooleanYesWhether 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

nametypeoptionaldescription
itemPhaser.Cameras.Scene2D.Camera | Phaser.GameObjects.GameObjectNoThe object or camera to which the shine is applied.
gradientPhaser.GameObjects.GradientNoThe 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.
dynamicTexturePhaser.Textures.DynamicTextureNoThe 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.
tweenPhaser.Tweens.TweenNoThe 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.
parallelFiltersPhaser.Filters.ParallelFiltersNoThe 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.
blendFilterPhaser.Filters.BlendNoThe 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

nametypeoptionaldefaultdescription
shapestringYes"'circle'"The type of shape to create. This can be 'circle', 'ellipse', 'square' or 'rectangle'.
aspectRationumberYes1The aspect ratio of width to height for ellipse and rectangle shapes.
invertbooleanYesWhether to invert the mask, typically for creating borders.
useInternalbooleanYesWhether to use the internal or external filter list. Internal masks follow game objects, and are executed before external filters.
blurRadiusnumberYes0The radius of blur to apply to the mask. If 0, no blur is applied. A good value is 2.
blurStepsnumberYes4The number of steps to run blur on the mask. This value should always be an integer.
blurQualitynumberYes0The quality of any blur: 0 (low), 1 (medium) or 2 (high).
scaleModenumberYes0The 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.
paddingnumberYes0Padding applies an inset around the edge of the masked region. This provides space for blur to soften the edges of a mask.
regionPhaser.Geom.RectangleYesThe 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

nametypeoptionaldefaultdescription
widthnumberYes1Override the effective width of the item.
heightnumberYes1Override the effective height of the item.
originXnumberYes0.5Override the effective horizontal origin of the item.
originYnumberYes0.5Override 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

nametypeoptionaldefaultdescription
widthnumberYes-1The 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.
heightnumberYes-1The 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.
cellWidthnumberYes1The width of the cell, in pixels, in which the item is positioned.
cellHeightnumberYes1The height of the cell, in pixels, in which the item is positioned.
positionnumberYes0The alignment position. One of the Phaser.Display.Align consts such as TOP_LEFT or RIGHT_CENTER.
xnumberYes0Optionally place the top-left of the final grid at this coordinate.
ynumberYes0Optionally 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