Pixijs

From pixijs/pixijs-skills · View interactive version

Pixijs is an AI agent skill from the GitHub repository pixijs/pixijs-skills. PixiJS v8 (pixi.js) reference. Use it before writing, fixing or porting any PixiJS code, from a one-line fix to a whole app or game. Routes to topic files: Application (app.init, resizeTo, resolution), Container scene graph (addChild, zIndex, RenderLayer, mask, destroy), Sprite, Texture, AnimatedSpr

How to use this skill

Skill file

Read before you write

  1. List the files. Write down every router row below that your task touches: each class you construct, options object you pass, effect you build and symptom you fix. A whole app usually lists four to eight (an eraser paint app: application, assets, scene-sprite, events, blend-modes; a game: application, assets, scene-sprite, events, ticker, scene-text).
  2. Read each listed file before you write the code for that part, even for a one-line change. Open the file itself; a Grep hit is a fragment that drops the rule and the exception beside it. Each topic file links to its sub-pages for rarer branches.
  3. Done when every file on your list has been opened. Then check your code against the pitfall group below for each feature you built.

No row fits: scan references/index.md (sub-pages, long-tail keywords, error strings), then the project's local PixiJS docs.

For a signature or option this skill doesn't cover, fetch the class's API page: https://pixijs.download/release/docs/<module>.<Class>.html.md (app.Application, scene.Graphics, rendering.Texture, assets.Assets). To find a class's module, look it up in https://pixijs.download/release/docs/llms.txt.

Pitfalls that fail silently

Each line is the fix; its link owns the rule and the code. These run without errors and draw the wrong thing, and a Vite build doesn't type-check, so run npx tsc --noEmit to catch wrong option names.

App setup and the frame loop

Loading assets and textures

Sprites and animation

Graphics

Drawing into textures (paint, eraser, scratch-off, fog of war, baking)

Particles

Filters and blend modes

Text

Input

Scene order, coordinates and masks

Teardown

Renderers and builds

Reference router

Foundations

| Reference | Read when your code touches... |

|---|---|

| application | Application, app.init() options and defaults, app.stage/renderer/canvas/screen, resizeTo, queueResize, layout on resize, resolution/autoDensity/HiDPI (also after init), autoStart, sharedTicker, app.start()/stop(), CullerPlugin, Application plugins, app.destroy() and React StrictMode cleanup. |

| core-concepts | Choosing WebGL/WebGPU/Canvas, autoDetectRenderer, checking the backend, renderer.render() options (clear, transform, target), RenderTexture/RenderTarget, generateTexture, systems and pipes, renderer loaders, Three.js interop (resetState), context and device loss. |

| ticker | Per-frame logic: app.ticker.add, deltaTime vs deltaMS, UPDATE_PRIORITY and frame order, maxFPS/minFPS, speed, onRender (v7 updateTransform), Ticker.shared, a manual loop with ticker.update(), pausing. |

| environments | Web Workers and OffscreenCanvas, Node/SSR/headless, strict CSP (pixi.js/unsafe-eval), DOMAdapter and custom fetch (auth headers), custom or tree-shaken builds (skipExtensionImports, side-effect imports), bundle size. |

| create | Scaffolding with npm create pixi.js and its templates, adding pixi.js to an existing project, tsconfig for TypeScript 5-7, Vite top-level-await build errors, @webgpu/types conflicts. |

