Properties:
Name | Type | Default | Description |
---|---|---|---|
antialias |
boolean |
Whether to enable anti-aliasing. This may affect performance. |
|
autoDensity |
boolean |
Resizes renderer view in CSS pixels to allow for resolutions other than 1. |
|
background |
ColorSource |
Alias for backgroundColor |
|
backgroundAlpha |
number |
1
|
Transparency of the background color, value from |
backgroundColor |
ColorSource |
'black'
|
The background color used to clear the canvas. See ColorSource for accepted color values. |
canvas |
ICanvas |
The canvas to use as a view, optional. |
|
clearBeforeRender |
boolean |
true
|
Whether to clear the canvas before new render passes. |
context |
WebGL2RenderingContext | null |
null
|
User-provided WebGL rendering context object. |
depth |
boolean |
Whether to ensure the main view has can make use of the depth buffer. Always true for WebGL renderer. |
|
height |
number |
600
|
The height of the screen. |
hello |
boolean |
false
|
Whether to log the version and type information of renderer to console. |
manageImports |
boolean |
true
|
|
multiView |
boolean |
TODO: multiView |
|
powerPreference |
GpuPowerPreference |
undefined
|
An optional hint indicating what configuration of GPU is suitable for the WebGL context,
can be |
preferWebGLVersion |
1 | 2 |
2
|
The preferred WebGL version to use. |
premultipliedAlpha |
boolean |
true
|
Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha. |
preserveDrawingBuffer |
boolean |
false
|
Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
its value until cleared or overwritten. Enable this if you need to call |
resolution |
number |
The resolution / device pixel ratio of the renderer. |
|
skipExtensionImports |
boolean |
false
|
Whether to stop PixiJS from dynamically importing default extensions for the renderer. It is false by default, and means PixiJS will load all the default extensions, based on the environment e.g browser/webworker. If you set this to true, then you will need to manually import the systems and extensions you need. e.g.
|
textureGCActive |
boolean |
true
|
If set to true, this will enable the garbage collector on the GPU. |
textureGCAMaxIdle |
number |
60 * 60
|
The maximum idle frames before a texture is destroyed by garbage collection. |
textureGCCheckCountMax |
number |
600
|
Frames between two garbage collections. |
width |
number |
800
|
The width of the screen. |
Extends
- ExtractRendererOptions
- PixiMixins.RendererOptions
Members
Whether to enable anti-aliasing. This may affect performance.
Resizes renderer view in CSS pixels to allow for resolutions other than 1.
background ColorSource
Alias for backgroundColor
Transparency of the background color, value from 0
(fully transparent) to 1
(fully opaque).
- Default Value:
- 1
backgroundColor ColorSource
The background color used to clear the canvas. See ColorSource for accepted color values.
- Default Value:
- 'black'
canvas ICanvas
The canvas to use as a view, optional.
Whether to clear the canvas before new render passes.
- Default Value:
- true
User-provided WebGL rendering context object.
- Default Value:
- null
Whether to ensure the main view has can make use of the depth buffer. Always true for WebGL renderer.
The height of the screen.
- Default Value:
- 600
Whether to log the version and type information of renderer to console.
- Default Value:
- false
- Default Value:
- true
- See:
-
- `skipExtensionImports`
TODO: multiView
An optional hint indicating what configuration of GPU is suitable for the WebGL context,
can be 'high-performance'
or 'low-power'
.
Setting to 'high-performance'
will prioritize rendering performance over power consumption,
while setting to 'low-power'
will prioritize power saving over rendering performance.
- Default Value:
- undefined
The preferred WebGL version to use.
- Default Value:
- 2
Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.
- Default Value:
- true
Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve
its value until cleared or overwritten. Enable this if you need to call toDataUrl
on the WebGL context.
- Default Value:
- false
The resolution / device pixel ratio of the renderer.
Whether to stop PixiJS from dynamically importing default extensions for the renderer. It is false by default, and means PixiJS will load all the default extensions, based on the environment e.g browser/webworker. If you set this to true, then you will need to manually import the systems and extensions you need.
e.g.
import 'accessibility';
import 'app';
import 'events';
import 'spritesheet';
import 'graphics';
import 'mesh';
import 'text';
import 'text-bitmap';
import 'text-html';
import { autoDetectRenderer } from 'pixi.js';
const renderer = await autoDetectRenderer({
width: 800,
height: 600,
skipExtensionImports: true,
});
- Default Value:
- false
If set to true, this will enable the garbage collector on the GPU.
- Default Value:
- true
The maximum idle frames before a texture is destroyed by garbage collection.
- Default Value:
- 60 * 60
Frames between two garbage collections.
- Default Value:
- 600
The width of the screen.
- Default Value:
- 800