Toggle Background Color

Hi,

Trying to toggle between 2 background colors on this style variable, need them to switch back and forth on a timer:

    var style = {
        fontSize: 24,
        fontFamily: 'Arial',
        align: "center",
        backgroundColor: '#ff00ff'
    }

    commText = this.add.text(windowWidth / 2, (1030 * scaleFactor), '', style).setOrigin(0.5, 0.5).setPadding({ x: windowWidth / 2, y: 16 }); 

Welcome any suggestions

Thanks

Hi @old_blueyes,
The Phaser.GameObjects.Text object has several methods to modify the style, including:
setBackgroundColor(color)
Regards.

For the timer, you can look into a looping Timer Event.