Creates a new Phaser.Game instance
When set to
The Audio Configuration object.
Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame.
The background color of the game canvas. The default is black.
Configuration for the banner printed in the browser console when the game starts.
The default WebGL batch size. Represents the number of quads that can be added to a single batch.
Optional callbacks to run before or after game boot.
Provide your own Canvas element for Phaser to use instead of creating one.
CSS styles to apply to the game canvas instead of Phasers default styles.
Whether the game canvas will be cleared between each rendering frame.
Provide your own Canvas Context for Phaser to use, instead of creating one.
Is Phaser running under a custom (non-native web) environment? If so, set this to
When set to
Disable the browser’s default ‘contextmenu’ event (usually triggered by a right-button mouse click).
The DOM Container configuration object.
Let the browser abort creating a WebGL context if it judges performance would be unacceptable.
Game loop configuration.
The height of the game, in game pixels.
Input configuration, or
The maximum number of lights allowed to be visible within range of a single Camera in the LightManager.
When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8.
The mipmap magFilter to be used when creating WebGL textures.
The DOM element that will contain the game canvas, or its
A WebGL Pipeline configuration object. Can also be part of the
Plugins to install.
“high-performance”, “low-power” or “default”. A hint to the browser on how much device power the game might use.
In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha.
If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
Game renderer configuration.
Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property.
The Scale Manager configuration.
A scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have
Seed for the random number generator.
The title of the game. Shown in the browser console.
Whether the game canvas will be transparent. Boolean that indicates if the canvas contains an alpha channel. If set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images.
Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS.
The URL of the game. Shown in the browser console.
The version of the game. Shown in the browser console.
The width of the game, in game pixels.
Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc.