LogoPixi’VN
pixi-jsInterfaces

Interface: RendererOptions

Defined in: node_modules/pixi.js/lib/rendering/renderers/types.d.ts:28

Options for the renderer.

Standard

Extends

Extended by

Properties

antialias?

> optional antialias?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:42

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

Inherited from

WebGLOptions.antialias


autoDensity?

> optional autoDensity?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:38

Resizes renderer view in CSS pixels to allow for resolutions other than 1.

This is only supported for HTMLCanvasElement and will be ignored if the canvas is an OffscreenCanvas.

Inherited from

WebGLOptions.autoDensity


background?

> optional background?: ColorSource

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.d.ts:17

Alias for backgroundColor

Inherited from

WebGLOptions.background


backgroundAlpha?

> optional backgroundAlpha?: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.d.ts:25

Transparency of the background color, value from 0 (fully transparent) to 1 (fully opaque). This value determines whether the canvas is initialized with alpha transparency support. Note: This cannot be changed after initialization. If set to 1, the canvas will remain opaque, even if a transparent background color is set later.

Default

1

Inherited from

WebGLOptions.backgroundAlpha


backgroundColor

> backgroundColor: ColorSource

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.d.ts:15

The background color used to clear the canvas. See ColorSource for accepted color values.

Default

'black'

Inherited from

WebGLOptions.backgroundColor


bezierSmoothness

> bezierSmoothness: number

Defined in: node_modules/pixi.js/lib/scene/graphics/GraphicsMixins.d.ts:35

A value from 0 to 1 that controls the smoothness of bezier curves (the higher the smoother)

Default

0.5

Inherited from

WebGLOptions.bezierSmoothness


canvas?

> optional canvas?: ICanvas

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:26

The canvas to use as a view, optional.

Inherited from

WebGLOptions.canvas


clearBeforeRender?

> optional clearBeforeRender?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/background/BackgroundSystem.d.ts:30

Whether to clear the canvas before new render passes.

Default

true

Inherited from

WebGLOptions.clearBeforeRender


context

> context: WebGL2RenderingContext | null

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:29

User-provided WebGL rendering context object.

Default

null

Inherited from

WebGLOptions.context


depth?

> optional depth?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:44

Whether to ensure the main view has can make use of the depth buffer. Always true for WebGL renderer.

Inherited from

WebGLOptions.depth


eventFeatures?

> optional eventFeatures?: Partial<EventSystemFeatures>

Defined in: node_modules/pixi.js/lib/events/EventsMixins.d.ts:73

Configuration for enabling/disabling specific event features. Use this to optimize performance by turning off unused functionality.

Example

const app = new Application();
await app.init({
    eventFeatures: {
        // Core interaction events
        move: true,        // Pointer/mouse/touch movement
        click: true,       // Click/tap events
        wheel: true,       // Mouse wheel/scroll events
        // Global tracking
        globalMove: false  // Global pointer movement
    }
});

Since

7.2.0

Inherited from

WebGLOptions.eventFeatures


eventMode?

> optional eventMode?: EventMode

Defined in: node_modules/pixi.js/lib/events/EventsMixins.d.ts:53

The type of interaction behavior for a Container. This is set via the Container#eventMode property.

Example

// Basic event mode setup
const sprite = new Sprite(texture);
sprite.eventMode = 'static';    // Enable standard interaction
sprite.on('pointerdown', () => { console.log('clicked!'); });

// Different event modes
sprite.eventMode = 'none';      // Disable all interaction
sprite.eventMode = 'passive';   // Only allow interaction on children
sprite.eventMode = 'auto';      // Like DOM pointer-events: auto
sprite.eventMode = 'dynamic';   // For moving/animated objects

Available modes:

  • 'none': Ignores all interaction events, even on its children
  • 'passive': (default) Does not emit events and ignores hit testing on itself and non-interactive children. Interactive children will still emit events.
  • 'auto': Does not emit events but is hit tested if parent is interactive. Same as interactive = false in v7
  • 'static': Emit events and is hit tested. Same as interactive = true in v7
  • 'dynamic': Emits events and is hit tested but will also receive mock interaction events fired from a ticker to allow for interaction when the mouse isn't moving

Performance tips:

  • Use 'none' for pure visual elements
  • Use 'passive' for containers with some interactive children
  • Use 'static' for standard buttons/controls
  • Use 'dynamic' only for moving/animated interactive elements

Since

7.2.0

Inherited from

WebGLOptions.eventMode


failIfMajorPerformanceCaveat?

> optional failIfMajorPerformanceCaveat?: boolean

Defined in: node_modules/pixi.js/lib/rendering/RenderingMixins.d.ts:15

Inherited from

WebGLOptions.failIfMajorPerformanceCaveat


forceFallbackAdapter

> forceFallbackAdapter: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/gpu/GpuDeviceSystem.d.ts:40

Force the use of the fallback adapter

Default

false

Inherited from

WebGPUOptions.forceFallbackAdapter


gcActive

