# @drincs/pixi-vn 中文文档

规范地址：https://npmcn.com/package/%40drincs/pixi-vn/

版本：1\.9\.9
npm 元数据更新时间：2026-11-06T10:24:03.694Z
中文译文更新时间：2026-11-13T00:54:32.848Z
软件包许可：LGPL-2\.1

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40drincs/pixi-vn
原文对照：https://npmcn.com/package/%40drincs/pixi-vn/?lang=original
项目主页：https://pixi-vn.com/
源码仓库：https://github.com/DRincs-Productions/pixi-vn

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：2.5 MB，96 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：tone \>=15\.1\.0，vite \>=5\.0\.0，motion \>=12\.38\.0，pixi\.js \>=8\.17\.0，pixi-filters \>=6\.1\.0，@pixi/devtools \>=2\.0\.0
- 首次发布：2024-03-21T10:44:38.488Z
- 最新版本发布：2026-11-06T10:24:03.298Z
- 近 30 天下载量：2647（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：264（近 12 个月 85 个）

## 中文简介

Pixi'VN是一个非常多能和强大的游戏/故事驱动引擎.

## 安装

```sh
npm install @drincs/pixi-vn
```

也可以使用：`pnpm add @drincs/pixi-vn`、`yarn add @drincs/pixi-vn`、`bun add @drincs/pixi-vn`

## README

# Pixi'VN - PixiJS 游戏引擎

