Phaser API Documentation

setFillStyle([color], [alpha])


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.


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.


This Game Object instance.

Since: 3.13.0