> gcActive: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/GCSystem.d.ts:50

If set to true, this will enable the garbage collector.

Default

true

Inherited from

WebGLOptions.gcActive


gcFrequency

> gcFrequency: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/GCSystem.d.ts:60

How frequently to run garbage collection in milliseconds.

Default

30000

Inherited from

WebGLOptions.gcFrequency


gcMaxUnusedTime

> gcMaxUnusedTime: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/GCSystem.d.ts:55

The maximum time in milliseconds a resource can be unused before being garbage collected.

Default

60000

Inherited from

WebGLOptions.gcMaxUnusedTime


gpu?

> optional gpu?: GPU

Defined in: node_modules/pixi.js/lib/rendering/renderers/gpu/GpuDeviceSystem.d.ts:42

Using shared device and adaptor from other engine

Inherited from

WebGPUOptions.gpu


height?

> optional height?: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:24

The height of the screen.

Default

600

Inherited from

WebGLOptions.height


hello

> hello: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/startup/HelloSystem.d.ts:15

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

Default

false

Inherited from

WebGLOptions.hello


~~manageImports?~~

> optional manageImports?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SharedSystems.d.ts:73

Default

true

Deprecated

since 8.1.6

See

skipExtensionImports

Inherited from

WebGLOptions.manageImports


multiView

> multiView: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:60

Whether to enable multi-view rendering. Set to true when rendering to multiple canvases on the dom.

Default

false

Inherited from

WebGLOptions.multiView


powerPreference?

> optional powerPreference?: GpuPowerPreference

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:37

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

undefined

Inherited from

WebGLOptions.powerPreference


preferWebGLVersion?

> optional preferWebGLVersion?: 1 | 2

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:54

The preferred WebGL version to use.

Default

2

Inherited from

WebGLOptions.preferWebGLVersion


premultipliedAlpha

> premultipliedAlpha: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:42

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

Default

true

Inherited from

WebGLOptions.premultipliedAlpha


preserveDrawingBuffer

> preserveDrawingBuffer: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.d.ts:48

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

false

Inherited from

WebGLOptions.preserveDrawingBuffer


renderableGCActive

> renderableGCActive: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.d.ts:20

If set to true, this will enable the garbage collector on the GPU.

Default

true

Inherited from

WebGLOptions.renderableGCActive


renderableGCFrequency

> renderableGCFrequency: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.d.ts:30

Frames between two garbage collections.

Default

600

Inherited from

WebGLOptions.renderableGCFrequency


renderableGCMaxUnusedTime

> renderableGCMaxUnusedTime: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.d.ts:25

The maximum idle frames before a texture is destroyed by garbage collection.

Default

60 * 60

Inherited from

WebGLOptions.renderableGCMaxUnusedTime


resolution?

> optional resolution?: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:40

The resolution / device pixel ratio of the renderer.

Inherited from

WebGLOptions.resolution


roundPixels?

> optional roundPixels?: boolean

Defined in: node_modules/pixi.js/lib/rendering/RenderingMixins.d.ts:16

Inherited from

WebGLOptions.roundPixels


skipExtensionImports?

> optional skipExtensionImports?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/system/SharedSystems.d.ts:67

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

false

Inherited from

WebGLOptions.skipExtensionImports


~~textureGCActive~~

> textureGCActive: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureGCSystem.d.ts:17

If set to true, this will enable the garbage collector on the GPU.

Default

true

Deprecated

since 8.15.0

Inherited from

WebGLOptions.textureGCActive


~~textureGCAMaxIdle~~

> textureGCAMaxIdle: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureGCSystem.d.ts:22

Deprecated

since 8.3.0

See

TextureGCSystemOptions.textureGCMaxIdle

Inherited from

WebGLOptions.textureGCAMaxIdle


~~textureGCCheckCountMax~~

> textureGCCheckCountMax: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureGCSystem.d.ts:34

Frames between two garbage collections.

Default

600

Deprecated

since 8.15.0

Inherited from

WebGLOptions.textureGCCheckCountMax


~~textureGCMaxIdle~~

> textureGCMaxIdle: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/texture/TextureGCSystem.d.ts:28

The maximum idle frames before a texture is destroyed by garbage collection.

Default

60 * 60

Deprecated

since 8.15.0

Inherited from

WebGLOptions.textureGCMaxIdle


useBackBuffer?

> optional useBackBuffer?: boolean

Defined in: node_modules/pixi.js/lib/rendering/renderers/gl/GlBackBufferSystem.d.ts:17

if true will use the back buffer where required

Default

false

Inherited from

WebGLOptions.useBackBuffer


~~view?~~

> optional view?: ICanvas

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:31

Alias for canvas.

Deprecated

since 8.0.0

Inherited from

WebGLOptions.view


width?

> optional width?: number

Defined in: node_modules/pixi.js/lib/rendering/renderers/shared/view/ViewSystem.d.ts:19

The width of the screen.

Default

800

Inherited from

WebGLOptions.width