Namespace: AlphaSingle

Phaser.GameObjects.Components. AlphaSingle

Provides methods used for setting the alpha property of a Game Object. Should be applied as a mixin and not used directly.

Since: 3.22.0
Source: src/gameobjects/components/AlphaSingle.js (Line 12)

Members


alpha :number

The alpha value of the Game Object.

This is a global value, impacting the entire Game Object, not just a region of it.

Type:
  • number
Since: 3.0.0
Source: src/gameobjects/components/AlphaSingle.js (Line 68)

Methods


clearAlpha()

Clears all alpha values associated with this Game Object.

Immediately sets the alpha levels back to 1 (fully opaque).

Since: 3.0.0
Source: src/gameobjects/components/AlphaSingle.js (Line 33)
Returns:

This Game Object instance.

Type
Phaser.GameObjects.Components.AlphaSingle

setAlpha( [value])

Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.

Parameters:
Name Type Argument Default Description
value number <optional>
1

The alpha value applied across the whole Game Object.

Since: 3.0.0
Source: src/gameobjects/components/AlphaSingle.js (Line 48)
Returns:

This Game Object instance.

Type
Phaser.GameObjects.Components.AlphaSingle