LogoPixi’VN

Ink Language Integration

pixi-vn-cover-ink

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 and PixiVNJson 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 to learn more about it.

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

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

npm install @drincs/pixi-vn-ink

Start using ink in Pixi’VN

If you have not created a project yet then it is recommended to use the template 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.

import { narration } from "@drincs/pixi-vn";
import { importInkText } from '@drincs/pixi-vn-ink'

importInkText([inkText, ...])
narration.callLabel(`start`, {});
=== start ===
Hello, world!
-> END
declare module "*.ink" {
  const value: string;
  export default value;
}

On this page