![pixi-vn-cover](https://github.com/user-attachments/assets/9bd54406-f41a-4d2c-959c-96a773a6103c)

[![npm version](https://img.shields.io/npm/v/@drincs/pixi-vn?label=version)](https://www.npmjs.com/package/@drincs/pixi-vn) [![npm downloads per month](https://img.shields.io/npm/dm/@drincs/pixi-vn)](https://www.npmjs.com/package/@drincs/pixi-vn) [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/@drincs/pixi-vn?logo=jsdeliver)](https://www.jsdelivr.com/package/npm/@drincs/pixi-vn) [![NPM License](https://img.shields.io/npm/l/@drincs/pixi-vn)](https://www.npmjs.com/package/@drincs/pixi-vn) [![Discord](https://img.shields.io/discord/1263071210011496501?color=7289da&label=discord)](https://discord.gg/E95FZWakzp)

Pixi的VN是一个非常多才多艺和强大的由故事驱动的引擎. 它基于 JavaScript/TypeScript 和 [皮克西杰斯语Name](https://pixijs.com/),并通过 [二维](https://esotericsoftware.com/) 财务报告和审定财务报表 [现场直播2D](https://www.live2d.com/)。 。 。 .

Pixi'VN的目标是成为一个创新而快的引擎,并大力强调AI辅助开发:一个AI代理可以启动你的游戏,通过它获得它需要的关于您项目的所有知识 [代理技能](https://npmcn.com/package/%40drincs/pixi-vn/#readme-agent-skills),并通过在浏览器中推出来测试游戏——在游戏播放时能够不断从外部驱动.

可以使用能够充分利用引擎特性的叙事语言,以及您为您的项目所添加的任何自定义特性. 目前得到支持的:

-   [_墨迹_](https://pixi-vn.com/ink/ink)

## 模板

为了快速启动,可以使用各种项目模板,用React构建. 经验较少的开发者可以在对JavaScript/TypeScript不甚了解的情况下使用这些模板.

-   **[视觉小说](https://pixi-vn.com/start/make-visual-novel)**:一种由对话驱动的经典体验,包含人物,背景,和选择.
-   **[点点并点击冒险](https://pixi-vn.com/nqtr/make-point-and-click)**:一款冒险游戏,玩家在其中探索场景并和物体和人物互动.
-   **[交互式虚构](https://pixi-vn.com/start/make-interactive-fiction)**感觉就像读了一本书 与视觉小说不同的是,图像被显示为vignettes,就像插图会出现在一页.

要从模板创建新项目, 请运行 :

```npm
npm create pixi-vn@latest
```

### 分发

Pixi ' VN独立于任何分销技术,但强调 [罗夫斯](https://roves.pixi-vn.com/)由Pixi'VN的同一支队伍建造.

| 平台 | [罗夫斯](https://roves.pixi-vn.com/) | [陶里语Name](https://v2.tauri.app/) | [电子](https://www.electronjs.org/) |
| --- | --- | --- | --- |
| 窗口 | ✅ | ✅ | ✅ |
| 马科斯 | ✅ | ✅ | ✅ |
| 链接 | ✅ | ✅ | ✅ |
| 机器人 | ✅ | ✅ | ❌ |
| iOS系统 | ✅ | ✅ | ❌ |
| 任天堂 | 🚧 | ❌ | ❌ |
| 游戏Station | 🚧 | ❌ | ❌ |
| Xbox 选项 | 🚧 | ❌ | ❌ |

## 维基

-   [快速启动](https://pixi-vn.com/start/getting-started)
    -   [模板](https://pixi-vn.com/start/templates)
-   特征 :
    -   [字符](https://pixi-vn.com/start/character)
    -   [叙述](https://pixi-vn.com/start/narration)
    -   [资产](https://pixi-vn.com/start/assets)
    -   [扫描仪 WebGL/WebGPU](https://pixi-vn.com/start/canvas)
    -   [声音和音乐](https://pixi-vn.com/start/sound)
    -   [存储](https://pixi-vn.com/start/storage)
    -   [用户界面( UI)](https://pixi-vn.com/start/interface)
    -   [迷你游戏](https://pixi-vn.com/start/minigames)
    -   [AI-Gened 内容](https://pixi-vn.com/start/ai-generated-content)
    -   [保存并装入](https://pixi-vn.com/start/save)
    -   [分发](https://pixi-vn.com/start/distribution)

## 先决条件

在开始前,您必须安装下列工具:

-   [节点.js](https://nodejs.org/) 20.19.0或更高版本.
-   有 TypeScript 支持的文本编辑器, 例如 :
    -   [视觉工作室代码](https://code.visualstudio.com/)
    -   [光标](https://www.cursor.com/)
    -   [V](https://vscodium.com/)

## 安装

要在现有 JavaScript 工程中安装 Pixi' VN 软件包, 请使用以下命令之一 :

```npm
npm install @drincs/pixi-vn
```

## 初始化

在使用 Pixi' VN 引擎之前, 您必须初始化游戏 。 你可以打给 `Game.init` 方法.

```ts
import { Game } from "@drincs/pixi-vn";

const body = document.body;
if (!body) {
  throw new Error("body element not found");
}

Game.init(body, {
  height: 1080,
  width: 1920,
  backgroundColor: "#303030",
}).then(() => {
  // ...
  Game.start("start", {});
});

// read more here: https://pixi-vn.com/start/other-narrative-features.html#how-manage-the-end-of-the-game
Game.onEnd(async (props) => {
  Game.clear();
  // navigate to main menu
});

Game.addOnError((error, props) => {
  console.error(`Error occurred`, error);
});

Game.onNavigate((path) => navigateTo(path));
```

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Game</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>
```

```css
html,
body {
  background-color: #242424;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}
```

## 代理技能

Pixi'VN号飞船 [代理技能](https://www.skills.sh/) 教AI编码助理如何正确使用引擎的每个部分.

> 在 LM Studio Bionic 中,请代理安装来自 `https://github.com/DRincs-Productions/pixi-vn`,或将技能文件添加到 **设置-技能**为 Codex 或 Claude 代码安装的再利用技能,启用 **设置 – 技能 – 使用其他应用程序中发现的技能**。 。 。 .

**代码**数字 :

```npm
npx skills@latest add DRincs-Productions/pixi-vn@latest --skill '*' --agent codex -g -y
```

**克劳德代码**数字 :

```npm
npx skills@latest add DRincs-Productions/pixi-vn@latest --skill '*' --agent claude-code -g -y
```

**其他代理人**数字 :

```npm
npx skills@latest add DRincs-Productions/pixi-vn@latest --all -y
```

现有技能:

-   `pixi-vn` - 技能集的索引/输入点:技能图、安装软件包和初始化 `Game`
-   `pixi-vn-assets` 本地资产与在线资产、清单/分册/别名系统以及装载战略
-   `pixi-vn-canvas` ——图像,图示,文本,视频,过渡和效果
-   `pixi-vn-characters` ——字符定义和登记
-   `pixi-vn-history` ——回放/倒放并读取"叙事"积压情况
-   `pixi-vn-narration` 标签、对话和选择
-   `pixi-vn-saves` ——导出/恢复游戏状态并持续保存文件
-   `pixi-vn-sound` ——音乐,音效和声道
-   `pixi-vn-storage` – 游戏变量,旗帜和存储类
-   `pixi-vn-testing` ——通过AI代理或脚本驱动/检查正在运行的游戏 `Game.testing`,用于自动播放测试
-   `pixi-vn-ui` 将 HTML/PixiJS UI 层安装在画布上,屏幕导航,主题,连接UI到存储
-   `pixi-vn-migration` 将一个现有项目升级为当前版本

## 常见问题

### @drincs/pixi-vn 是什么？

Pixi'VN是一个非常多能和强大的游戏/故事驱动引擎\.

### 如何安装 @drincs/pixi-vn？

在项目目录运行 npm install @drincs/pixi-vn，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：tone（\>=15\.1\.0）、motion（\>=12\.38\.0）、pixi\.js（\>=8\.17\.0）、pixi-filters（\>=6\.1\.0）、@pixi/devtools（\>=2\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @drincs/pixi-vn 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @drincs/pixi-vn 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @drincs/pixi-vn 可以商用吗？

@drincs/pixi-vn 使用 LGPL-2\.1 许可。弱 Copyleft：作为库被调用时通常不要求开源你自己的代码，但修改库本身需以 LGPL 开源；前端打包合并后的适用边界存在不同理解。以上为概括，不构成法律意见，请以许可原文为准。

### @drincs/pixi-vn 的下载量有多少？

根据 npm 官方下载统计，@drincs/pixi-vn 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,647 次，日均约 88 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @drincs/pixi-vn 还在维护吗？

最新版本 1\.9\.9 发布于 2026/11/06（7 天前）；至今共发布 264 个版本，其中过去 12 个月发布了 85 个；首次发布于 2024/03/21。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

