Config object containing various sound settings.
name | type | arguments | Default | description |
---|---|---|---|---|
disableWebAudio | boolean | <optional> | false |
Use HTML5 Audio instead of Web Audio. |
context | AudioContext | <optional> |
An existing Web Audio context. |
|
noAudio | boolean | <optional> | false |
Disable all audio output. |
name | type | arguments | Default | description |
---|---|---|---|---|
hidePhaser | boolean | <optional> | false |
Omit Phaser's name and version from the banner. |
text | string | <optional> | '#ffffff' |
The color of the banner text. |
background | Array.<string> | <optional> |
The background colors of the banner. |
name | type | arguments | Default | description |
---|---|---|---|---|
preBoot | Phaser.Types.Core.BootCallback | <optional> | Phaser.Types.Core.NOOP |
A function to run at the start of the boot sequence. |
postBoot | Phaser.Types.Core.BootCallback | <optional> | Phaser.Types.Core.NOOP |
A function to run at the end of the boot sequence. At this point, all the game systems have started and plugins have been loaded. |
name | type | arguments | Default | description |
---|---|---|---|---|
createContainer | boolean | <optional> | false |
Should the game create a div element to act as a DOM Container? Only enable if you're using DOM Element objects. You must provide a parent object if you use this feature. |
behindCanvas | boolean | <optional> | false |
Should the DOM Container that is created (if |
pointerEvents | string | <optional> | 'none' |
The default |
name | type | arguments | Default | description |
---|---|---|---|---|
min | number | <optional> | 5 |
The minimum acceptable rendering rate, in frames per second. |
target | number | <optional> | 60 |
The optimum rendering rate, in frames per second. This does not enforce the fps rate, it merely tells Phaser what rate is considered optimal for this game. |
limit | number | <optional> | 0 |
Enforces an fps rate limit that the game step will run at, regardless of browser frequency. 0 means 'no limit'. Never set this higher than RAF can handle. |
forceSetTimeOut | boolean | <optional> | false |
Use setTimeout instead of requestAnimationFrame to run the game loop. |
deltaHistory | number | <optional> | 10 |
Calculate the average frame delta from this many consecutive frame intervals. |
panicMax | number | <optional> | 120 |
The amount of frames the time step counts before we trust the delta values again. |
smoothStep | boolean | <optional> | true |
Apply delta smoothing during the game update to help avoid spikes? |
name | type | arguments | Default | description |
---|---|---|---|---|
width | number | string | <optional> | 1024 |
The width of the game, in game pixels. |
height | number | string | <optional> | 768 |
The height of the game, in game pixels. |
zoom | number | <optional> | 1 |
Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. |
type | number | <optional> | CONST.AUTO |
Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. |
stableSort | number | boolean | <optional> | -1 |
|
parent | HTMLElement | string | <optional> |
The DOM element that will contain the game canvas, or its |
|
canvas | HTMLCanvasElement | <optional> | null |
Provide your own Canvas element for Phaser to use instead of creating one. |
canvasStyle | string | <optional> | null |
CSS styles to apply to the game canvas instead of Phasers default styles. |
customEnvironment | boolean | <optional> | false |
Is Phaser running under a custom (non-native web) environment? If so, set this to |
context | CanvasRenderingContext2D | <optional> |
Provide your own Canvas Context for Phaser to use, instead of creating one. |
|
scene | Phaser.Types.Scenes.SceneType | Array.<Phaser.Types.Scenes.SceneType> | <optional> | null |
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 | Array.<string> | <optional> |
Seed for the random number generator. |
|
title | string | <optional> | '' |
The title of the game. Shown in the browser console. |
url | string | <optional> | 'https://phaser.io' |
The URL of the game. Shown in the browser console. |
version | string | <optional> | '' |
The version of the game. Shown in the browser console. |
autoFocus | boolean | <optional> | true |
Automatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame. |
input | boolean | Phaser.Types.Core.InputConfig | <optional> |
Input configuration, or |
|
disableContextMenu | boolean | <optional> | false |
Disable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click). |
banner | boolean | Phaser.Types.Core.BannerConfig | <optional> | false |
Configuration for the banner printed in the browser console when the game starts. |
dom | Phaser.Types.Core.DOMContainerConfig | <optional> |
The DOM Container configuration object. |
|
fps | Phaser.Types.Core.FPSConfig | <optional> |
Game loop configuration. |
|
render | Phaser.Types.Core.RenderConfig | <optional> |
Game renderer configuration. |
|
callbacks | Phaser.Types.Core.CallbacksConfig | <optional> |
Optional callbacks to run before or after game boot. |
|
loader | Phaser.Types.Core.LoaderConfig | <optional> |
Loader configuration. |
|
images | Phaser.Types.Core.ImagesConfig | <optional> |
Images configuration. |
|
physics | Phaser.Types.Core.PhysicsConfig | <optional> |
Physics configuration. |
|
plugins | Phaser.Types.Core.PluginObject | Array.<Phaser.Types.Core.PluginObjectItem> | <optional> |
Plugins to install. |
|
scale | Phaser.Types.Core.ScaleConfig | <optional> |
The Scale Manager configuration. |
|
audio | Phaser.Types.Core.AudioConfig | <optional> |
The Audio Configuration object. |
|
pipeline | Phaser.Types.Core.PipelineConfig | <optional> |
A WebGL Pipeline configuration object. Can also be part of the |
|
backgroundColor | string | number | <optional> | 0x000000 |
The background color of the game canvas. The default is black. |
antialias | boolean | <optional> | true |
When set to |
antialiasGL | boolean | <optional> | true |
Sets the |
desynchronized | boolean | <optional> | false |
When set to |
pixelArt | boolean | <optional> | false |
Sets |
roundPixels | boolean | <optional> | false |
Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. |
transparent | boolean | <optional> | false |
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. |
clearBeforeRender | boolean | <optional> | true |
Whether the game canvas will be cleared between each rendering frame. |
preserveDrawingBuffer | boolean | <optional> | false |
If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author. |
premultipliedAlpha | boolean | <optional> | true |
In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. |
failIfMajorPerformanceCaveat | boolean | <optional> | false |
Let the browser abort creating a WebGL context if it judges performance would be unacceptable. |
powerPreference | string | <optional> | 'default' |
"high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. |
batchSize | number | <optional> | 4096 |
The default WebGL batch size. Represents the number of quads that can be added to a single batch. |
maxLights | number | <optional> | 10 |
The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. |
maxTextures | number | <optional> | -1 |
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. |
mipmapFilter | string | <optional> | 'LINEAR' |
The mipmap magFilter to be used when creating WebGL textures. |
autoMobilePipeline | boolean | <optional> | true |
Automatically enable the Mobile Pipeline if iOS or Android detected? |
defaultPipeline | string | <optional> | 'MultiPipeline' |
The WebGL Pipeline that Game Objects will use by default. Set to 'MultiPipeline' as standard. |
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 |
|
disablePreFX | boolean | <optional> | false |
Disables the automatic creation of the Pre FX Pipelines. If disabled, you cannot use the built-in Pre FX on Game Objects. |
disablePostFX | boolean | <optional> | false |
Disables the automatic creation of the Post FX Pipelines. If disabled, you cannot use the built-in Post FX on Game Objects. |
name | type | arguments | Default | description |
---|---|---|---|---|
target | * | <optional> | window |
Where the Gamepad Manager listens for gamepad input events. |
name | type | arguments | description |
---|---|---|---|
default | string | <optional> |
A base64 encoded image file to use as the 'default' texture. |
missing | string | <optional> |
A base64 encoded image file to use as the 'missing' texture. |
white | string | <optional> |
A base64 encoded image file to use as the 'white' texture. |
name | type | arguments | Default | description |
---|---|---|---|---|
keyboard | boolean | Phaser.Types.Core.KeyboardInputConfig | <optional> | true |
Keyboard input configuration. |
mouse | boolean | Phaser.Types.Core.MouseInputConfig | <optional> | true |
Mouse input configuration. |
touch | boolean | Phaser.Types.Core.TouchInputConfig | <optional> | true |
Touch input configuration. |
gamepad | boolean | Phaser.Types.Core.GamepadInputConfig | <optional> | false |
Gamepad input configuration. |
activePointers | number | <optional> | 1 |
The maximum number of touch pointers. See Phaser.Input.InputManager#pointers. |
smoothFactor | number | <optional> | 0 |
The smoothing factor to apply during Pointer movement. See Phaser.Input.Pointer#smoothFactor. |
windowEvents | boolean | <optional> | true |
Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. |
name | type | arguments | Default | description |
---|---|---|---|---|
target | * | <optional> | window |
Where the Keyboard Manager listens for keyboard input events. |
capture | Array.<number> | <optional> |
|
name | type | arguments | Default | description |
---|---|---|---|---|
baseURL | string | <optional> |
A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. |
|
path | string | <optional> |
A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. |
|
maxParallelDownloads | number | <optional> | 32 |
The maximum number of resources the loader will start loading at once. |
crossOrigin | string | undefined | <optional> |
'anonymous', 'use-credentials', or |
|
responseType | string | <optional> |
The response type of the XHR request, e.g. |
|
async | boolean | <optional> | true |
Should the XHR request use async or not? |
user | string | <optional> |
Optional username for all XHR requests. |
|
password | string | <optional> |
Optional password for all XHR requests. |
|
timeout | number | <optional> | 0 |
Optional XHR timeout value, in ms. |
localScheme | Array.<string> | <optional> |
An optional array of schemes that the Loader considers as being 'local' files. Defaults to: |
name | type | arguments | Default | description |
---|---|---|---|---|
target | * | <optional> | null |
Where the Mouse Manager listens for mouse input events. The default is the game canvas. |
preventDefaultDown | boolean | <optional> | true |
If |
preventDefaultUp | boolean | <optional> | true |
If |
preventDefaultMove | boolean | <optional> | true |
If |
preventDefaultWheel | boolean | <optional> | true |
If |
This callback type is completely empty, a no-operation.
name | type | arguments | description |
---|---|---|---|
default | string | <optional> |
The default physics system. It will be started for each scene. Phaser provides 'arcade', 'impact', and 'matter'. |
arcade | Phaser.Types.Physics.Arcade.ArcadeWorldConfig | <optional> |
Arcade Physics configuration. |
matter | Phaser.Types.Physics.Matter.MatterWorldConfig | <optional> |
Matter Physics configuration. |
name | type | arguments | Default | description |
---|---|---|---|---|
name | string |
The name of the pipeline. Must be unique within the Pipeline Manager. |
||
pipeline | Phaser.Renderer.WebGL.WebGLPipeline |
The pipeline class. This should be a constructable object, not an instance of a class. |
||
frameInc | number | <optional> | 32 |
Sets the |
name | type | arguments | description |
---|---|---|---|
global | Array.<Phaser.Types.Core.PluginObjectItem> | <optional> |
Global plugins to install. |
scene | Array.<Phaser.Types.Core.PluginObjectItem> | <optional> |
Scene plugins to install. |
default | Array.<string> | <optional> |
The default set of scene plugins (names). |
defaultMerge | Array.<string> | <optional> |
Plugins to add to the default set of scene plugins. |
name | type | arguments | description |
---|---|---|---|
key | string | <optional> |
A key to identify the plugin in the Plugin Manager. |
plugin | * | <optional> |
The plugin itself. Usually a class/constructor. |
start | boolean | <optional> |
Whether the plugin should be started automatically. |
systemKey | string | <optional> |
For a scene plugin, add the plugin to the scene's systems object under this key ( |
sceneKey | string | <optional> |
For a scene plugin, add the plugin to the scene object under this key ( |
mapping | string | <optional> |
If this plugin is to be injected into the Scene Systems, this is the property key map used. |
data | * | <optional> |
Arbitrary data passed to the plugin's init() method. |
name | type | arguments | Default | description |
---|---|---|---|---|
antialias | boolean | <optional> | true |
When set to |
antialiasGL | boolean | <optional> | true |
Sets the |
desynchronized | boolean | <optional> | false |
When set to |
pixelArt | boolean | <optional> | false |
Sets |
roundPixels | boolean | <optional> | true |
Draw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property. |
transparent | boolean | <optional> | false |
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. |
clearBeforeRender | boolean | <optional> | true |
Whether the game canvas will be cleared between each rendering frame. |
preserveDrawingBuffer | boolean | <optional> | false |
If the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author. |
premultipliedAlpha | boolean | <optional> | true |
In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. |
failIfMajorPerformanceCaveat | boolean | <optional> | false |
Let the browser abort creating a WebGL context if it judges performance would be unacceptable. |
powerPreference | string | <optional> | 'default' |
"high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. |
batchSize | number | <optional> | 4096 |
The default WebGL batch size. Represents the number of quads that can be added to a single batch. |
maxLights | number | <optional> | 10 |
The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. |
maxTextures | number | <optional> | -1 |
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. |
mipmapFilter | string | <optional> | '' |
The mipmap magFilter to be used when creating WebGL textures. Don't set unless you wish to create mipmaps. Set to one of the following: 'NEAREST', 'LINEAR', 'NEAREST_MIPMAP_NEAREST', 'LINEAR_MIPMAP_NEAREST', 'NEAREST_MIPMAP_LINEAR' or 'LINEAR_MIPMAP_LINEAR'. |
pipeline | Phaser.Types.Core.PipelineConfig | <optional> |
The WebGL Pipeline configuration object. |
|
autoMobilePipeline | boolean | <optional> | true |
Automatically enable the Mobile Pipeline if iOS or Android detected? |
defaultPipeline | string | <optional> | 'MultiPipeline' |
The WebGL Pipeline that Game Objects will use by default. Set to 'MultiPipeline' as standard. |
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 |
|
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 |
name | type | description |
---|---|---|
time | number |
The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. |
average | number |
The Delta average. |
name | type | arguments | Default | description |
---|---|---|---|---|
target | * | <optional> | null |
Where the Touch Manager listens for touch input events. The default is the game canvas. |
capture | boolean | <optional> | true |
Whether touch input events have preventDefault() called on them. |
name | type | arguments | description |
---|---|---|---|
width | number | <optional> |
The width. |
height | number | <optional> |
The height. |