I want to set a background color for my game.

I found this solution:

function create() {

but I want to be sure that there is not a more standard way to do this, because editing the camera's property means that the background would be different for another camera.

Thank you for your help.


1 Answer 1


You can set the backgroundColor property of the GameConfig when you create a new Phaser.Game.

const config = {
   // ...
   backgroundColor: '#d5d5d'

const game = new Phaser.Game(config)

Phaser docs for more info: https://photonstorm.github.io/phaser3-docs/Phaser.Types.Core.html#.GameConfig


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .