Phaser.FX.Bloom

The Bloom FX Controller.

This FX controller manages the bloom effect for a Game Object.

Bloom is an effect used to reproduce an imaging artifact of real-world cameras. The effect produces fringes of light extending from the borders of bright areas in an image, contributing to the illusion of an extremely bright light overwhelming the camera or eye capturing the scene.

A Bloom effect is added to a Game Object via the FX component:

const sprite = this.add.sprite();

sprite.preFX.addBloom();
sprite.postFX.addBloom();

Constructor

new Bloom(gameObject, [color], [offsetX], [offsetY], [blurStrength], [strength], [steps])

Parameters:

nametypeoptionaldefaultdescription
gameObjectPhaser.GameObjects.GameObjectNoA reference to the Game Object that has this fx.
colornumberYes"0xffffff"The color of the Bloom, as a hex value.
offsetXnumberYes1The horizontal offset of the bloom effect.
offsetYnumberYes1The vertical offset of the bloom effect.
blurStrengthnumberYes1The strength of the blur process of the bloom effect.
strengthnumberYes1The strength of the blend process of the bloom effect.
stepsnumberYes4The number of steps to run the Bloom effect for. This value should always be an integer.

Scope: static

Extends: Phaser.FX.Controller

Source: src/fx/Bloom.js - Line: 11
Since: 3.60.0

Members:

active: boolean

active

Description:

Toggle this boolean to enable or disable this effect, without removing and adding it from the Game Object.

Only works for Pre FX.

Post FX are always active.

Inherits: Phaser.FX.Controller#active

Source: src/fx/Controller.js - Line: 47
Since: 3.60.0


blurStrength: number

blurStrength

Description:

The strength of the blur process of the bloom effect.

Source: src/fx/Bloom.js - Line: 96
Since: 3.60.0


color: number

color

Description:

The color of the bloom as a number value.

Source: src/fx/Bloom.js - Line: 129
Since: 3.60.0


gameObject: Phaser.GameObjects.GameObject

gameObject

Description:

A reference to the Game Object that owns this effect.

Inherits: Phaser.FX.Controller#gameObject

Source: src/fx/Controller.js - Line: 38
Since: 3.60.0


glcolor: Array.<number>

glcolor

Description:

The internal gl color array.

Source: src/fx/Bloom.js - Line: 114
Since: 3.60.0


offsetX: number

offsetX

Description:

The horizontal offset of the bloom effect.

Source: src/fx/Bloom.js - Line: 78
Since: 3.60.0


offsetY: number

offsetY

Description:

The vertical offset of the bloom effect.

Source: src/fx/Bloom.js - Line: 87
Since: 3.60.0


steps: number

steps

Description:

The number of steps to run the Bloom effect for.

This value should always be an integer.

It defaults to 4. The higher the value, the smoother the Bloom, but at the cost of exponentially more gl operations.

Keep this to the lowest possible number you can have it, while still looking correct for your game.

Source: src/fx/Bloom.js - Line: 61
Since: 3.60.0


strength: number

strength

Description:

The strength of the blend process of the bloom effect.

Source: src/fx/Bloom.js - Line: 105
Since: 3.60.0


type: number

type

Description:

The FX_CONST type of this effect.

Inherits: Phaser.FX.Controller#type

Source: src/fx/Controller.js - Line: 29
Since: 3.60.0


Methods:

destroy

<instance> destroy()

Description:

Destroys this FX Controller.

Inherits: Phaser.FX.Controller#destroy

Source: src/fx/Controller.js - Line: 81
Since: 3.60.0


setActive

<instance> setActive(value)

Description:

Sets the active state of this FX Controller.

A disabled FX Controller will not be updated.

Parameters:

nametypeoptionaldescription
valuebooleanNotrue to enable this FX Controller, or false to disable it.

Returns: Phaser.FX.Bloom - This FX Controller instance.

Inherits: Phaser.FX.Controller#setActive

Source: src/fx/Controller.js - Line: 62
Since: 3.60.0


Updated on