I want the text to be centered

I want the text to be centered.

const config = {
  type: Phaser.AUTO,
  parent: 'game',
  width: 1530,
  heigth: 600,
  // backgroundColor: "#000000",
  scale: {
    mode: Phaser.Scale.FIT,
    autoCenter: Phaser.Scale.CENTER_BOTH
  },
  scene: {
    preload,
    create,
    update,
  },
  physics: {
    default: 'arcade',
    arcade: {
      gravity: {
        y: 300
      },
      debug: true,
    },
  }
};

Explain?

I’m sorry I wasn’t clearer.
I want to put the word “Game Over” in the center.

And what code do you have now?

Thanks for the replies.

    this.over = this.add.text(560, 580 / 2).setScrollFactor(0).setFontSize(80).setColor('#ffffff');
    this.over.setText('GAME OVER!');
  this.physics.world.setBounds(0, 0, 3100 * 2, 380 * 2);
  this.cameras.main.setBounds(0, 0, 3100 * 2, 100 * 2);
  this.cameras.main.setZoom(1.1);
const { centerX, centerY } = this.cameras.main;

this.add.text(centerX, centerY, 'GAME OVER!').setOrigin(0.5, 0.5);
1 Like

It’s done!
Thank you.