Example
// Use the native window resolution as the default resolution
// will support high-density displays when rendering
PIXI.settings.RESOLUTION = window.devicePixelRatio;
// Disable interpolation when scaling, will make texture be pixelated
PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;
Members
Default anisotropic filtering level of textures. Usually from 0 to 16
- Default Value:
- 0
Can we upload the same buffer in a single frame?
Enables bitmap creation before image load. This feature is experimental.
- Default Value:
- false
Should the failIfMajorPerformanceCaveat
flag be enabled as a context option used in the isWebGLSupported
function.
For most scenarios this should be left as true, as otherwise the user may have a poor experience.
However, it can be useful to disable under certain scenarios, such as headless unit tests.
- Default Value:
- true
Default filter resolution.
- Default Value:
- 1
Default Garbage Collection maximum check count.
- Default Value:
- 600
Default Garbage Collection max idle.
- Default Value:
- 3600
PIXI.settings.GC_MODE PIXI.GC_MODES static
Default Garbage Collection mode.
- Default Value:
- PIXI.GC_MODES.AUTO
Default canvasPadding
for canvas-based Mesh rendering.
- Default Value:
- 0
- See:
-
- PIXI.Mesh2d#canvasPadding
PIXI.settings.MIPMAP_TEXTURES PIXI.MIPMAP_MODES static
If set to true WebGL will attempt make textures mimpaped by default. Mipmapping will only succeed if the base texture uploaded has power of two dimensions.
- Default Value:
- PIXI.MIPMAP_MODES.POW2
PIXI.settings.PRECISION_FRAGMENT PIXI.PRECISION static
Default specify float precision in fragment shader. iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742
- Default Value:
- PIXI.PRECISION.MEDIUM
PIXI.settings.PRECISION_VERTEX PIXI.PRECISION static
Default specify float precision in vertex shader.
- Default Value:
- PIXI.PRECISION.HIGH
The maximum support for using WebGL. If a device does not support WebGL version, for instance WebGL 2, it will still attempt to fallback support to WebGL 1. If you want to explicitly remove feature support to target a more stable baseline, prefer a lower environment.
Due to https://bugs.chromium.org/p/chromium/issues/detail?id=934823|bug in chromium we disable webgl2 by default for all non-apple mobile devices.
- Default Value:
- PIXI.ENV.WEBGL2
The default render options if none are supplied to PIXI.Renderer or PIXI.CanvasRenderer.
Properties:
Name | Type | Attributes | Value | Description |
---|---|---|---|---|
antialias |
boolean |
<constant> |
false | |
autoDensity |
boolean |
<constant> |
false | |
backgroundColor |
number |
<constant> |
0x000000 | |
clearBeforeRender |
boolean |
<constant> |
true | |
height |
number |
<constant> |
600 | |
legacy |
boolean |
<constant> |
false | |
preserveDrawingBuffer |
boolean |
<constant> |
false | |
resolution |
number |
<constant> |
1 | |
transparent |
boolean |
<constant> |
false | |
view |
HTMLCanvasElement |
<constant> |
null | |
width |
number |
<constant> |
800 |
Default resolution / device pixel ratio of the renderer.
- Default Value:
- 1
The prefix that denotes a URL is for a retina asset.
- Default Value:
- /@([0-9\.]+)x/
Example
`@2x`
If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth.
- Default Value:
- false
PIXI.settings.SCALE_MODE PIXI.SCALE_MODES static
Default scale mode for textures.
- Default Value:
- PIXI.SCALE_MODES.LINEAR
Sets the default value for the container property 'sortableChildren'. If set to true, the container will sort its children by zIndex value when updateTransform() is called, or manually if sortChildren() is called.
This actually changes the order of elements in the array, so should be treated as a basic solution that is not performant compared to other solutions, such as @link https://github.com/pixijs/pixi-display
Also be aware of that this may not work nicely with the addChildAt() function, as the zIndex sorting may cause the child to automatically sorted to another position.
- Default Value:
- false
The default sprite batch size.
The default aims to balance desktop and mobile devices.
- Default Value:
- 4096
The maximum textures that this device supports.
- Default Value:
- 32
If set to true
, only Textures and BaseTexture objects stored
in the caches (PIXI.utils.TextureCache TextureCache and
{@link PIXI.utils.BaseTextureCache BaseTextureCache}) can be
used when calling PIXI.Texture.from Texture.from or
{@link PIXI.BaseTexture.from BaseTexture.from}.
Otherwise, these from
calls throw an exception. Using this property
can be useful if you want to enforce preloading all assets with
PIXI.Loader Loader.
- Default Value:
- false
Target frames per millisecond.
- Default Value:
- 0.06
PIXI.settings.TRANSFORM_MODE PIXI.TRANSFORM_MODE Deprecated : since 5.0.0 static
Default transform type.
- Default Value:
- PIXI.TRANSFORM_MODE.STATIC
Default number of uploads per frame using prepare plugin.
- Default Value:
- 4
PIXI.settings.WRAP_MODE PIXI.WRAP_MODES static
Default wrap modes that are supported by pixi.
- Default Value:
- PIXI.WRAP_MODES.CLAMP