Phaser API Documentation

  Version: 
setFill(color)

Description:

Set the fill style to be used by the Text object.

This can be any valid CanvasRenderingContext2D fillStyle value, such as a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern.

See the MDN fillStyle docs for more details.

Parameters:

name type description
color string | any

The text fill style. Can be any valid CanvasRenderingContext fillStyle value.

Returns:
Description:

This Text object.

Since: 3.0.0