@drincs/pixi-vn 1.6.4 → 1.8.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 +47 -53
- package/dist/{HistoryChoiceMenuOption-DM4wqiGt.d.ts → HistoryChoiceMenuOption-BP9Tsbyd.d.ts} +1 -2
- package/dist/{HistoryChoiceMenuOption-iazqoVVm.d.cts → HistoryChoiceMenuOption-DSSNUXEq.d.cts} +1 -2
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +56 -51
- package/dist/canvas.d.ts +56 -51
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-L4IHQ3VT.mjs → chunk-3SLELYPF.mjs} +1 -1
- package/dist/chunk-6HI66YQL.mjs +1 -0
- package/dist/chunk-XYO5SLSM.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -9
- package/dist/index.d.cts +289 -114
- package/dist/index.d.ts +289 -114
- package/dist/index.mjs +2 -9
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +3 -1
- package/dist/motion.d.ts +3 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +3 -3
- package/dist/narration.d.ts +3 -3
- package/dist/narration.mjs +2 -2
- package/dist/pixi/browser.js +183 -171
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +337 -132
- package/dist/sound.d.ts +337 -132
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +63 -12
- package/dist/storage.d.ts +63 -12
- package/dist/storage.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +10 -1
- package/dist/vite.d.ts +10 -1
- package/dist/vite.mjs +1 -1
- package/package.json +21 -13
- package/dist/chunk-D45QSSXG.mjs +0 -1
- package/dist/chunk-EWW7VYPM.mjs +0 -1
- package/dist/chunk-ZW3MIPMS.mjs +0 -1
- /package/dist/{chunk-XSN6P5JL.mjs → chunk-JMOSOAGB.mjs} +0 -0
package/README.md
CHANGED
|
@@ -10,55 +10,54 @@
|
|
|
10
10
|
<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>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
-
|
|
14
13
|
Pixi’VN is a very versatile and powerful 2D game engine. It is based on JavaScript/TypeScript and [PixiJS](https://pixijs.com/).
|
|
15
14
|
|
|
16
15
|
It provides the following features:
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
- narrative management
|
|
18
|
+
- provides a 2D canvas
|
|
19
|
+
- providing functionality to play sounds and music
|
|
20
|
+
- storage to set and get game variables.
|
|
21
|
+
- saves the current state of the entire game at each "story step" giving the possibility to go back
|
|
22
|
+
- functionality to save and load the current state of the game.
|
|
24
23
|
|
|
25
24
|
For a quick start, various [project templates](#project-initialization) are available. Less experienced developers can use these templates without much knowledge of JavaScript/TypeScript.
|
|
26
25
|
|
|
27
26
|
You have the option to use various types of narrative languages (in addition to JavaScript/TypeScript). Currently you can use the following:
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
- [_ink_](https://pixi-vn.web.app/ink/ink)
|
|
29
|
+
- [Ren'Py](https://pixi-vn.web.app/renpy/renpy)
|
|
31
30
|
|
|
32
31
|
Pixi’VN does not provide built-in components to create the game UI. Instead, you should use external JavaScript frameworks to build your UI. This allows you to leverage systems such as React, Vue, etc., to create complex and high-performance **UI screens**.
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
- [React](https://pixi-vn.web.app/start/interface-react)
|
|
34
|
+
- [Vue](https://pixi-vn.web.app/start/interface-vue)
|
|
35
|
+
- [PixiJS](https://pixi-vn.web.app/start/interface-pixijs)
|
|
37
36
|
|
|
38
37
|
## Wiki
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
- [Why Pixi’VN?](https://pixi-vn.web.app/start/why)
|
|
40
|
+
- [Ren'Py vs Pixi’VN](https://pixi-vn.web.app/start/versus-renpy)
|
|
41
|
+
- [Quick Start](https://pixi-vn.web.app/start/getting-started)
|
|
42
|
+
- [Templates](https://pixi-vn.web.app/start/templates)
|
|
43
|
+
- Make your first:
|
|
44
|
+
- [Visual Novel](https://pixi-vn.web.app/start/make-visual-novel)
|
|
45
|
+
- [Point & Click Adventure](https://pixi-vn.web.app/nqtr/make-point-and-click)
|
|
46
|
+
- [RPG game](https://pixi-vn.web.app/start/make-rpg)
|
|
47
|
+
- [IDE or graphical editor](https://pixi-vn.web.app/start/make-ide)
|
|
48
|
+
- [Game engine](https://pixi-vn.web.app/start/make-game-engine)
|
|
50
49
|
|
|
51
50
|
## Prerequisites
|
|
52
51
|
|
|
53
52
|
Before starting, you must have the following tools installed:
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
- [Node.js](https://nodejs.org/) version 18 or higher.
|
|
55
|
+
- Text editor with TypeScript support, such as:
|
|
56
|
+
- [Visual Studio Code](https://code.visualstudio.com/)
|
|
57
|
+
- [Cursor](https://www.cursor.com/)
|
|
58
|
+
- [VSCodium](https://vscodium.com/)
|
|
59
|
+
- (Recommended) [Git](https://git-scm.com/)
|
|
60
|
+
- A [GitHub account](https://github.com/)
|
|
62
61
|
|
|
63
62
|
## Project Initialization
|
|
64
63
|
|
|
@@ -114,39 +113,40 @@ Before using the Pixi’VN engine, you must initialize the game. You can do this
|
|
|
114
113
|
|
|
115
114
|
This function has the following parameters:
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
- `element`: The HTML element to append the canvas to.
|
|
117
|
+
- `options`: Equivalent to the options you can use when initializing a [PixiJS Application](https://pixijs.com/8.x/guides/basics/getting-started#creating-an-application). The following options are mandatory:
|
|
118
|
+
- `width`: The width of the canvas.
|
|
119
|
+
- `height`: The height of the canvas.
|
|
120
|
+
- `devtoolsOptions`: Equivalent to the options you can use when initializing the [PixiJS Devtools](https://pixi-vn.web.app/it/start/canvas#use-pixijs-devtools-with-pixivn).
|
|
122
121
|
|
|
123
122
|
```ts title="src/main.tsx"
|
|
124
123
|
import { Game } from "@drincs/pixi-vn";
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
const body = document.body
|
|
125
|
+
const body = document.body;
|
|
128
126
|
if (!body) {
|
|
129
|
-
|
|
127
|
+
throw new Error("body element not found");
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
Game.init(body, {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
resizeMode: "contain",
|
|
131
|
+
height: 1080,
|
|
132
|
+
width: 1920,
|
|
133
|
+
backgroundColor: "#303030",
|
|
137
134
|
}).then(() => {
|
|
138
|
-
|
|
135
|
+
// ...
|
|
136
|
+
Game.start("start", {});
|
|
139
137
|
});
|
|
140
138
|
|
|
141
139
|
// read more here: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game
|
|
142
140
|
Game.onEnd(async (props) => {
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
Game.clear();
|
|
142
|
+
// navigate to main menu
|
|
145
143
|
});
|
|
146
144
|
|
|
147
|
-
Game.
|
|
148
|
-
|
|
145
|
+
Game.addOnError((error, props) => {
|
|
146
|
+
console.error(`Error occurred`, error);
|
|
149
147
|
});
|
|
148
|
+
|
|
149
|
+
Game.onNavigate((path) => navigateTo(path));
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
```html title="index.html"
|
|
@@ -165,12 +165,9 @@ Game.onError((type, error, { notify }) => {
|
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
```css title="styles.css"
|
|
168
|
-
:root {
|
|
169
|
-
background-color: #242424;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
168
|
html,
|
|
173
169
|
body {
|
|
170
|
+
background-color: #242424;
|
|
174
171
|
height: 100%;
|
|
175
172
|
}
|
|
176
173
|
|
|
@@ -182,6 +179,3 @@ body {
|
|
|
182
179
|
}
|
|
183
180
|
```
|
|
184
181
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
package/dist/{HistoryChoiceMenuOption-DM4wqiGt.d.ts → HistoryChoiceMenuOption-BP9Tsbyd.d.ts}
RENAMED
|
@@ -3,7 +3,6 @@ import { Difference } from 'microdiff';
|
|
|
3
3
|
import { a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
|
-
declare const Close: CloseType;
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* is a string containing the name of the label.
|
|
@@ -180,4 +179,4 @@ type HistoryChoiceMenuOption = {
|
|
|
180
179
|
hidden: boolean;
|
|
181
180
|
};
|
|
182
181
|
|
|
183
|
-
export {
|
|
182
|
+
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryStep as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelType as S, LabelRunModeType as a, CloseChoiceOptionInterface as b, CloseType as c, StepLabelPropsType as d, StepLabelResultType as e, StoredIndexedChoiceInterface as f, StoredChoiceInterface as g, HistoryChoiceMenuOption as h };
|
package/dist/{HistoryChoiceMenuOption-iazqoVVm.d.cts → HistoryChoiceMenuOption-DSSNUXEq.d.cts}
RENAMED
|
@@ -3,7 +3,6 @@ import { Difference } from 'microdiff';
|
|
|
3
3
|
import { a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
|
-
declare const Close: CloseType;
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* is a string containing the name of the label.
|
|
@@ -180,4 +179,4 @@ type HistoryChoiceMenuOption = {
|
|
|
180
179
|
hidden: boolean;
|
|
181
180
|
};
|
|
182
181
|
|
|
183
|
-
export {
|
|
182
|
+
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryStep as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelType as S, LabelRunModeType as a, CloseChoiceOptionInterface as b, CloseType as c, StepLabelPropsType as d, StepLabelResultType as e, StoredIndexedChoiceInterface as f, StoredChoiceInterface as g, HistoryChoiceMenuOption as h };
|