Interface ContextSystemOptions

Options for the context system.

PIXI

interface ContextSystemOptions {
    antialias: boolean;
    context: null | IRenderingContext;
    powerPreference: WebGLPowerPreference;
    premultipliedAlpha: boolean;
    preserveDrawingBuffer: boolean;
    useContextAlpha?: boolean | "notMultiplied";
}

Hierarchy (View Summary)

Properties

antialias: boolean

WebGL Only. Whether to enable anti-aliasing. This may affect performance.

PIXI.IRendererOptions

context: null | IRenderingContext

WebGL Only. User-provided WebGL rendering context object.

PIXI.IRendererOptions

powerPreference: WebGLPowerPreference

WebGL Only. A hint indicating what configuration of GPU is suitable for the WebGL context, can be 'default', '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.

PIXI.IRendererOptions

premultipliedAlpha: boolean

WebGL Only. Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.

PIXI.IRendererOptions

preserveDrawingBuffer: boolean

WebGL Only. 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.

PIXI.IRendererOptions

useContextAlpha?: boolean | "notMultiplied"

Deprecated since 7.0.0, use premultipliedAlpha and backgroundAlpha instead.

Pass-through value for canvas' context attribute alpha. This option is for cases where the canvas needs to be opaque, possibly for performance reasons on some older devices. If you want to set transparency, please use backgroundAlpha.

WebGL Only: When set to 'notMultiplied', the canvas' context attribute alpha will be set to true and premultipliedAlpha will be to false.

since 7.0.0

PIXI.IRendererOptions