Phaser API Documentation

  Version: 

Member of: Phaser.Scale

<static, constant> CENTER_BOTH: number

Description:

The game canvas is centered both horizontally and vertically within the parent. To do this, the parent has to have a bounds that can be calculated and not be empty.

Centering is achieved by setting the margin left and top properties of the game canvas, and does not factor in any other CSS styles you may have applied.

Type:
number
Since: 3.16.0