@drincs/pixi-vn 1.8.1 → 1.8.3
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 +14 -58
- package/dist/{HistoryChoiceMenuOption-BP9Tsbyd.d.ts → HistoryChoiceMenuOption-CS41KG13.d.ts} +2 -2
- package/dist/{HistoryChoiceMenuOption-DSSNUXEq.d.cts → HistoryChoiceMenuOption-DdwePsOm.d.cts} +2 -2
- package/dist/{StorageElementType-DkJ394kq.d.cts → StorageElementType-C7ETezlL.d.cts} +1 -1
- package/dist/{StorageElementType-DkJ394kq.d.ts → StorageElementType-C7ETezlL.d.ts} +1 -1
- package/dist/{StoredClassModel-a4pvgJXD.d.ts → StoredClassModel-C9mQxPg-.d.cts} +9 -6
- package/dist/{StoredClassModel-LtyakzOw.d.cts → StoredClassModel-upXPNQTp.d.ts} +9 -6
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.mjs +1 -1
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +55 -51
- package/dist/characters.d.ts +55 -51
- package/dist/characters.mjs +1 -1
- package/dist/chunk-K7JIC2F2.mjs +1 -0
- package/dist/{chunk-36I5IN5S.mjs → chunk-V34PMA2H.mjs} +1 -1
- package/dist/history.d.cts +2 -2
- package/dist/history.d.ts +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +21 -6
- package/dist/index.d.ts +21 -6
- package/dist/index.mjs +2 -2
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +41 -10
- package/dist/narration.d.ts +41 -10
- package/dist/narration.mjs +2 -2
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +3 -3
- package/dist/storage.d.ts +3 -3
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.cjs +1 -1
- package/dist/vite-listener.d.cts +13 -4
- package/dist/vite-listener.d.ts +13 -4
- package/dist/vite-listener.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +66 -36
- package/dist/vite.d.ts +66 -36
- package/dist/vite.mjs +1 -1
- package/package.json +15 -7
- package/dist/chunk-TTRUPDAB.mjs +0 -1
package/README.md
CHANGED
|
@@ -25,27 +25,22 @@ For a quick start, various [project templates](#project-initialization) are avai
|
|
|
25
25
|
|
|
26
26
|
You have the option to use various types of narrative languages (in addition to JavaScript/TypeScript). Currently you can use the following:
|
|
27
27
|
|
|
28
|
-
- [_ink_](https://pixi-vn.
|
|
29
|
-
- [Ren'Py](https://pixi-vn.web.app/renpy/renpy)
|
|
28
|
+
- [_ink_](https://pixi-vn.com/ink/ink)
|
|
30
29
|
|
|
31
30
|
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**.
|
|
32
31
|
|
|
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)
|
|
36
|
-
|
|
37
32
|
## Wiki
|
|
38
33
|
|
|
39
|
-
- [Why Pixi’VN?](https://pixi-vn.
|
|
40
|
-
- [Ren'Py vs Pixi’VN](https://pixi-vn.
|
|
41
|
-
- [Quick Start](https://pixi-vn.
|
|
42
|
-
- [Templates](https://pixi-vn.
|
|
34
|
+
- [Why Pixi’VN?](https://pixi-vn.com/start/why)
|
|
35
|
+
- [Ren'Py vs Pixi’VN](https://pixi-vn.com/start/versus-renpy)
|
|
36
|
+
- [Quick Start](https://pixi-vn.com/start/getting-started)
|
|
37
|
+
- [Templates](https://pixi-vn.com/start/templates)
|
|
43
38
|
- Make your first:
|
|
44
|
-
- [Visual Novel](https://pixi-vn.
|
|
45
|
-
- [Point & Click Adventure](https://pixi-vn.
|
|
46
|
-
- [RPG game](https://pixi-vn.
|
|
47
|
-
- [IDE or graphical editor](https://pixi-vn.
|
|
48
|
-
- [Game engine](https://pixi-vn.
|
|
39
|
+
- [Visual Novel](https://pixi-vn.com/start/make-visual-novel)
|
|
40
|
+
- [Point & Click Adventure](https://pixi-vn.com/nqtr/make-point-and-click)
|
|
41
|
+
- [RPG game](https://pixi-vn.com/start/make-rpg)
|
|
42
|
+
- [IDE or graphical editor](https://pixi-vn.com/start/make-ide)
|
|
43
|
+
- [Game engine](https://pixi-vn.com/start/make-game-engine)
|
|
49
44
|
|
|
50
45
|
## Prerequisites
|
|
51
46
|
|
|
@@ -56,69 +51,31 @@ Before starting, you must have the following tools installed:
|
|
|
56
51
|
- [Visual Studio Code](https://code.visualstudio.com/)
|
|
57
52
|
- [Cursor](https://www.cursor.com/)
|
|
58
53
|
- [VSCodium](https://vscodium.com/)
|
|
59
|
-
- (Recommended) [Git](https://git-scm.com/)
|
|
60
|
-
- A [GitHub account](https://github.com/)
|
|
61
54
|
|
|
62
55
|
## Project Initialization
|
|
63
56
|
|
|
64
57
|
If you want to start from a new project, you can use the following command to initialize a new project with the Pixi’VN templates:
|
|
65
58
|
|
|
66
|
-
```
|
|
67
|
-
# npm
|
|
59
|
+
```npm
|
|
68
60
|
npm create pixi-vn@latest
|
|
69
|
-
|
|
70
|
-
# yarn
|
|
71
|
-
yarn create pixi-vn
|
|
72
|
-
|
|
73
|
-
# pnpm
|
|
74
|
-
pnpm create pixi-vn
|
|
75
|
-
|
|
76
|
-
# bun
|
|
77
|
-
bun create pixi-vn
|
|
78
|
-
|
|
79
|
-
# deno
|
|
80
|
-
deno init --npm pixi-vn
|
|
81
61
|
```
|
|
82
62
|
|
|
83
|
-
You can see the list of available templates and interactive demos
|
|
63
|
+
You can see the list of available templates and interactive demos <DynamicLink href="/start/templates">here</DynamicLink>.
|
|
84
64
|
|
|
85
65
|
After the project is initialized, open the project directory with your text editor (VSCode is recommended) and start developing your project.
|
|
86
66
|
|
|
87
|
-
All templates include a `README.md` file with more information about the project.
|
|
88
|
-
|
|
89
67
|
## Installation
|
|
90
68
|
|
|
91
69
|
To install the Pixi’VN package in an existing JavaScript project, use one of the following commands:
|
|
92
70
|
|
|
93
|
-
```
|
|
94
|
-
# npm
|
|
71
|
+
```npm
|
|
95
72
|
npm install @drincs/pixi-vn
|
|
96
|
-
|
|
97
|
-
# yarn
|
|
98
|
-
yarn add @drincs/pixi-vn
|
|
99
|
-
|
|
100
|
-
# pnpm
|
|
101
|
-
pnpm add @drincs/pixi-vn
|
|
102
|
-
|
|
103
|
-
# bun
|
|
104
|
-
bun add @drincs/pixi-vn
|
|
105
|
-
|
|
106
|
-
# deno
|
|
107
|
-
deno install npm:@drincs/pixi-vn
|
|
108
73
|
```
|
|
109
74
|
|
|
110
75
|
## Initialize
|
|
111
76
|
|
|
112
77
|
Before using the Pixi’VN engine, you must initialize the game. You can do this by calling the `Game.init` method.
|
|
113
78
|
|
|
114
|
-
This function has the following parameters:
|
|
115
|
-
|
|
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).
|
|
121
|
-
|
|
122
79
|
```ts title="src/main.tsx"
|
|
123
80
|
import { Game } from "@drincs/pixi-vn";
|
|
124
81
|
|
|
@@ -136,7 +93,7 @@ Game.init(body, {
|
|
|
136
93
|
Game.start("start", {});
|
|
137
94
|
});
|
|
138
95
|
|
|
139
|
-
// read more here: https://pixi-vn.
|
|
96
|
+
// read more here: https://pixi-vn.com/start/other-narrative-features.html#how-manage-the-end-of-the-game
|
|
140
97
|
Game.onEnd(async (props) => {
|
|
141
98
|
Game.clear();
|
|
142
99
|
// navigate to main menu
|
|
@@ -178,4 +135,3 @@ body {
|
|
|
178
135
|
overflow: hidden;
|
|
179
136
|
}
|
|
180
137
|
```
|
|
181
|
-
|
package/dist/{HistoryChoiceMenuOption-BP9Tsbyd.d.ts → HistoryChoiceMenuOption-CS41KG13.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
|
-
import {
|
|
3
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
6
|
|
|
@@ -179,4 +179,4 @@ type HistoryChoiceMenuOption = {
|
|
|
179
179
|
hidden: boolean;
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
export type { ChoiceOptionInterface as C, DialogueInterface as D,
|
|
182
|
+
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryChoiceMenuOption as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelPropsType as S, CloseChoiceOptionInterface as a, CloseType as b, HistoryStep as c, LabelRunModeType as d, StepLabelResultType as e, StepLabelType as f, StoredChoiceInterface as g, StoredIndexedChoiceInterface as h };
|
package/dist/{HistoryChoiceMenuOption-DSSNUXEq.d.cts → HistoryChoiceMenuOption-DdwePsOm.d.cts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChoiceInterface, StepLabelProps, StepLabelResult, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
|
-
import {
|
|
3
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
4
4
|
|
|
5
5
|
type CloseType = "close";
|
|
6
6
|
|
|
@@ -179,4 +179,4 @@ type HistoryChoiceMenuOption = {
|
|
|
179
179
|
hidden: boolean;
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
export type { ChoiceOptionInterface as C, DialogueInterface as D,
|
|
182
|
+
export type { ChoiceOptionInterface as C, DialogueInterface as D, HistoryChoiceMenuOption as H, LabelIdType as L, NarrationHistory as N, OpenedLabel as O, StepLabelPropsType as S, CloseChoiceOptionInterface as a, CloseType as b, HistoryStep as c, LabelRunModeType as d, StepLabelResultType as e, StepLabelType as f, StoredChoiceInterface as g, StoredIndexedChoiceInterface as h };
|
|
@@ -16,4 +16,4 @@ type StorageElementType = StorageElementInternalType | Record<string | number |
|
|
|
16
16
|
*/
|
|
17
17
|
type StorageObjectType = Record<string | number | symbol, StorageElementType>;
|
|
18
18
|
|
|
19
|
-
export type {
|
|
19
|
+
export type { StorageElementType as S, StorageObjectType as a };
|
|
@@ -16,4 +16,4 @@ type StorageElementType = StorageElementInternalType | Record<string | number |
|
|
|
16
16
|
*/
|
|
17
17
|
type StorageObjectType = Record<string | number | symbol, StorageElementType>;
|
|
18
18
|
|
|
19
|
-
export type {
|
|
19
|
+
export type { StorageElementType as S, StorageObjectType as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* StoredClassModel is a abstract class that contains the methods to store a class in the game.
|
|
@@ -11,19 +11,19 @@ import { a as StorageElementType } from './StorageElementType-DkJ394kq.js';
|
|
|
11
11
|
* this.defaultName = props.name
|
|
12
12
|
* this.defaultSurname = props.surname
|
|
13
13
|
* }
|
|
14
|
-
*
|
|
14
|
+
* readonly defaultName: string = ""
|
|
15
15
|
* get name(): string {
|
|
16
16
|
* return this.getStorageProperty<string>("name") || this.defaultName
|
|
17
17
|
* }
|
|
18
18
|
* set name(value: string) {
|
|
19
|
-
* this.setStorageProperty
|
|
19
|
+
* this.setStorageProperty("name", value)
|
|
20
20
|
* }
|
|
21
|
-
*
|
|
21
|
+
* readonly defaultSurname?: string
|
|
22
22
|
* get surname(): string | undefined {
|
|
23
23
|
* return this.getStorageProperty<string>("surname") || this.defaultSurname
|
|
24
24
|
* }
|
|
25
25
|
* set surname(value: string | undefined) {
|
|
26
|
-
* this.setStorageProperty
|
|
26
|
+
* this.setStorageProperty("surname", value)
|
|
27
27
|
* }
|
|
28
28
|
* }
|
|
29
29
|
* ```
|
|
@@ -41,7 +41,10 @@ declare class StoredClassModel {
|
|
|
41
41
|
readonly id: string;
|
|
42
42
|
private categoryId;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Update a property in the storage.
|
|
45
|
+
* @param propertyName The name of the property to set.
|
|
46
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
47
|
+
* @template T The type of the value to set. (Deprecated, it is not necessary to specify the type of the value, it will be inferred from the value)
|
|
45
48
|
*/
|
|
46
49
|
protected setStorageProperty<T>(propertyName: string, value: StorageElementType): void;
|
|
47
50
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* StoredClassModel is a abstract class that contains the methods to store a class in the game.
|
|
@@ -11,19 +11,19 @@ import { a as StorageElementType } from './StorageElementType-DkJ394kq.cjs';
|
|
|
11
11
|
* this.defaultName = props.name
|
|
12
12
|
* this.defaultSurname = props.surname
|
|
13
13
|
* }
|
|
14
|
-
*
|
|
14
|
+
* readonly defaultName: string = ""
|
|
15
15
|
* get name(): string {
|
|
16
16
|
* return this.getStorageProperty<string>("name") || this.defaultName
|
|
17
17
|
* }
|
|
18
18
|
* set name(value: string) {
|
|
19
|
-
* this.setStorageProperty
|
|
19
|
+
* this.setStorageProperty("name", value)
|
|
20
20
|
* }
|
|
21
|
-
*
|
|
21
|
+
* readonly defaultSurname?: string
|
|
22
22
|
* get surname(): string | undefined {
|
|
23
23
|
* return this.getStorageProperty<string>("surname") || this.defaultSurname
|
|
24
24
|
* }
|
|
25
25
|
* set surname(value: string | undefined) {
|
|
26
|
-
* this.setStorageProperty
|
|
26
|
+
* this.setStorageProperty("surname", value)
|
|
27
27
|
* }
|
|
28
28
|
* }
|
|
29
29
|
* ```
|
|
@@ -41,7 +41,10 @@ declare class StoredClassModel {
|
|
|
41
41
|
readonly id: string;
|
|
42
42
|
private categoryId;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Update a property in the storage.
|
|
45
|
+
* @param propertyName The name of the property to set.
|
|
46
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
47
|
+
* @template T The type of the value to set. (Deprecated, it is not necessary to specify the type of the value, it will be inferred from the value)
|
|
45
48
|
*/
|
|
46
49
|
protected setStorageProperty<T>(propertyName: string, value: StorageElementType): void;
|
|
47
50
|
/**
|