Namespace: Center

Phaser.Scale. Center

Phaser Scale Manager constants for centering the game canvas.

Since: 3.16.0
Source: src/scale/const/CENTER_CONST.js (Line 7)

Members


<static> CENTER_BOTH

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.

Since: 3.16.0
Source: src/scale/const/CENTER_CONST.js (Line 36)

<static> CENTER_HORIZONTALLY

The game canvas is centered horizontally 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.

Since: 3.16.0
Source: src/scale/const/CENTER_CONST.js (Line 48)

<static> CENTER_VERTICALLY

The game canvas is centered both 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.

Since: 3.16.0
Source: src/scale/const/CENTER_CONST.js (Line 60)

<static> NO_CENTER

The game canvas is not centered within the parent by Phaser. You can still center it yourself via CSS.

Since: 3.16.0
Source: src/scale/const/CENTER_CONST.js (Line 27)