Namespace: Scale

Phaser. Scale

Classes

ScaleManager

Namespaces

Center
Events
Orientation
ScaleModes
Zoom

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> ENVELOP

The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size.

Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 63)

<static> FIT

The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered.

Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 53)

<static> HEIGHT_CONTROLS_WIDTH

The width is automatically adjusted based on the height.

Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 45)

<static> LANDSCAPE

A landscape orientation.

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

<static> MAX_ZOOM

Calculate the zoom value based on the maximum multiplied game size that will fit into the parent, or browser window if no parent is set.

Since: 3.16.0
Source: src/scale/const/ZOOM_CONST.js (Line 51)

<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)

<static> NO_ZOOM

The game canvas will not be zoomed by Phaser.

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

<static> NONE

No scaling happens at all. The canvas is set to the size given in the game config and Phaser doesn't change it again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need to call the Scale Managers resize method to give the new dimensions, or input events will stop working.

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

<static> PORTRAIT

A portrait orientation.

Since: 3.16.0
Source: src/scale/const/ORIENTATION_CONST.js (Line 35)

<static> RESIZE

The Canvas is resized to fit all available parent space, regardless of aspect ratio.

Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 72)

<static> WIDTH_CONTROLS_HEIGHT

The height is automatically adjusted based on the width.

Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 37)

<static> ZOOM_2X

The game canvas will be 2x zoomed by Phaser.

Since: 3.16.0
Source: src/scale/const/ZOOM_CONST.js (Line 35)

<static> ZOOM_4X

The game canvas will be 4x zoomed by Phaser.

Since: 3.16.0
Source: src/scale/const/ZOOM_CONST.js (Line 43)

Type Definitions


CenterType

Phaser Scale Manager constants for centering the game canvas.

To find out what each mode does please see Phaser.Scale.Center.

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

OrientationType

Phaser Scale Manager constants for orientation.

To find out what each mode does please see Phaser.Scale.Orientation.

Type:
Since: 3.16.0
Source: src/scale/const/ORIENTATION_CONST.js (Line 15)

ScaleModeType

Phaser Scale Manager constants for the different scale modes available.

To find out what each mode does please see Phaser.Scale.ScaleModes.

Type:
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 15)

ZoomType

Phaser Scale Manager constants for zoom modes.

To find out what each mode does please see Phaser.Scale.Zoom.

Type:
Since: 3.16.0
Source: src/scale/const/ZOOM_CONST.js (Line 15)