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.

background number | string

Alias for backgroundColor.

backgroundAlpha number 1

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

backgroundColor number | string 0x000000

The background color used to clear the canvas. It accepts hex numbers (e.g. 0xff0000), hex strings (e.g. '#f00' or '#ff0000') or color names (e.g. 'red').

clearBeforeRender boolean true

Whether to clear the canvas before new render passes.

context PIXI.IRenderingContext

WebGL Only. User-provided WebGL rendering context object.

height number 600

The height of the renderer's view.

hello boolean false

Whether to log the version and type information of renderer to console.

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.

premultipliedAlpha boolean true

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

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.

useContextAlpha boolean | "notMultiplied" true

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.

view PIXI.ICanvas

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

background number | string

Alias for backgroundColor.

backgroundAlpha number

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

Default Value:
  • 1

backgroundColor number | string

The background color used to clear the canvas. It accepts hex numbers (e.g. 0xff0000), hex strings (e.g. '#f00' or '#ff0000') or color names (e.g. 'red').

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

hello boolean

Whether to log the version and type information of renderer to console.

Default Value:
  • false

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.

premultipliedAlpha boolean

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

Default Value:
  • true

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

useContextAlpha boolean | "notMultiplied" Deprecated : since 7.0.0

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.

Default Value:
  • true

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