assets
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 transitions (dissolve, fade, move, zoom, push, wipe, iris, split, flash, blur, pixelate, or a custom one built on `canvas.animate`/`filters.animate`),
$ npx -y skills add drincs-productions/pixi-vn --skill canvas --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/canvasContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when adding, moving, or removing images, sprites, text, or video on the Pixi'VN game canvas, or when applying or creating transitions (dissolve, fade, move, zoom, push, wipe, iris, split, flash, blur, pixelate, or a custom one built on `canvas.animate`/`filters.animate`),
name: pixi-vn-canvas description: Use when adding, moving, or removing images, sprites, text, or video on the Pixi'VN game canvas, or when applying or creating transitions (dissolve, fade, move, zoom, push, wipe, iris, split, flash, blur, pixelate, or a custom one built on `canvas.animate`/`filters.animate`), shake/animation effects, or ticker-based animations built on PixiJS. Covers the `canvas` singleton exported from `@drincs/pixi-vn`. For UI layers (HTML or PixiJS) mounted on top of the canvas, see `pixi-vn-ui` instead.
The Canvas module is Pixi'VN's 2D scene graph, built directly on top of PixiJS. It manages everything that is visually rendered in the game: background images, character sprites, text, video, and the transitions/animations between them. Official docs: [pixi-vn.com/start/canvas](https://pixi-vn.com/start/canvas).
Every symbol used below (`canvas`, `showImage`, `Sprite`, transition helpers, etc.) is exported from the main package entry point:
import { canvas } from "@drincs/pixi-vn";(Also available from the narrower `@drincs/pixi-vn/canvas` subpath — see `pixi-vn` for when to prefer that.)
Load this skill whenever a task involves:
For building/mounting UI layers (HTML or PixiJS) on top of the canvas, use `pixi-vn-ui` instead — this skill is about the `gameLayer` save-able scene graph, not UI chrome.
For dialogue/character-portrait logic use `pixi-vn-characters` and `pixi-vn-narration` instead; this skill is about the underlying rendering primitives.
a PixiJS `Application` and exposes methods to manage canvas elements and layers. Call `await canvas.init(element, options)` once at startup (this is normally done for you by `Game.init(...)` from the core package — see `pixi-vn`).
`canvas.add(alias, component)` inserts a component (an instance of `Container`, `Sprite`, `ImageSprite`, `ImageContainer`, `Text`, or `VideoSprite`) into `canvas.layers.gameLayer` (a single PixiJS `Container` that holds all "in-scene" elements) and sets `component.label = alias`. Use `canvas.find<T>(alias)` to look elements back up and `canvas.remove(alias)` to remove them. Aliases are also how Pixi'VN saves/restores canvas state (see `pixi-vn-storage`), so prefer the alias-based helpers below over holding onto raw object references across steps.
`PIXI.Container`, `Sprite`/`ImageSprite`/`VideoSprite` extend `PIXI.Sprite`, `Text` extends `PIXI.Text`. They add a `.memory` getter / `.setMemory()` for serialization, plus convenience properties (`anchor`, `align`, `percentagePosition`, `xAlign`/`yAlign`, `percentageX`/`percentageY`) as alternative ways to position an element without doing pixel math.
special Layer class. A separate, non-save-able PixiJS Container can be attached directly to the stage as a sibling of `gameLayer` (`canvas.layers.add`/`get`/`remove`) — see `pixi-vn-ui` for that API, it's how UI layers (HTML or PixiJS) are built on top of the canvas.
(built on the `motion` library) is the high-level way to animate numeric properties over time, and it is what all the built-in transition helpers use internally. Running tickers are managed through the separate **`tickers`** singleton (also from `@drincs/pixi-vn`, not a member of `canvas` — the old `canvas.tickers` is a deprecated alias of it).
import { canvas, addImage, showImage } from "@drincs/pixi-vn";
// addImage() creates + registers the sprite but does NOT load/display the texture yet
const bunny1 = addImage("bunny1"); // "bunny1" is an alias registered in the assets manifest
await bunny1.load();
// showImage() is addImage() + load() in one call
const bunny2 = await showImage("bunny2");
bunny2.anchor = 0.5;
bunny2.x = canvas.width / 2;
bunny2.y = canvas.height / 2;
// remove it later by alias
canvas.remove("bunny1");Always pass a manifest **alias** (as above), not a raw URL/path — see `pixi-vn-assets` for how assets get registered (local vs. online) and loaded. `addImage`/`showImage` do also accept a raw URL as a second argument for quick prototyping, but that couples code to a specific file location; `addImage`/`showImage` throw a `PixiError` if neither a URL nor a registered alias resolves. Both return an `ImageSprite`.
For a composite image made of multiple stacked textures (e.g. a character body + outfit + face), use `ImageContainer` via `addImageCointainer` / `showImageContainer` (note the exported spelling "Cointainer"):
import { showImageContainer } from "@drincs/pixi-vn";
const liam = await showImageContainer("liam", ["liam-body", "liam-head"]);import { showText } from "@drincs/pixi-vn";
showText("score-label", "Score: 0", {
fontSize: 24,
fill: "white",
x: 20,
y: 20,
});`showText(alias, text, options)` creates/replaces a `Text` element (extends `PIXI.Text`) and adds it to the canvas immediately. `options` is `TextOptions` (PixiJS `CanvasTextOptions` plus the `align`/`percentagePosition` positioning extensions), so `sty
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 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…
Use when adding a minigame (snake, quiz, puzzle, timing/reaction game, ...) to a Pixi'VN visual novel — the `useMinigame`…