Namespace: ScaleModes

Phaser.Scale. ScaleModes

Phaser Scale Manager constants for the different scale modes available.

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

Members


<static, constant> ENVELOP :integer

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.

Type:
  • integer
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 71)

<static, constant> FIT :integer

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.

Type:
  • integer
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 59)

<static, constant> HEIGHT_CONTROLS_WIDTH :integer

The width is automatically adjusted based on the height.

Type:
  • integer
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 49)

<static, constant> NONE :integer

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.

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

<static, constant> RESIZE :integer

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

Type:
  • integer
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 82)

<static, constant> WIDTH_CONTROLS_HEIGHT :integer

The height is automatically adjusted based on the width.

Type:
  • integer
Since: 3.16.0
Source: src/scale/const/SCALE_MODE_CONST.js (Line 39)