# Pixi’VN - Ink Language Integration (/pixi-vn-ink)



![pixi-vn-cover-ink](https://github.com/user-attachments/assets/25599899-36b9-4b96-b5c1-9c99e335c3f7)

<p align="center">
  <a href="https://www.npmjs.com/package/@drincs/pixi-vn-ink" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/v/@drincs/pixi-vn-ink?label=version" alt="npm version" /></a>
  <a href="https://www.npmjs.com/package/@drincs/pixi-vn-ink" rel="noopener noreferrer nofollow"><img src="https://img.shields.io/npm/dm/@drincs/pixi-vn-ink" alt="npm downloads per month" /></a>
  <a target="_blank" href="https://www.jsdelivr.com/package/npm/@drincs/pixi-vn-ink" rel="noopener noreferrer nofollow"><img alt="jsDelivr hits (npm)" src="https://img.shields.io/jsdelivr/npm/hm/@drincs/pixi-vn-ink?logo=jsdeliver" /></a>
  <a href="https://www.npmjs.com/package/@drincs/pixi-vn-ink" rel="noopener noreferrer nofollow"><img alt="NPM License" src="https://img.shields.io/npm/l/@drincs/pixi-vn-ink" /></a>
  <a target="_blank" href="https://discord.gg/E95FZWakzp" rel="noopener noreferrer nofollow"><img alt="Discord" src="https://img.shields.io/discord/1263071210011496501?color=7289da&label=discord" /></a>
</p>

Pixi’VN gives you the ability to write your own narrative using **_ink_**, a scripting language for writing interactive narrative.

The ***ink* + Pixi’VN integration**, exploits the [inkjs](https://github.com/inkle/inkjs) and [PixiVNJson](https://github.com/DRincs-Productions/pixi-vn-json) libraries, to parse ***ink* code** and generate a Json that can be interpreted by Pixi’VN. So Javascript/Typescript and **_ink_** share the same storage and canvas, and it is also possible to launch **_ink_** labels (or knots) from Javascript/Typescript and vice versa. This allows you to use the best of both languages. You can use **_ink_** to write the narration, while using Javascript/Typescript to create minigames or complex animations.

**What is *ink*?**

**_ink_** is a scripting language for writing interactive narrative. It is used in games like 80 Days, Heaven's Vault, and Sorcery! to create branching stories.

This language is very simple to learn. Go on [*ink* website](https://www.inklestudios.com/ink/) to learn more about it.

## Why use *ink* integration? [#why-use-ink-integration]

Programming a game narrative in **Javascript/Typescript** has the advantage of having total development freedom, but the disadvantage is that it slows down the writing of a narrative (it makes you write a lot of code).

## Installation [#installation]

To install the package, run the following command in your project:

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npm install @drincs/pixi-vn-ink
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm add @drincs/pixi-vn-ink
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn add @drincs/pixi-vn-ink
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun add @drincs/pixi-vn-ink
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Start using *ink* in Pixi’VN [#start-using-ink-in-pixivn]

If you have not created a project yet then it is recommended to use the [template](https://pixi-vn.com/start/getting-started.html#project-initialization) to start your project with **_ink_**.

After installing the package you need to use the `importInkText()` function to import the ***ink* script** into your project.

```ts title="main.ts"
import { narration } from "@drincs/pixi-vn";
import { importInkText } from '@drincs/pixi-vn-ink'

importInkText([inkText, ...])
narration.callLabel(`start`, {});
```

```ink title="ink/story.ink"
=== start ===
Hello, world!
-> END
```

<CodeBlockTabs defaultValue="ink.d.ts">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="ink.d.ts">
      ink.d.ts
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="ink.d.ts">
    ```ts
    declare module "*.ink" {
      const value: string;
      export default value;
    }
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Agent Skills [#agent-skills]

This package ships a set of [Agent Skills](https://www.skills.sh/) that teach AI coding assistants
(like Claude Code) the full **ink** language plus every Pixi'VN-specific integration detail (hashtag
commands, `importInkText`, storage mapping, and every deliberate difference from native ink). Unlike
`@drincs/pixi-vn`'s skill set, where each skill can be installed independently, these are meant to
travel together — install all of them at once with:

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx skills add DRincs-Productions/pixi-vn-ink --all
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx skills add DRincs-Productions/pixi-vn-ink --all
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx skills add DRincs-Productions/pixi-vn-ink --all
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x skills add DRincs-Productions/pixi-vn-ink --all
    ```
  </CodeBlockTab>
</CodeBlockTabs>

This installs every skill below:

* `getting-started` — installation, the Vite plugin, dev-server debugging, translation files, and core ink syntax as used in Pixi'VN
* `characters` — dialogue attribution, name substitution, emotions
* `input` — `# request input` prompts
* `pause-continue` — `# pause` and `<># continue`
* `markup` — Markdown/HTML/CSS in dialogue text
* `canvas` — every canvas hashtag command
* `sound` — every sound hashtag command
* `assets` — `# load`/`# lazyload`
* `text-replacement` — `[key]` substitution
* `hashtag-commands` — writing a custom hashtag command instead of an ink function
* `migration` — upgrading an existing project to the current version
