@drincs/pixi-vn-json
Version:
Pixi'VN can be integrated with JSON files to create a visual novel.
75 lines (54 loc) • 2.28 kB
Markdown

Pixi’VN can be integrated with JSON files to create a visual novel. This method is useful for:
* Add a new narrative to Pixi’VN (It was used to create the integration with [Ink](https://pixi-vn.web.app/ink/ink.html) and [Ren'Py](https://pixi-vn.web.app/renpy/renpy.html))
* Create a external tool to create visual novels with Pixi’VN
( In both these cases it is advisable to notify the developers of Pixi’VN to add the new feature to be helped )

First of all you need to install the following library:
```bash
npm install @drincs/pixi-vn-json
yarn add @drincs/pixi-vn-json
pnpm add @drincs/pixi-vn-json
bun add @drincs/pixi-vn-json
```
All you need to do to use this integration is create a object using the [`PixiVNJson` Model](
```typescript
import { PixiVNJson, importPixiVNJson} from '@drincs/pixi-vn-json';
let obj: PixiVNJson = {
labels: {
back_in_london: [
{
dialogue: "We arrived into London at 9.45pm exactly.",
},
{
labelToOpen: {
label: "hurry_home",
type: "jump",
},
},
],
hurry_home: [
{
dialogue: "We hurried home to Savile Row as fast as we could.",
},
{
end: "label_end",
},
]
}
}
importPixiVNJson(obj);
```
After that you can run the `back_in_london` label with [Pixi’VN functions](https://pixi-vn.web.app/start/labels.html#run-a-label).
```typescript
narration.callLabel(`back_in_london`, {})
```
You can see the `PixiVNJson` model in the [PixiVNJson.ts](https://github.com/DRincs-Productions/pixi-vn-json/blob/main/src/interface/PixiVNJson.ts) file.
Now `PixiVNJson` is currently in continuous change, more documentation will be written in the future.