/pixijs-skills:pixijsfrom pixijs-skills
PixiJS v8 reference for writing, fixing, or porting PixiJS code. Covers Application, scene graph, sprites, graphics, text, assets, events, filters, shaders, renderers, and migration from v7.
Ships in pixijs-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
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
const app = new Application(); await app.init({ ... }). Constructor options are ignored; until init resolves app.renderer is undefined and app.canvas/app.screen throw. applicationawait fails vite build on Vite 6 and older; wrap init in an async IIFE. createresizeTo, lay out in app.renderer.on('resize', (w, h) => ...); your own window resize listener reads the old app.screen. An element target also needs new ResizeObserver(() => app.queueResize()). applicationTicker: app.ticker.add((t) => (s.x += 2 * t.deltaTime)). deltaTime is ~1 per 60 fps frame, deltaMS is milliseconds. tickerapp.ticker.update() already renders, even with autoStart: false; skip the extra app.render(). tickerobj.onRender = () => { ... } (replaces v7 updateTransform overrides); it also runs while the object is invisible. Name subclass methods anything but _onRender. tickerUPDATE_PRIORITY.UTILITY, which runs after the render. tickerLoading assets and textures
await Assets.init({ basePath, manifest }) before the first load, loadBundle or backgroundLoad; a later init is dropped. assetsAssets.load([a, b]) resolves an object keyed by URL or alias: read res[a]. assets?id=, blob:, API route) needs Assets.load({ src, parser: 'texture' }); without it the result is null with only a warning. Audio files have no loader and also resolve null; play sound with @pixi/sound or HTMLAudioElement. assetsTexture.from(url) and Sprite.from(url) read the cache only (v7 fetched): await Assets.load(url) first. scene-spriteTextureSource (CanvasSource, texture.source): Sprite.from(source) or new Sprite(Texture.from(source)); new Sprite(source) draws nothing. scene-spritesprite.texture = new Texture({ source, frame: new Rectangle(...) }), or create the texture with dynamic: true and call texture.update(). scene-spritetexture.source.update(). spritedata (scaleMode, resolution) applies on the first load of a src only; set texture.source.scaleMode on the result instead. assetsSprites and animation
AnimatedSprite: animationSpeed is frames per 60 fps tick (12 fps is 0.2), and it needs autoPlay: true or play(). It runs on Ticker.shared, so app.ticker.stop() doesn't pause it. animated-spriteplay() after each anim.textures = ... swap; replay a finished one-shot with gotoAndPlay(0). animated-spriteorigin; pivot also moves the object, and anchor (0-1) shifts only the texture. scene-spriteGraphics
new Graphics().rect(0, 0, 100, 50).fill(0xff0000).stroke({ width: 2, color: 0x000000 }). beginFill, drawRect and lineStyle are v7. scene-graphicsFillGradient: options object, every colour stop set before the first draw, textureSpace: 'global' for pixel coordinates (the default 'local' is 0-1 across the shape). scene-graphicsrotateTransform(a).translateTransform(x, y). scene-graphicsalignment is 1 inside, 0 outside (inverted from v7). scene-graphicsGraphics by its transform; clear() and redraw every frame re-tessellates. scene-graphicsDrawing into textures (paint, eraser, scratch-off, fog of war, baking)
blendMode is ignored: put an 'erase' brush inside a plain Container and pass the wrapper to renderer.render({ container: wrapper, target, clear: false }). clear: false keeps earlier strokes. blend-modes'erase' clears everything under it in the same target, background included; give the erasable layer its own RenderTexture and erase into that. blend-modessprite.toLocal(e.global) plus the anchor offset. blend-modesgenerateTexture({ target, frame: new Rectangle(...) }): frame is a real Rectangle (a plain object throws copyTo is not a function), and the capture ignores the target's own position, scale and rotation. rendererscacheAsTexture(true) container shows changes to its children only after updateCacheTexture(). performanceParticles
ParticleContainer with addParticle(...particles); the particles option draws nothing until update(). Type it new ParticleContainer<Particle>(...) to reach tint and alpha. scene-particle-containerdynamicProperties: position, rotation, vertex (scale, anchor), color (tint, alpha), uvs (texture). A static one changes only after update(), and v7's tint/scale keys are ignored. scene-particle-containerboundsArea (its bounds are empty, so culling and filters skip it) and hitArea plus eventMode for pointer events. scene-particle-containerFilters and blend modes
c.filters = [...(c.filters ?? []), blur]. filtersFilter.from({ gl: { vertex: defaultFilterVert, fragment }, resources }). In the fragment sample uTexture, get 0-1 coordinates from vTextureCoord * uInputSize.xy / uOutputFrame.zw (both highp), and keep colour premultiplied (invert with vec4(c.a - c.rgb, c.a)). filterspreference: 'webgpu') every filter needs a gpu program too, or all filters on that container are skipped. The Canvas renderer skips filters. filterspadding; a full-screen stage filter needs app.stage.filterArea = app.screen; use resolution: 'inherit' on a high-DPI renderer. filtersDisplacementFilter takes a Sprite that is on the stage; animate the distortion by moving that sprite (map texture addressMode = 'repeat'). A TilingSprite's tilePosition is never read. filtersblendMode: new BlurFilter({ strength: 8, blendMode: 'add' }). blend-modesnormal/add/multiply/screen/erase/min/max need import 'pixi.js/advanced-blend-modes' and, on WebGL, app.init({ useBackBuffer: true }). blend-modesText
new Text({ text, style: { fill: 0xffffff } }): the default fill is black, invisible on the default black background. scene-textBitmapText; each Text change redraws a canvas and re-uploads it. scene-textawait Assets.load({ src, data: { family } }) before creating text; HTMLText sees only fonts loaded this way. html-textstyle.padding when a stroke or drop shadow is clipped. textInput
eventMode = 'static' (the default 'passive' never fires its own listeners) and cursor = 'pointer' (v7 buttonMode). eventsapp.stage.eventMode = 'static' and app.stage.hitArea = app.screen. A plain Container is hit only on its children; give it a hitArea to cover the gaps. eventsvisible = false and renderable = false remove an object from hit testing; an invisible target uses alpha = 0 or a hitArea. scene-containerpointertap (click is mouse only, tap touch only); a double click is e.detail === 2. eventsglobalpointermove (plain pointermove fires only over the object), end on pointerup and pointerupoutside, convert with parent.toLocal(e.global), and keep points with p.copyFrom(e.global) (event objects are reused). eventsapp.canvas.addEventListener('wheel', (e) => e.preventDefault(), { passive: false }). eventsScene order, coordinates and masks
zIndex orders siblings only and sorts at the next render; call parent.sortChildren() before reading children. scene-containernew RenderLayer({ sortableChildren: true }) and layer.attach(obj); attach again after reparenting, and hide or move the objects themselves (the layer's own visible, alpha and position do nothing). layersContainer; a Sprite mask reads the red channel unless setMask({ mask, channel: 'alpha' }). maskingcontainer.toLocal(e.global); getBounds() returns Bounds, so hit-test with getBounds().rectangle.contains(x, y). scene-containerMatrix methods apply in call order and a.append(b) applies b first; Container-style is scale().rotate().translate(), applied with setFromMatrix. mathcopyFrom(p) or set(x, y); pixi.js/math-extras methods return a new point, so update in place with pos.add(v, pos). mathColor reads a plain number[] as 0-1 ([180, 60, 90] is white); pass 0-255 as a Uint8Array, and alpha as '#rrggbbaa' (0xRRGGBBAA throws). colorTeardown
destroy({ children: true }) and free loaded files with Assets.unload(key). destroy(true) also destroys shared textures, atlases and GraphicsContexts, and every later render of another user throws. scene-containerapp.destroy() after init resolves (in React effects, chain it on the init promise); pass releaseGlobalResources: true when re-creating an app in the same tab. applicationgenerateTexture, canvases) with texture.destroy(true); defer a destroy from inside onRender with app.ticker.addOnce(() => obj.destroy()). performance, scene-containerRenderers and builds
Application picks WebGL unless preference: 'webgpu'. The Canvas renderer skips filters and draws nothing for Mesh. rendererspixi.js/math-extras, pixi.js/prepare, pixi.js/gif and pixi.js/advanced-blend-modes work only after a side-effect import; with skipExtensionImports: true, also import pixi.js/events, pixi.js/filters, pixi.js/accessibility and pixi.js/dom. environments| 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. |
| 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. |
| 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. |
| 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. |
references/accessibility.md (opens in a new tab)references/application.md (opens in a new tab)references/application/application-options.md (opens in a new tab)references/assets.md (opens in a new tab)references/assets/background.md (opens in a new tab)references/assets/bundles.md (opens in a new tab)references/assets/caching.md (opens in a new tab)references/assets/compressed-textures.md (opens in a new tab)references/assets/fonts.md (opens in a new tab)references/assets/manifests.md (opens in a new tab)references/assets/progress.md (opens in a new tab)references/assets/resolution.md (opens in a new tab)references/assets/spritesheet.md (opens in a new tab)references/assets/svg.md (opens in a new tab)references/assets/video.md (opens in a new tab)references/blend-modes.md (opens in a new tab)references/color.md (opens in a new tab)references/core-concepts.md (opens in a new tab)references/core-concepts/renderers.md (opens in a new tab)references/create.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub pixijs/pixijs-skills --plugin pixijs-skillsOther plugins' skills for the same job