| migration-v8 | Porting a whole v7 codebase: @pixi/* imports, BaseTexture, DisplayObject, settings and utils, renderer.plugins, renamed options and enums (SCALE_MODES, BLEND_MODES). For one API, its topic file is enough. |

Scene

| Reference | Read when your code touches... |

|---|---|

| scene-core-concepts | The scene graph as a whole: containers vs leaves, render order, which class to use; sub-pages for coordinate spaces and worldTransform, render groups (isRenderGroup, panning a world), constructor options, RenderLayer (depth sort across parents), and masks (mask, setMask, inverse, sprite-mask channel). |

| scene-container | Container: addChild/removeChildren/reparentChild, pivot vs origin, hiding (visible/renderable/alpha), zIndex and sortChildren(), getBounds, toGlobal/toLocal, setSize, container events, onRender, destroy options. |

| scene-sprite | Sprite, Texture vs TextureSource, Sprite.from/Texture.from, sub-textures and frame, dynamic and canvas textures, shared-texture destroy; AnimatedSprite (speed, swapping or replaying animations, onComplete), NineSliceSprite (panels, borders), TilingSprite (tilePosition, scrolling backgrounds). |

| scene-graphics | Graphics beyond a colour-filled shape: paths, holes (cut), strokes, FillGradient, FillPattern, texture fills, draw-time transforms, GraphicsContext sharing, SVG import and export (svg(), graphicsContextToSvg), hit testing, smooth edges without MSAA (SmoothGraphics), dashed lines (DashLineShader), v7 beginFill/lineStyle ports. |

| scene-text | Text, TextStyle, BitmapText (BitmapFont.install, .fnt, MSDF), HTMLText (fonts, tag styles), SplitText/SplitBitmapText, per-frame text cost, shaped scripts. |

| scene-mesh | Mesh, MeshGeometry (positions, uvs, indices, topology), MeshSimple, MeshPlane, MeshRope (trails), PerspectiveMesh, UVs and addressMode, mesh hit testing. |

| scene-particle-container | ParticleContainer, Particle, dynamicProperties, update(), emitters and particle pools, fading or tinting particles, pointer events on particles. |

| scene-dom-container | HTML elements over the canvas: DOMContainer, inputs and iframes, click-through pointer-events, domContainerRoot, removing the element. |

| scene-gif | Animated GIFs: pixi.js/gif, GifSprite, GifSource, GIF frame rate, cleanup. |

| html-source | Live HTML/DOM rendered into a texture (experimental HTML-in-Canvas): HTMLSource, ElementImageSource, pixi.js/html-source, requestPaint. |

Utilities

| Reference | Read when your code touches... |

|---|---|

| assets | Assets.init/load/add/get/unload, load result shapes, extension-less or blob: URLs (parser), retries and errors, bundles, manifests, background loading, progress bars, spritesheets, fonts, video, SVG, compressed textures, @2x resolution. |

| events | Pointer, mouse, touch, wheel: eventMode, pointertap vs click/tap, double click, propagation and capture, hitArea, interactiveChildren, clicks on empty canvas, drag (globalpointermove), cursor, FederatedPointerEvent, eventFeatures. |

| math | Point/ObservablePoint (set, copyFrom), Matrix (order, append/prepend, decompose, setFromMatrix), Rectangle and hit-area shapes, pixi.js/math-extras vector methods, DEG_TO_RAD. |

| color | Color and ColorSource: input ranges (hex with alpha, arrays, Uint8Array), conversions (toHex, toRgba, toNumber), tint and alpha, premultiply, v7 utils.string2hex. |

| accessibility | Screen readers and keyboard navigation: accessible, accessibleTitle, tabIndex, accessibilityOptions, no overlay element appearing. |

Effects and rendering

| Reference | Read when your code touches... |

|---|---|

| blend-modes | Any blendMode (add, multiply, screen, erase), an eraser, scratch-off or fog of war, painting into a RenderTexture, blend mode of the render root or of a filtered container, overlay and other advanced modes. |

| filters | BlurFilter, ColorMatrixFilter, DisplacementFilter, NoiseFilter, AlphaFilter, custom Filter.from (GLSL, WGSL), filter uniforms, padding, filterArea, resolution, blendRequired, pixi-filters, multi-pass filters (bloom). |

| custom-rendering | Custom shaders on a Mesh: Shader.from, GlProgram/GpuProgram, UniformGroup and uniform types, textures as resources, built-in shader inputs (aPosition, uProjectionMatrix); custom batchers, pipes, render bundles, 3D/array/storage textures. |

| performance | FPS, draw calls, memory leaks, first-frame hitches: teardown (destroy, Assets.unload), GCSystem, PrepareSystem, render groups, cacheAsTexture, batching order, culling (cullable), pooling, filter and mask cost. |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.