assets
Use when adding, organizing, registering, or loading non-code files (images, audio, video) in a Pixi'VN project — local assets…
Use when building game UI (menus, HUD, dialogue box, settings/save screens) on top of Pixi'VN with an external JS framework (React, Vue) or with plain PixiJS components — mounting HTML or PixiJS UI layers over the canvas, navigating between UI screens/routes, theming a
$ npx -y skills add drincs-productions/pixi-vn --skill ui --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/uiContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when building game UI (menus, HUD, dialogue box, settings/save screens) on top of Pixi'VN with an external JS framework (React, Vue) or with plain PixiJS components — mounting HTML or PixiJS UI layers over the canvas, navigating between UI screens/routes, theming a
name: pixi-vn-ui description: Use when building game UI (menus, HUD, dialogue box, settings/save screens) on top of Pixi'VN with an external JS framework (React, Vue) or with plain PixiJS components — mounting HTML or PixiJS UI layers over the canvas, navigating between UI screens/routes, theming a shadcn/ui-based template, and connecting UI components to game storage/settings. Covers `canvas.htmlLayers.add`/`get`/`remove` and the PixiJS-only layer helpers `canvas.layers.add`/`get`/`remove`.
Pixi’VN does not ship its own UI components (buttons, menus, forms, HUD). Instead of reinventing what already exists in the JavaScript ecosystem, it lets a project use any external framework (React, Vue, ...) — or plain PixiJS — to build the UI, and just provides the plumbing to mount that UI on top of the canvas and keep it in sync with game data. Official docs: [pixi-vn.com/start/interface](https://pixi-vn.com/start/interface).
Because the UI is built with standard, widely-used frameworks rather than a proprietary system, AI coding assistants already know these tools well — this is a deliberate design choice, not just a missing feature.
Load this skill whenever a task involves:
changes made elsewhere (a label, a step, loading a save).
For the rendering primitives the UI sits on top of (images, sprites, text, transitions), see `pixi-vn-canvas`. For building UI screens purely out of PixiJS components (no HTML framework), see **`pixijs.md`** in this same skill folder.
The UI and the canvas are two distinct, independent systems:
save and restored when loading one — see `pixi-vn-storage`/`pixi-vn-saves`. The UI's current state is never included; you must persist whatever UI state matters yourself, into [game storage](https://pixi-vn.com/start/storage) or browser storage (see "Connecting UI to game data" below).
each narration step. The UI instead is built as several distinct "screens", and you move between them with a router (see "Navigating between UI screens" below) — you don't swap UI content per step the way you swap canvas elements.
save-able component classes (`Container`, `Sprite`, `ImageSprite`, `Text`, ...). The UI layer can hold any HTML/PixiJS component or any UI component library, so it's where the actual interface complexity (forms, animations, component libraries) belongs.
An HTML UI Layer is a `<div>` added above the PixiJS canvas, sized and positioned to match it — this is how a React/Vue (or any DOM-based) UI gets mounted on top of the game.
const root = document.getElementById("root");
if (!root) {
throw new Error("root element not found");
}
const htmlLayer = canvas.htmlLayers.add("ui", root, {
position: "absolute",
pointerEvents: "none",
userSelect: "none",
});
// createRoot(htmlLayer).render(<App />)<!doctype html>
<html lang="en">
<body>
<div id="root"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>to render into. `style` is `Partial<Pick<CSSStyleDeclaration, "position" | "pointerEvents" | "userSelect">>`, defaulting to `{ position: "absolute", pointerEvents: "none", userSelect: "none" }`.
**Enabling interaction**: every HTML UI layer defaults to `pointer-events: none`, so by default none of its elements intercept mouse/touch — the PixiJS canvas gets all events. This matters when you want an image/video on the canvas to receive clicks/taps unobstructed by an overlay. Set `pointer-events: auto` explicitly, and only, on the components that must be interactive:
export default function NextButton() {
return <button style={{ pointerEvents: "auto" }}>Next</button>;
}@layer components {
[data-slot="button"],
[data-slot="card"],
[data-slot="toggle"] {
pointer-events: auto;
}
}You can also build a UI screen directly out of PixiJS components (no HTML framework at all), or mix PixiJS components into an HTML-based UI. This uses a **PixiJS UI Layer** — a plain PixiJS `Container` attached directly to the PixiJS stage, outside the save-able `canvas.gameLayer` — via `canvas.layers.add`/`get`/`remove`. See **`pixijs.md`** in this skill folder for the full API, the differences from `gameLayer`, combining PixiJS and HTML layers, and recommended component libraries (PixiUI, PixiLayout).
The API above is library-level; here's _one_ concrete way it's used in practice, from the official "TS narration + React" template (what `npm create pixi-vn@latest` scaffolds) at `src/main.tsx` / `src/constants.ts`. This is **the template's convention, not a library requirement**.
`HTML_UI_LAYER_NAME`, `HTML_CANVAS_LAYER_NAME`. A separate `CANVAS_MINIGAME_LAYER_NAME` constant reserves a layer for future minigame content.
Pixi’VN is a very versatile and powerful story-driven engine. It is based on JavaScript/TypeScript and PixiJS, and supports animated characters through Spine 2D and Live2D.
Use when adding, organizing, registering, or loading non-code files (images, audio, video) in a Pixi'VN project — local assets…
Use when adding, moving, or removing images, sprites, text, or video on the Pixi'VN game canvas, or when applying or creating…
Use when defining visual novel characters for a @drincs/pixi-vn game — creating a character with a name, color, icon and other…
Index and entry point of the Pixi'VN skill set — start here for any task on a @drincs/pixi-vn project, then follow the skill map…
Use when implementing "go back" / "rewind" / step-navigation features in a Pixi'VN game, or when you need to read the…
Use when upgrading an existing @drincs/pixi-vn project to a newer version, or when a runtime/type error matches a known breaking…