一键导入
pixi-solid
Use when building scenes and components with pixi-solid. Covers the full public API, JSX components, hooks, utilities, providers, and testing patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when building scenes and components with pixi-solid. Covers the full public API, JSX components, hooks, utilities, providers, and testing patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pixi-solid |
| description | Use when building scenes and components with pixi-solid. Covers the full public API, JSX components, hooks, utilities, providers, and testing patterns. |
| metadata | {"triggers":"pixi-solid, pixi-solid component, SolidJS Pixi, pixi-solid review, solid pixi, pixi solid"} |
You are an expert pixi-solid AI assistant. You write highly performant, type-safe code tailored to Solid's compiled fine-grained reactivity system and Pixi's high performance rendering capabilities.
pixi-solid is a SolidJS library that provides a set of JSX components and utilities for creating PixiJS applications. It allows developers to use SolidJS's declarative syntax to create and manage PixiJS objects, while also leveraging SolidJS's reactivity system of stores and signals for state management.
It works with pixi.js v8 and SolidJS v1.9.10 or later. Three providers exist:
PixiCanvas — simplest setup; owns the canvas and resizes to its wrapper.PixiApplicationProvider — provides app context without mounting a canvas; use when HTML outside the canvas needs hooks, or when passing an existingApp.TickerProvider — context wrapper around an existing Pixi.Ticker; use for testing or subtrees that need an independent ticker.Minimal setup — a canvas with a sprite:
import { PixiCanvas, Sprite } from "pixi-solid";
import { Texture } from "pixi.js";
function App() {
return (
<PixiCanvas style={{ width: "100%", height: "100vh" }} background="#1099bb">
<Sprite texture={Texture.WHITE} x={100} y={100} scale={50} tint="#ff0000" />
</PixiCanvas>
);
}
Reactive position using a signal:
import { createSignal } from "solid-js";
import { PixiCanvas, Sprite } from "pixi-solid";
import { Texture } from "pixi.js";
function App() {
const [x, setX] = createSignal(100);
return (
<PixiCanvas>
<Sprite texture={Texture.WHITE} positionX={x()} />
</PixiCanvas>
);
}
Note: Both
x/yandpositionX/positionYare equivalent and work for static and reactive values. Axis props (positionX,positionY,scaleX, etc.) enable fine-grained reactivity — only the changed axis triggers an update instead of the whole point object.
For full provider options see application-context.md. For component props and types see component-types.md. For hooks and lifecycle see hooks-lifecycle.md.
Quick reference for all exported symbols and where they are documented:
| Area | Exports | Docs |
|---|---|---|
| Providers | PixiCanvas, PixiApplicationProvider, TickerProvider | application-context.md |
| Hooks & lifecycle | getPixiApp, getRenderer, getTicker, onResize, onTick, usePixiScreen | hooks-lifecycle.md |
| Components | AnimatedSprite, BitmapText, Container, Graphics, HTMLText, MeshPlane, MeshRope, NineSliceSprite, ParticleContainer, PerspectiveMesh, RenderContainer, RenderLayer, Sprite, Text, TilingSprite | component-types.md |
| Prop types | PixiComponentProps, ContainerProps, LeafProps, SpriteProps, AnimatedSpriteProps, TilingSpriteProps, point-axis types, event handler types | component-types.md |
| Utils | delay, createAsyncDelay, ObjectFitContainer, objectFit, useSpring, useSmoothDamp | utils-reference.md |
| Testing | mountScene, createTestRoot, createTestContext, createManualTicker, getByLabel, queryByLabel, getAllByLabel, cleanup | testing.md |
on* props (onpointerdown), not DOM on: listeners.eventMode="static" or eventMode="dynamic".positionX, positionY, scaleX, etc.) for fine-grained reactivity instead of replacing whole point objects.onResize fires a callback; usePixiScreen returns a reactive store. Use usePixiScreen when you need dimensions as values.