Phaser API Documentation

  Version: 
setStyle(style, [updateText], [setDefaults])

Description:

Set the text style.

Parameters:

name type arguments Default description
style Phaser.Types.GameObjects.Text.TextStyle

The style settings to set.

updateText boolean <optional> true

Whether to update the text immediately.

setDefaults boolean <optional> false

Use the default values is not set, or the local values.

Returns:
Description:

The parent Text object.

Examples:
text.setStyle({
    fontSize: '64px',
    fontFamily: 'Arial',
    color: '#ffffff',
    align: 'center',
    backgroundColor: '#ff00ff'
});
Since: 3.0.0