Phaser API Documentation

name type arguments Default description
antialias boolean <optional> true

When set to true, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to false, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. false also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled.

antialiasGL boolean <optional> true

Sets 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.

desynchronized boolean <optional> false

When set to true it will create a desynchronized context for both 2D and WebGL. See for details.

pixelArt boolean <optional> false

Sets antialias to false and roundPixels to true. This is the best setting for pixel-art games.

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.

pipeline Phaser.Types.Core.PipelineConfig <optional>

The WebGL Pipeline configuration object.

Since: 3.0.0