Phaser API Documentation

  Version: 
setFillStyle([color], [alpha])

Description:

Sets the fill color and alpha for this Shape.

If you wish for the Shape to not be filled then call this method with no arguments, or just set isFilled to false.

Note that some Shapes do not support fill colors, such as the Line shape.

This call can be chained.

Parameters:

name type arguments Default description
color number <optional>

The color used to fill this shape. If not provided the Shape will not be filled.

alpha number <optional> 1

The alpha value used when filling this shape, if a fill color is given.

Returns:
Description:

This Game Object instance.

Examples:
Since: 3.13.0