
Pixijs Application
- 3.1k installs
- 293 repo stars
- Updated June 4, 2026
- pixijs/pixijs-skills
pixijs-application is an agent skill for creating and configuring PixiJS v8 Application instances with init options, plugins, resize handling, ticker control, and destroy cleanup.
About
pixijs-application is a PixiJS v8 agent skill for the Application convenience wrapper that owns renderer, root stage container, canvas, and ticker plugins. Version eight requires new Application() with no constructor args, then await app.init(options) before touching canvas, renderer, or screen properties. Init options documented include width, height, background, antialias, resolution, autoDensity, preference for webgl or webgpu, resizeTo, autoStart, sharedTicker, canvas injection, and destroy flags such as releaseGlobalResources to avoid stale textures after re-init. The skill explains app.stage, app.renderer, app.canvas, app.screen, and app.domContainerRoot for DOM overlay containers. ResizePlugin methods resize, queueResize, and cancelResize keep the canvas matched to window or element targets. TickerPlugin registers app.render on UPDATE_PRIORITY.LOW with start and stop controls, while autoStart false enables manual requestAnimationFrame loops. Optional CullerPlugin skips offscreen containers when cullable and cullArea are set. Related skills cover core renderers, ticker detail, scene containers, environments, performance, and custom rendering extensions.
- PixiJS v8 Application uses empty constructor plus async app.init before canvas access.
- Documents resizeTo ResizePlugin, ticker start stop, and manual render loops with autoStart false.
- app.destroy supports releaseGlobalResources to prevent flicker after re-init in the same tab.
- Optional CullerPlugin registration enables cullable containers and cullArea bounds skipping.
- Links to pixijs-core-concepts, pixijs-ticker, pixijs-scene-container, and performance skills.
Pixijs Application by the numbers
- 3,144 all-time installs (skills.sh)
- +226 installs in the week ending Jul 28, 2026 (Skillselion tracking)
- Ranked #154 of 2,277 Frontend Development skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
pixijs-application capabilities & compatibility
- Capabilities
- async application init option configuration · resizeplugin resize queueresize cancelresize con · ticker start stop and deltatime callback pattern · manual render loop with autostart false · cullerplugin opt in offscreen culling setup · destroy lifecycle with releaseglobalresources gu
- Use cases
- frontend · ui design
- Platforms
- macOS · Windows · Linux
- Runs
- Runs locally
- Pricing
- Free
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-applicationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3.1k |
|---|---|
| repo stars | ★ 293 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 4, 2026 |
| Repository | pixijs/pixijs-skills ↗ |
How do I bootstrap PixiJS v8 correctly with async init, high-DPI resize, and teardown that does not leak textures or flicker on re-init?
Create and configure PixiJS v8 Application instances with async init, resize and ticker plugins, culling, and safe destroy cleanup.
Who is it for?
Frontend developers starting PixiJS v8 projects or debugging Application init, resize, ticker, and destroy lifecycle issues.
Skip if: PixiJS v7 constructor patterns, backend APIs, or teams not rendering with the Application wrapper.
When should I use this skill?
User mentions Application, app.init, app.stage, resizeTo, CullerPlugin, app.destroy, or PixiJS v8 lifecycle triggers from the skill header.
What you get
A running PixiJS app with canvas attached, resize and ticker behavior configured, and documented destroy options for clean shutdown.
- configured PixiJS Application
- ApplicationOptions reference
By the numbers
- 3 option type sources merged into ApplicationOptions
- 8 renderer systems contribute default options
Files
Application is the convenience wrapper that owns a renderer, a root stage Container, a canvas, and the Ticker/Resize plugins. In v8 the constructor takes no arguments; all configuration is passed to the async app.init() call which instantiates the renderer via autoDetectRenderer.
Quick Start
import { Application } from "pixi.js";
const app = new Application();
await app.init({
resizeTo: window,
background: "#1099bb",
antialias: true,
preference: "webgl",
autoDensity: true,
resolution: window.devicePixelRatio,
});
document.body.appendChild(app.canvas);Related skills: pixijs-core-concepts (renderers, render pipeline), pixijs-ticker (render loop detail), pixijs-scene-container (working with app.stage), pixijs-environments (non-browser setups).
Core Patterns
Lifecycle: construct, init, render, destroy
import { Application } from "pixi.js";
const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);
// ... run scene, ticker drives app.render() automatically ...
app.destroy(
{ removeView: true, releaseGlobalResources: true },
{ children: true, texture: true, textureSource: true },
);new Application()allocates the instance but creates nothing. Options passed here are ignored with a v8 deprecation warning.app.init(options)is async. It builds the renderer, wires up plugins, and must complete before you can useapp.canvas,app.renderer, orapp.screen.- The TickerPlugin calls
app.render()every frame once init resolves (unlessautoStart: false). app.destroy(rendererDestroyOptions, stageDestroyOptions)— the first argument forwards torenderer.destroy(). Passtrueor{ removeView: true }to remove the canvas from the DOM. AddreleaseGlobalResources: trueto drain global pools (batches, texture caches) when tearing down and re-creating an app in the same tab; omitting it is the usual cause of flickering and stale textures after a re-init (seepixijs-performance).
Key init options
await app.init({
width: 800,
height: 600,
background: 0x1099bb,
backgroundAlpha: 1,
antialias: true,
resolution: window.devicePixelRatio,
autoDensity: true,
preference: "webgpu",
autoStart: true,
sharedTicker: false,
resizeTo: window,
canvas: document.querySelector("#game-canvas") as HTMLCanvasElement,
});For every option — view/canvas, background, renderer preference (including the array form), ticker, resize, culler, events, accessibility, WebGL/WebGPU context flags, Graphics bezier smoothness, GC, and per-renderer overrides (webgl / webgpu / canvasOptions) — see references/application-options.md.
Application properties
app.stage; // root Container; add all display objects here
app.renderer; // the WebGL/WebGPU/Canvas renderer instance
app.canvas; // the HTMLCanvasElement (insert it into the DOM yourself)
app.screen; // Rectangle describing the visible area in CSS pixels
app.domContainerRoot; // HTMLDivElement that holds DOMContainer overlaysapp.stage is a plain Container. For scene graph detail (transforms, addChild, destroy) see pixijs-scene-container. For renderer-level operations (extract, generateTexture, custom systems) see pixijs-core-concepts and pixijs-custom-rendering. app.domContainerRoot is the <div> that the renderer uses to host DOMContainer overlays; append it next to app.canvas when you need DOM elements pinned to scene nodes (see pixijs-scene-dom-container).
ResizePlugin
Set resizeTo at init (or reassign app.resizeTo later) to have the plugin listen for the resize event and call renderer.resize() with the target element's client size. Combine with autoDensity: true and resolution: window.devicePixelRatio for high-DPI output.
await app.init({ resizeTo: window });
app.resizeTo = document.querySelector("#game-container") as HTMLElement;
app.resize(); // immediate resize to the target's current size
app.queueResize(); // defer the resize to the next animation frame
app.cancelResize(); // drop a pending queueResizeThe plugin keeps the canvas matched to the target. app.screen and app.canvas.width/height update in response; read them after the resize to place UI.
app.resize()— immediate synchronous resize.app.queueResize()— coalesces rapid calls by deferring to the next frame; internally used by thewindow.resizelistener to avoid redundant work.app.cancelResize()— cancels a queued resize. Call this before tearing down your own layout code that triggeredqueueResize.
Ticker basics
The TickerPlugin creates app.ticker and registers app.render() on it at UPDATE_PRIORITY.LOW. Control the loop with app.start()/app.stop() and add callbacks with app.ticker.add / app.ticker.addOnce:
app.ticker.add((ticker) => {
sprite.rotation += 0.01 * ticker.deltaTime;
});
app.ticker.addOnce(() => {
console.log("runs once on the next frame, then removes itself");
});
app.stop(); // pause the render loop (e.g. tab hidden)
app.start(); // resumeThe callback receives the Ticker instance; read ticker.deltaTime for a frame-rate-independent multiplier (~1.0 at 60fps), ticker.deltaMS for real milliseconds, or ticker.FPS for the current frame rate. See pixijs-ticker for priorities, FPS capping, onRender, shared vs private tickers, and the v8 callback signature change.
Manual render loop
await app.init({ autoStart: false, width: 800, height: 600 });
document.body.appendChild(app.canvas);
function frame() {
updateScene();
app.render();
requestAnimationFrame(frame);
}
frame();autoStart: false prevents the TickerPlugin from starting the ticker automatically. Call app.render() yourself (or app.renderer.render({ container: app.stage }) for the same effect). If you still want registered ticker callbacks to fire, call app.ticker.update() inside your loop before app.render().
CullerPlugin (opt-in)
The CullerPlugin skips rendering containers that fall outside app.renderer.screen. It isn't registered by default; add it before creating your app:
import {
Application,
Container,
Sprite,
extensions,
CullerPlugin,
Rectangle,
} from "pixi.js";
extensions.add(CullerPlugin);
const app = new Application();
await app.init({ width: 800, height: 600 });
const world = new Container();
world.cullable = true; // this container is culled when its bounds leave the screen
world.cullableChildren = true; // default; set `false` to skip recursing into children
const tile = Sprite.from("tile.png");
tile.cullable = true;
world.addChild(tile);
app.stage.addChild(world);Containers are not culled unless cullable is set. Override the default bounds check with container.cullArea = new Rectangle(x, y, w, h) when child bounds are expensive to compute. The plugin wraps app.render() so Culler.shared.cull(app.stage, app.renderer.screen) runs before every frame. See pixijs-performance for when culling pays off.
Custom Application plugins
Extend Application by registering a class with static init, static destroy, and static extension = ExtensionType.Application. Both methods are called with this bound to the Application instance, so this.renderer and this.stage are available.
import {
Application,
ExtensionType,
extensions,
type ApplicationOptions,
} from "pixi.js";
class FpsOverlay {
public static extension = ExtensionType.Application;
public static init(this: Application, options: Partial<ApplicationOptions>) {
// runs inside app.init() after the renderer is created
// attach props/methods to `this` to expose them on the app
}
public static destroy(this: Application) {
// runs inside app.destroy() — tear down anything you attached
}
}
extensions.add(FpsOverlay);Plugins initialize in registration order and destroy in reverse. To add typed options for your plugin, extend PixiMixins.ApplicationOptions:
declare global {
namespace PixiMixins {
interface ApplicationOptions {
fpsOverlay?: { visible?: boolean };
}
}
}
await app.init({ fpsOverlay: { visible: true } });The built-in ResizePlugin, TickerPlugin, and opt-in CullerPlugin all use this same contract. If you set skipExtensionImports: true, register the built-ins you need yourself (extensions.add(ResizePlugin, TickerPlugin)).
Common Mistakes
[CRITICAL] Passing options to the constructor
Wrong:
const app = new Application({ width: 800, height: 600 });
document.body.appendChild(app.canvas);Correct:
const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);In v8 the Application constructor takes no arguments. Options passed there are ignored and log a deprecation warning; the renderer is only created inside the async init() call.
[HIGH] Using app.view instead of app.canvas
Wrong:
document.body.appendChild(app.view);Correct:
document.body.appendChild(app.canvas);app.view was renamed to app.canvas in v8. The old getter still works but emits a deprecation warning.
[MEDIUM] Touching app.canvas or app.renderer before init resolves
Wrong:
const app = new Application();
document.body.appendChild(app.canvas);
app.init({ width: 800, height: 600 });Correct:
const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);app.renderer, app.canvas, and app.screen are only populated once the init() promise resolves. Accessing them earlier returns undefined.
API Reference
ApplicationOptions reference
Every option accepted by app.init(options). Options come from three type sources merged into a single interface:
AutoDetectOptions→ base renderer options (width/height/resolution/etc.)PixiMixins.ApplicationOptions→ plugin options (resizeTo,autoStart,sharedTicker,culler)- System defaults → each renderer system (background, view, hello, GC, context, backbuffer, events, graphics) contributes its own options
Options with no default are unset unless you pass them. Partial<ApplicationOptions> means everything is optional.
View / canvas
Configures the main canvas and how it maps to CSS pixels.
| Option | Type | Default | Description |
|---|---|---|---|
width | number | 800 | Initial width in CSS pixels. |
height | number | 600 | Initial height in CSS pixels. |
canvas | ICanvas | — | Existing HTMLCanvasElement (or OffscreenCanvas) to render into instead of creating one. |
view | ICanvas | — | Deprecated since 8.0.0. Alias for canvas. |
resolution | number | 1 | Device pixel ratio. Set to window.devicePixelRatio for HiDPI. |
autoDensity | boolean | false | Scale CSS dimensions of the canvas so width/height stay in CSS pixels while the backing store matches resolution. Only honored on HTMLCanvasElement (ignored on OffscreenCanvas). |
antialias | boolean | false | GPU MSAA where supported. On WebGL, this only affects the main context — use useBackBuffer: true if you need antialiased filtering. |
depth | boolean | — | Allocate a depth buffer for the main view. Always on for WebGL; needed for z-ordered rendering. |
await app.init({
width: 1280,
height: 720,
resolution: window.devicePixelRatio,
autoDensity: true,
antialias: true,
});Background
Controls the clear color applied each frame.
| Option | Type | Default | Description |
|---|---|---|---|
backgroundColor | ColorSource | 0x000000 | Canvas clear color. Accepts hex, CSS string, [r, g, b, a], or any ColorSource. |
background | ColorSource | — | Alias for backgroundColor. If both are set, background wins. |
backgroundAlpha | number | 1 | Clear alpha, 0–1. Cannot be changed after init — the backing canvas is allocated with or without alpha support based on this value. Set < 1 now if you may ever need transparency. |
clearBeforeRender | boolean | true | Clear the target before each frame. Disable only if you're drawing a full-frame background yourself (e.g. a full-screen sprite). |
await app.init({
backgroundColor: 0x1099bb,
backgroundAlpha: 1,
});Renderer preference
Picks which renderer gets created.
| Option | Type | Default | Description |
|---|---|---|---|
preference | `'webgl' \ | 'webgpu' \ | 'canvas' \ |
webgl | Partial<WebGLOptions> | — | Options applied only when the WebGL renderer is selected. Merged over the top-level options. |
webgpu | Partial<WebGPUOptions> | — | Options applied only when the WebGPU renderer is selected. |
canvasOptions | Partial<CanvasOptions> | — | Options applied only when the Canvas2D renderer is selected. |
preference: array form
Passing an array to preference restricts autoDetectRenderer to exactly the listed renderers, in the given order. Any renderer not in the array is excluded entirely — the array doubles as a blocklist.
// Try WebGPU first, then fall back to WebGL. Never use Canvas2D.
await app.init({ preference: ["webgpu", "webgl"] });
// Only ever use Canvas2D (e.g. in a WebGL-disabled environment).
await app.init({ preference: ["canvas"] });
// Skip WebGPU entirely while keeping the default webgl → canvas fallback order.
await app.init({ preference: ["webgl", "canvas"] });Contrast with the string form, which falls through the full default priority if the first choice fails:
// Tries webgpu, then webgl, then canvas — all three are candidates.
await app.init({ preference: "webgpu" });Use the array when you need to guarantee a renderer is never picked (e.g. WebGPU is broken on a target device, or you want to forbid Canvas2D's feature subset).
Shared rendering
Apply to every renderer type.
| Option | Type | Default | Description |
|---|---|---|---|
roundPixels | boolean | false | Round vertex positions to whole pixels at shader time. Eliminates subpixel shimmer for pixel-art but blurs smooth motion. |
skipExtensionImports | boolean | false | Disable automatic import of default extensions. With true, import the subsystems you need manually (import 'pixi.js/accessibility', 'pixi.js/app', 'pixi.js/events', …). Used for custom tree-shaken builds. |
hello | boolean | false | Log the PixiJS version and renderer type banner to the console on init. |
failIfMajorPerformanceCaveat | boolean | false | Fail WebGL context creation if the browser reports major performance issues (blocklisted GPU, software fallback). Set true for high-performance apps that should refuse slow paths. |
await app.init({
roundPixels: true,
hello: true,
});Graphics
Graphics rendering options.
| Option | Type | Default | Description |
|---|---|---|---|
bezierSmoothness | number | 0.5 | Controls curve tessellation for Graphics bezier paths. Higher = smoother (more triangles). |
await app.init({
bezierSmoothness: 0.75,
});Ticker (TickerPluginOptions)
Controls the built-in render loop.
| Option | Type | Default | Description |
|---|---|---|---|
autoStart | boolean | true | Start the render loop automatically after init() resolves. Setting false disables app.render() being called each frame, but does not stop Ticker.shared if you've opted into sharedTicker: true. |
sharedTicker | boolean | false | Use Ticker.shared instead of creating a per-Application ticker. Useful for syncing multiple apps; loses per-app control over start/stop. |
See pixijs-ticker for the ticker API itself.
await app.init({
autoStart: false,
sharedTicker: false,
});
function loop() {
app.renderer.render(app.stage);
requestAnimationFrame(loop);
}
loop();Resize (ResizePluginOptions)
| Option | Type | Default | Description |
|---|---|---|---|
resizeTo | `Window \ | HTMLElement` | null |
The plugin listens for resize events on window and calls renderer.resize(). You can reassign app.resizeTo at runtime, and call app.resize(), app.queueResize(), or app.cancelResize() from user code.
await app.init({
resizeTo: window,
});Culler (CullerPluginOptions)
Opt-in plugin (must extensions.add(CullerPlugin) to activate).
| Option | Type | Default | Description |
|---|---|---|---|
culler.updateTransform | boolean | false (effectively) | Must be explicitly set to true to run transform updates before culling. Otherwise PixiJS skips transform updates, and cull bounds may lag one frame for moving objects. |
import { CullerPlugin, extensions } from "pixi.js";
extensions.add(CullerPlugin);
await app.init({
culler: { updateTransform: true },
});Events
| Option | Type | Default | Description |
|---|---|---|---|
eventMode | `'none' \ | 'passive' \ | 'auto' \ |
eventFeatures.move | boolean | true | Fire pointermove/mousemove/touchmove + pointerover/pointerout. |
eventFeatures.globalMove | boolean | true | Fire globalpointermove/globalmousemove/globaltouchmove regardless of hit target. Expensive; turn off if you don't need it. |
eventFeatures.click | boolean | true | Fire pointerdown/pointerup/click/tap. |
eventFeatures.wheel | boolean | true | Fire wheel. |
await app.init({
eventMode: "static",
eventFeatures: {
move: true,
globalMove: false,
click: true,
wheel: true,
},
});Accessibility
Accessibility options. Pass these on the top-level init options.
| Option | Type | Default | Description |
|---|---|---|---|
accessibilityOptions.enabledByDefault | boolean | false | Enable accessibility overlays immediately instead of waiting for the Tab key. |
accessibilityOptions.debug | boolean | false | Show the accessibility overlay divs visibly for debugging. |
accessibilityOptions.activateOnTab | boolean | true | Activate overlays when the user presses Tab. |
accessibilityOptions.deactivateOnMouseMove | boolean | true | Deactivate overlays when the mouse moves. |
See pixijs-accessibility for the full accessibility API.
await app.init({
accessibilityOptions: {
enabledByDefault: true,
activateOnTab: true,
deactivateOnMouseMove: true,
},
});WebGL-only options
Applied when the WebGL renderer is selected.
| Option | Type | Default | Description |
|---|---|---|---|
context | `WebGL2RenderingContext \ | null` | null |
powerPreference | `'high-performance' \ | 'low-power'` | undefined |
premultipliedAlpha | boolean | true | Tell the compositor the drawing buffer contains premultiplied-alpha colors. Changing this affects blending math. |
preserveDrawingBuffer | boolean | false | Keep the drawing buffer between frames. Required if you need canvas.toDataURL() or canvas.toBlob() to capture arbitrary frames. |
preferWebGLVersion | `1 \ | 2` | 2 |
multiView | boolean | false | Enable rendering to multiple canvases from one renderer. |
useBackBuffer | boolean | false | Render to an intermediate texture instead of directly to the canvas. Required for advanced blend modes and filters that sample the backdrop. Enables antialias on the back buffer independently from the main context. |
await app.init({
preference: "webgl",
webgl: {
preferWebGLVersion: 2,
useBackBuffer: true,
powerPreference: "high-performance",
},
});WebGPU-only options
| Option | Type | Default | Description |
|---|---|---|---|
powerPreference | `'high-performance' \ | 'low-power'` | undefined |
forceFallbackAdapter | boolean | false | Force the software/fallback adapter. For testing only. |
gpu | { adapter, device } | — | Use a pre-created GPUAdapter + GPUDevice pair. Useful for sharing a device between engines. |
await app.init({
preference: ["webgpu", "webgl"],
webgpu: {
powerPreference: "high-performance",
},
});Garbage collection
All time values are milliseconds.
| Option | Type | Default | Description |
|---|---|---|---|
gcActive | boolean | true | Enable the unified renderer garbage collector. |
gcMaxUnusedTime | number | 60000 | How long a resource can go unused before the GC collects it. |
gcFrequency | number | 30000 | How often the GC sweep runs. |
Deprecated (GC — prefer the unified options above)
TextureGCSystem and RenderableGCSystem still accept these, but they've been deprecated since 8.15.0 in favor of gcActive/gcMaxUnusedTime/gcFrequency. Passing them still works for the deprecation window but logs warnings.
| Option | Deprecated since | Replacement |
|---|---|---|
textureGCActive | 8.15.0 | gcActive |
textureGCMaxIdle | 8.15.0 | gcMaxUnusedTime (note: this is frames; the new API is ms) |
textureGCCheckCountMax | 8.15.0 | gcFrequency (frames → ms) |
textureGCAMaxIdle | 8.3.0 | textureGCMaxIdle (typo fix) → now gcMaxUnusedTime |
renderableGCActive | 8.15.0 | gcActive |
renderableGCMaxUnusedTime | 8.15.0 | gcMaxUnusedTime |
renderableGCFrequency | 8.15.0 | gcFrequency |
await app.init({
gcActive: true,
gcMaxUnusedTime: 60_000,
gcFrequency: 30_000,
});Per-renderer overrides
webgl, webgpu, and canvasOptions are merged over the top-level options once the selected renderer is known:
await app.init({
antialias: false,
webgl: { antialias: true, useBackBuffer: true },
webgpu: { antialias: true },
canvasOptions: {
/* canvas-specific */
},
});If WebGL wins, the renderer sees antialias: true + useBackBuffer: true. If WebGPU wins, just antialias: true. The three sub-keys are stripped before the options reach the renderer.
Related skills
How it compares
Pick pixijs-application for PixiJS-specific app.init configuration rather than generic HTML canvas setup guides.
FAQ
Why is app.init async in PixiJS v8?
Init builds the renderer, wires plugins, and must finish before canvas, renderer, or screen properties are valid.
How do I avoid texture flicker after rebuilding an app?
Pass releaseGlobalResources true in app.destroy to drain global pools when re-creating an app in the same tab.
When should I register CullerPlugin?
Add extensions.add(CullerPlugin) before creating the Application when you need offscreen container skipping.
Is Pixijs Application safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.