Phaser API Documentation

  Version: 

Member of: Phaser.Types.Core

ScaleConfig
Properties:
name type arguments Default description
width number | string <optional> 1024

The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size.

height number | string <optional> 768

The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size.

zoom number | Phaser.Scale.ZoomType <optional> 1

The zoom value of the game canvas.

parent HTMLElement | string <optional>

The DOM element that will contain the game canvas, or its id. If undefined, or if the named element doesn't exist, the game canvas is inserted directly into the document body. If null no parent will be used and you are responsible for adding the canvas to your environment.

expandParent boolean <optional> true

Is the Scale Manager allowed to adjust the CSS height property of the parent and/or document body to be 100%?

mode Phaser.Scale.ScaleModeType <optional> Phaser.Scale.ScaleModes.NONE

The scale mode.

min WidthHeight <optional>

The minimum width and height the canvas can be scaled down to.

max WidthHeight <optional>

The maximum width the canvas can be scaled up to.

autoRound boolean <optional> false

Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.

autoCenter Phaser.Scale.CenterType <optional> Phaser.Scale.Center.NO_CENTER

Automatically center the canvas within the parent?

resizeInterval number <optional> 500

How many ms should elapse before checking if the browser size has changed?

fullscreenTarget HTMLElement | string <optional>

The DOM element that will be sent into full screen mode, or its id. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode.

Type:
object
Since: 3.16.0