LogoPixi’VN
pixi-jsInterfaces

Interface: AutoDetectOptions

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

Options for autoDetectRenderer.

Advanced

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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.canvas


canvasOptions?

> optional canvasOptions?: Partial<CanvasOptions>

Defined in: node_modules/pixi.js/lib/rendering/renderers/autoDetectRenderer.d.ts:32

Optional CanvasOptions to pass only to the Canvas renderer


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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.eventMode


failIfMajorPerformanceCaveat?

> optional failIfMajorPerformanceCaveat?: boolean

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

Inherited from

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.powerPreference


preference?

> optional preference?: RendererPreference | RendererPreference[]

Defined in: node_modules/pixi.js/lib/rendering/renderers/autoDetectRenderer.d.ts:26

The preferred renderer type(s).

  • When a string is provided (e.g. 'webgpu'), that renderer is tried first and the remaining renderers are used as fallbacks in the default priority order.
  • When an array is provided (e.g. ['webgpu', 'webgl']), only the listed renderers are tried, in the given order. Any renderer type not in the array is excluded entirely — this can be used as a blocklist.

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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.resolution


roundPixels?

> optional roundPixels?: boolean

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

Inherited from

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.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

RendererOptions.view


webgl?

> optional webgl?: Partial<WebGLOptions>

Defined in: node_modules/pixi.js/lib/rendering/renderers/autoDetectRenderer.d.ts:30

Optional WebGLOptions to pass only to the WebGL renderer


webgpu?

> optional webgpu?: Partial<WebGPUOptions>

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

Optional WebGPUOptions to pass only to WebGPU renderer.


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

RendererOptions.width