@drincs/pixi-vn-json 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,71 +12,82 @@
12
12
 
13
13
  Pixi’VN can be integrated with JSON files to create a visual novel. This method is useful for:
14
14
 
15
- * 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))
15
+ * Add a new narrative to Pixi’VN (It was used to create the integration with <DynamicLink href="/ink">***ink***</DynamicLink> and <DynamicLink href="/renpy">Ren'Py</DynamicLink>)
16
16
  * Create a external tool to create visual novels with Pixi’VN
17
17
 
18
18
  ( In both these cases it is advisable to notify the developers of Pixi’VN to add the new feature to be helped )
19
19
 
20
- ![Pixi’VN + Json Integration](https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2FPixiVNJson.png?alt=media)
20
+ ```mermaid
21
+ flowchart LR;
22
+ K[RenPy] ---> Json;
23
+ H[ink] ---> Json;
24
+ I[Twine] ---> Json;
25
+ J[Yarn Spinner] ---> Json;
26
+ Json["Pixi’VN + Json"] ===> PixiVN;
27
+ PixiVN["Pixi’VN"]
28
+ ```
21
29
 
22
30
  ## How use Pixi’VN + Json?
23
31
 
24
32
  First of all you need to install the following library:
25
33
 
26
- ```bash
27
- # npm
34
+ ```sh tab="npm"
28
35
  npm install @drincs/pixi-vn-json
36
+ ```
29
37
 
30
- # yarn
38
+ ```sh tab="yarn"
31
39
  yarn add @drincs/pixi-vn-json
40
+ ```
32
41
 
33
- # pnpm
42
+ ```sh tab="pnpm"
34
43
  pnpm add @drincs/pixi-vn-json
44
+ ```
35
45
 
36
- # bun
46
+ ```sh tab="bun"
37
47
  bun add @drincs/pixi-vn-json
38
48
  ```
39
49
 
40
- All you need to do to use this integration is create a object using the [`PixiVNJson` Model](#pixivnjson-model) and use the `importPixiVNJson()` function to import the object.
41
-
42
- ```typescript
43
- import { PixiVNJson, importPixiVNJson} from '@drincs/pixi-vn-json';
50
+ All you need to do to use this integration is create a object using the <DynamicLink href="/json/PixiVNJson">`PixiVNJson` Model</DynamicLink> and use the `importPixiVNJson()` function to import the object.
44
51
 
45
- let obj: PixiVNJson = {
46
- labels: {
47
- back_in_london: [
52
+ ```ts title="labels.json"
53
+ {
54
+ "$schema": "https://pixi-vn.web.app/schemas/latest/schema.json",
55
+ "labels": {
56
+ "back_in_london": [
48
57
  {
49
- dialogue: "We arrived into London at 9.45pm exactly.",
58
+ "dialogue": "We arrived into London at 9.45pm exactly.",
50
59
  },
51
60
  {
52
- labelToOpen: {
53
- label: "hurry_home",
54
- type: "jump",
61
+ "labelToOpen": {
62
+ "label": "hurry_home",
63
+ "type": "jump",
55
64
  },
56
65
  },
57
66
  ],
58
- hurry_home: [
67
+ "hurry_home": [
59
68
  {
60
- dialogue: "We hurried home to Savile Row as fast as we could.",
69
+ "dialogue": "We hurried home to Savile Row as fast as we could.",
61
70
  },
62
71
  {
63
- end: "label_end",
72
+ "end": "label_end",
64
73
  },
65
74
  ]
66
75
  }
67
76
  }
68
-
69
- importPixiVNJson(obj);
70
77
  ```
71
78
 
72
- 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).
79
+ ```ts title="main.ts"
80
+ import { PixiVNJson, importPixiVNJson} from '@drincs/pixi-vn-json';
81
+ import json from "./labels.json";
73
82
 
74
- ```typescript
75
- narration.callLabel(`back_in_london`, {})
83
+ importPixiVNJson(json);
76
84
  ```
77
85
 
78
- ## PixiVNJson Model
86
+ After that you can run the `back_in_london` label with <DynamicLink href="/start/labels#run-a-label">Pixi’VN functions</DynamicLink>.
79
87
 
80
- 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.
88
+ ```ts title="main.ts"
89
+ import { narration } from '@drincs/pixi-vn'
90
+
91
+ narration.call(`back_in_london`, {})
92
+ ```
81
93
 
82
- Now `PixiVNJson` is currently in continuous change, more documentation will be written in the future.