Skip to main content
Version: Phaser v3.88.2

Shine

The Shine FX Controller.

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

The shine effect is a visual technique that simulates the appearance of reflective

or glossy surfaces by passing a light beam across a Game Object. This effect is used to

enhance visual appeal, emphasize certain features, and create a sense of depth or

material properties.

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


const sprite = this.add.sprite();



sprite.preFX.addShine();

sprite.postFX.addShine();

Constructor

new Shine(gameObject, [speed], [lineWidth], [gradient], [reveal])

Parameters

nametypeoptionaldefaultdescription
gameObjectPhaser.GameObjects.GameObjectNoA reference to the Game Object that has this fx.
speednumberYes0.5The speed of the Shine effect.
lineWidthnumberYes0.5The line width of the Shine effect.
gradientnumberYes3The gradient of the Shine effect.
revealbooleanYesfalseDoes this Shine effect reveal or get added to its target?

Scope: static

Extends

Phaser.FX.Controller

Source: src/fx/Shine.js#L11
Since: 3.60.0

Inherited Members

From Phaser.FX.Controller:


Public Members

gradient

gradient: number

Description:

The gradient of the Shine effect.

Source: src/fx/Shine.js#L76
Since: 3.60.0


lineWidth

lineWidth: number

Description:

The line width of the Shine effect.

Source: src/fx/Shine.js#L67
Since: 3.60.0


reveal

reveal: boolean

Description:

Does this Shine effect reveal or get added to its target?

Source: src/fx/Shine.js#L85
Since: 3.60.0


speed

speed: number

Description:

The speed of the Shine effect.

Source: src/fx/Shine.js#L58
Since: 3.60.0


Inherited Methods

From Phaser.FX.Controller: