Interface: IRendererOptions

PIXI.IRendererOptions

Renderer options supplied to constructor.

Properties:
Name Type Default Description
antialias boolean false

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

autoDensity boolean false

Whether the CSS dimensions of the renderer's view should be resized automatically.

backgroundAlpha number 1

Transparency of the background color, value from 0 (fully transparent) to 1 (fully opaque).

backgroundColor number 0x000000

The background color used to clear the canvas. It accepts hex numbers (e.g. 0xff0000).

clearBeforeRender boolean true

Whether to clear the canvas before new render passes.

context IRenderingContext

WebGL Only. User-provided WebGL rendering context object.

height number 600

The height of the renderer's view.

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.

preserveDrawingBuffer boolean false

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.

resolution number PIXI.settings.RESOLUTION

The resolution / device pixel ratio of the renderer.

transparent boolean

Use backgroundAlpha instead.

useContextAlpha boolean | "notMultiplied" true

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.

view HTMLCanvasElement

The canvas to use as the view. If omitted, a new canvas will be created.

width number 800

The width of the renderer's view.

See:

Extends

  • GlobalMixins.IRendererOptions

Members

antialias boolean

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

Default Value:
  • false

autoDensity boolean

Whether the CSS dimensions of the renderer's view should be resized automatically.

Default Value:
  • false

backgroundAlpha number

Transparency of the background color, value from 0 (fully transparent) to 1 (fully opaque).

Default Value:
  • 1

backgroundColor number

The background color used to clear the canvas. It accepts hex numbers (e.g. 0xff0000).

Default Value:
  • 0x000000

clearBeforeRender boolean

Whether to clear the canvas before new render passes.

Default Value:
  • true

WebGL Only. User-provided WebGL rendering context object.

height number

The height of the renderer's view.

Default Value:
  • 600

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.

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.

Default Value:
  • false

resolution number

The resolution / device pixel ratio of the renderer.

Default Value:
  • PIXI.settings.RESOLUTION

transparent boolean Deprecated : since 6.0.0

Use backgroundAlpha instead.

useContextAlpha boolean | "notMultiplied"

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.

Default Value:
  • true

view HTMLCanvasElement

The canvas to use as the view. If omitted, a new canvas will be created.

width number

The width of the renderer's view.

Default Value:
  • 800