OptionalantialiasOptionalantialiasSets the antialias property when the WebGL context is created. Setting this value does not impact any subsequent textures that are created, or the canvas style attributes.
OptionalaudioThe Audio Configuration object.
OptionalautoAutomatically center the canvas within the parent?
OptionalautoAutomatically call window.focus() when the game boots. Usually necessary to capture input events if the game is in a separate frame.
OptionalautoIf iOS or Android detected, automatically restrict WebGL to use 1 texture per batch. This can help performance on some devices.
OptionalautoAutomatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices.
OptionalbackgroundThe background color of the game canvas. The default is black.
OptionalbannerConfiguration for the banner printed in the browser console when the game starts.
OptionalbatchThe default WebGL batch size. Represents the number of quads that can be added to a single batch.
OptionalcallbacksOptional callbacks to run before or after game boot.
OptionalcanvasProvide your own Canvas element for Phaser to use instead of creating one.
OptionalcanvasCSS styles to apply to the game canvas instead of Phasers default styles.
OptionalclearWhether the game canvas will be cleared between each rendering frame.
OptionalcontextProvide your own Canvas Context for Phaser to use, instead of creating one.
OptionalcustomIs Phaser running under a custom (non-native web) environment? If so, set this to true to skip internal Feature detection. If true the renderType cannot be left as AUTO.
OptionaldesynchronizedWhen set to true it will create a desynchronized context for both 2D and WebGL. See https://developers.google.com/web/updates/2019/05/desynchronized for details.
OptionaldisableDisable the browser's default 'contextmenu' event (usually triggered by a right-button mouse click).
OptionaldomThe DOM Container configuration object.
OptionalexpandIs the Scale Manager allowed to adjust the CSS height property of the parent and/or document body to be 100%?
OptionalfailLet the browser abort creating a WebGL context if it judges performance would be unacceptable.
OptionalfpsGame loop configuration.
OptionalfullscreenThe 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.
OptionalheightThe height of the game, in game pixels.
OptionalimagesImages configuration.
OptionalinputInput configuration, or false to disable all game input.
OptionalloaderLoader configuration.
OptionalmaxThe maximum width the canvas can be scaled up to.
OptionalmaxThe maximum number of lights allowed to be visible within range of a single Camera in the LightManager.
OptionalmaxWhen 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.
OptionalminThe minimum width and height the canvas can be scaled down to.
OptionalmipmapThe mipmap magFilter to be used when creating WebGL textures.
OptionalmodeThe scale mode.
OptionalparentThe 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 appended to the document body. If null no parent will be used and you are responsible for adding the canvas to the dom.
OptionalpathThreshold for combining points into a single path in the WebGL renderer for Graphics objects. This can be overridden at the Graphics object level.
OptionalphysicsPhysics configuration.
OptionalpixelSets antialias to false and roundPixels to true. This is the best setting for pixel-art games.
OptionalpluginsPlugins to install.
Optionalpower"high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use.
OptionalpremultipliedIn WebGL mode, the drawing buffer contains colors with pre-multiplied alpha.
OptionalpreserveIf the value is true the WebGL buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
OptionalrenderGame renderer configuration.
OptionalresizeHow many ms should elapse before checking if the browser size has changed?
OptionalroundDraw texture-based Game Objects at only whole-integer positions. Game Objects without textures, like Graphics, ignore this property.
OptionalscaleThe Scale Manager configuration.
OptionalsceneA scene or scenes to add to the game. If several are given, the first is started; the remainder are started only if they have { active: true }. See the sceneConfig argument in Phaser.Scenes.SceneManager#add.
OptionalseedSeed for the random number generator.
OptionalselfOn textured objects with lighting, this enables self-shadowing based on the diffuse map.
OptionalskipAvert stuttering during shader compilation, by enabling parallel shader compilation, where supported. Objects which request a shader that is not yet ready will not be drawn. This prevents stutter, but may cause "pop-in" of objects unless you use a pre-touch strategy.
OptionalsmoothWebGL only. Sets antialias to true and pixelArt to false. Texture-based Game Objects use special shader setting that preserve blocky pixels, but smooth the edges between the pixels. This is only visible when objects are scaled up; otherwise, antialias is simpler.
Optionalstabletrue or 1 = Use the built-in StableSort (needed for older browsers), false or 0 = Rely on ES2019 Array.sort being stable (modern browsers only), or -1 = Try and determine this automatically based on browser inspection (not guaranteed to work, errs on side of caution).
OptionaltitleThe title of the game. Shown in the browser console.
OptionaltransparentWhether 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.
OptionaltypeWhich renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS.
OptionalurlThe URL of the game. Shown in the browser console.
OptionalversionThe version of the game. Shown in the browser console.
OptionalwidthThe width of the game, in game pixels.
OptionalzoomSimple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc.
When set to
true, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set tofalse, WebGL uses nearest-neighbor interpolation, giving a crisper appearance.falsealso disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled.