@drincs/pixi-vn 0.6.5 → 0.6.6
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 +49 -3
- package/dist/classes/CharacterBaseModel.js +57 -57
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +57 -57
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +5 -2
- package/dist/classes/ChoiceMenuOption.d.ts +5 -2
- package/dist/classes/ChoiceMenuOption.js +42 -25
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +42 -25
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +3 -1
- package/dist/classes/CloseLabel.d.ts +3 -1
- package/dist/classes/CloseLabel.js +25 -16
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +25 -16
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +45 -4
- package/dist/classes/Label.d.ts +45 -4
- package/dist/classes/Label.js +25 -16
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +25 -16
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/LabelAbstract.d.mts +50 -0
- package/dist/classes/LabelAbstract.d.ts +50 -0
- package/dist/classes/LabelAbstract.js +100 -0
- package/dist/classes/LabelAbstract.js.map +1 -0
- package/dist/classes/LabelAbstract.mjs +98 -0
- package/dist/classes/LabelAbstract.mjs.map +1 -0
- package/dist/classes/LabelJson.d.mts +30 -0
- package/dist/classes/LabelJson.d.ts +30 -0
- package/dist/classes/LabelJson.js +2766 -0
- package/dist/classes/LabelJson.js.map +1 -0
- package/dist/classes/LabelJson.mjs +2760 -0
- package/dist/classes/LabelJson.mjs.map +1 -0
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/index.d.mts +6 -1
- package/dist/classes/index.d.ts +6 -1
- package/dist/classes/index.js +827 -26
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +827 -27
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.d.mts +19 -5
- package/dist/decorators/LabelDecorator.d.ts +19 -5
- package/dist/decorators/LabelDecorator.js +29 -16
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +29 -17
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +10 -2
- package/dist/decorators/index.d.ts +10 -2
- package/dist/decorators/index.js +25 -16
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +25 -16
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +3 -1
- package/dist/functions/DialogueUtility.d.ts +3 -1
- package/dist/functions/DialogueUtility.js +85 -26
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +85 -26
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/Importer.d.mts +24 -0
- package/dist/functions/Importer.d.ts +24 -0
- package/dist/functions/Importer.js +2804 -0
- package/dist/functions/Importer.js.map +1 -0
- package/dist/functions/Importer.mjs +2798 -0
- package/dist/functions/Importer.mjs.map +1 -0
- package/dist/functions/SavesUtility.d.mts +3 -1
- package/dist/functions/SavesUtility.d.ts +3 -1
- package/dist/functions/SavesUtility.js +139 -36
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +139 -36
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +6 -1
- package/dist/functions/index.d.ts +6 -1
- package/dist/functions/index.js +169 -27
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +169 -28
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +131 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -37
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +4 -2
- package/dist/interface/IHistoryStep.d.ts +4 -2
- package/dist/interface/ISaveData.d.mts +3 -1
- package/dist/interface/ISaveData.d.ts +3 -1
- package/dist/interface/LabelProps.d.mts +38 -5
- package/dist/interface/LabelProps.d.ts +38 -5
- package/dist/interface/export/ExportedStep.d.mts +3 -1
- package/dist/interface/export/ExportedStep.d.ts +3 -1
- package/dist/interface/export/index.d.mts +3 -1
- package/dist/interface/export/index.d.ts +3 -1
- package/dist/interface/index.d.mts +6 -4
- package/dist/interface/index.d.ts +6 -4
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +129 -26
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +130 -27
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +3 -1
- package/dist/labels/CanvasEventsTestLabel.d.ts +3 -1
- package/dist/labels/CanvasEventsTestLabel.js +129 -26
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +129 -26
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +3 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +3 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +129 -26
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +130 -27
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.mts +3 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.ts +3 -1
- package/dist/labels/ImagesAnimationsTestLabel.js +46 -35
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +47 -36
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
- package/dist/labels/MarkdownTest.d.mts +3 -1
- package/dist/labels/MarkdownTest.d.ts +3 -1
- package/dist/labels/MarkdownTest.js +129 -26
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +129 -26
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.d.mts +3 -1
- package/dist/labels/StartLabel.d.ts +3 -1
- package/dist/labels/StartLabel.js +47 -36
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +47 -36
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +3 -1
- package/dist/labels/StepLabelTest.d.ts +3 -1
- package/dist/labels/StepLabelTest.js +129 -26
- package/dist/labels/StepLabelTest.js.map +1 -1
- package/dist/labels/StepLabelTest.mjs +129 -26
- package/dist/labels/StepLabelTest.mjs.map +1 -1
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.d.mts +3 -1
- package/dist/labels/index.d.ts +3 -1
- package/dist/labels/index.js +47 -36
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +47 -36
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +6 -4
- package/dist/managers/StepManager.d.ts +6 -4
- package/dist/managers/StepManager.js +138 -35
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +138 -35
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +7 -5
- package/dist/managers/index.d.ts +7 -5
- package/dist/managers/index.js +138 -35
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +138 -35
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +3 -1
- package/dist/types/ChoiceMenuOptionsType.d.ts +3 -1
- package/dist/types/LabelJsonType.d.mts +22 -0
- package/dist/types/LabelJsonType.d.ts +22 -0
- package/dist/types/LabelJsonType.js +4 -0
- package/dist/types/LabelJsonType.js.map +1 -0
- package/dist/types/LabelJsonType.mjs +3 -0
- package/dist/types/LabelJsonType.mjs.map +1 -0
- package/dist/types/StepLabelJsonType.d.mts +30 -0
- package/dist/types/StepLabelJsonType.d.ts +30 -0
- package/dist/types/StepLabelJsonType.js +4 -0
- package/dist/types/StepLabelJsonType.js.map +1 -0
- package/dist/types/StepLabelJsonType.mjs +3 -0
- package/dist/types/StepLabelJsonType.mjs.map +1 -0
- package/dist/types/index.d.mts +5 -1
- package/dist/types/index.d.ts +5 -1
- package/package.json +3 -2
- package/dist/LabelProps-CFV-zRjG.d.ts +0 -113
- package/dist/LabelProps-CmRpvUJm.d.mts +0 -113
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Pixi’VN is a npm package that provides various features for creating visual novels, has functions to manage story steps, saving and loading, variable storage, dialogues, character,canvas management, and much more.
|
|
4
4
|
|
|
5
|
-
Pixi’VN + [Templates](
|
|
5
|
+
Pixi’VN + [Templates](#project-initialization) provides a complete solution and is in effect a visual novel engine.
|
|
6
6
|
|
|
7
7
|
It is designed for web developers, with basic experience in JavaScript/TypeScript, who want to create a visual novel with a modern 2D rendering engine and their favorite JavaScript framework.
|
|
8
8
|
|
|
@@ -39,17 +39,63 @@ For more information, visit the [Web Page](https://pixi-vn.web.app/)
|
|
|
39
39
|
* [Stored Classes](https://pixi-vn.web.app/advanced/stored-classes.html)
|
|
40
40
|
* [Intecept Events](https://pixi-vn.web.app/advanced/intercept-events.html)
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Prerequisites
|
|
43
|
+
|
|
44
|
+
* [Node.js](https://nodejs.org/) version 18 or higher.
|
|
45
|
+
* Text Editor with TypeScript support.
|
|
46
|
+
* [Visual Studio Code](https://code.visualstudio.com/) is recommended.
|
|
47
|
+
|
|
48
|
+
## Project Initialization
|
|
49
|
+
|
|
50
|
+
To initialize a new project, you can use the following command:
|
|
43
51
|
|
|
44
52
|
```bash
|
|
53
|
+
# npm
|
|
54
|
+
npm create pixi-vn@latest
|
|
55
|
+
|
|
56
|
+
# yarn
|
|
57
|
+
yarn create pixi-vn@latest
|
|
58
|
+
|
|
59
|
+
# pnpm
|
|
60
|
+
pnpm create pixi-vn@latest
|
|
61
|
+
|
|
62
|
+
# bun
|
|
63
|
+
bun create pixi-vn@latest
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The supported template presets are:
|
|
67
|
+
|
|
68
|
+
**[Basic Visual Novel - Web page (Vite + React + MUI joy)](https://github.com/DRincs-Productions/pixi-vn-react-template)**
|
|
69
|
+
|
|
70
|
+
( More templates will be added in the future, see this [issue](https://github.com/DRincs-Productions/pixi-vn/issues/162) for more information )
|
|
71
|
+
|
|
72
|
+
After the project is initialized, you can open the project directory with your text editor (VSCode is recommended) and start developing your visual novel.
|
|
73
|
+
|
|
74
|
+
Into all templates there is a `README.md` file with more information about the project.
|
|
75
|
+
|
|
76
|
+
## Package Installation
|
|
77
|
+
|
|
78
|
+
For installing the Pixi’VN package, you can use the following command:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# npm
|
|
45
82
|
npm install @drincs/pixi-vn
|
|
83
|
+
|
|
84
|
+
# yarn
|
|
85
|
+
yarn add @drincs/pixi-vn
|
|
86
|
+
|
|
87
|
+
# pnpm
|
|
88
|
+
pnpm add @drincs/pixi-vn
|
|
89
|
+
|
|
90
|
+
# bun
|
|
91
|
+
bun add @drincs/pixi-vn
|
|
46
92
|
```
|
|
47
93
|
|
|
48
94
|
## Usage
|
|
49
95
|
|
|
50
96
|
For the following example, we will use React to create the interface and Pixi'VN to manage the visual novel.
|
|
51
97
|
|
|
52
|
-
```
|
|
98
|
+
```tsx
|
|
53
99
|
// main.tsx
|
|
54
100
|
|
|
55
101
|
import { GameWindowManager } from '@drincs/pixi-vn'
|
|
@@ -567,61 +567,6 @@ function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
// src/classes/StoredClassModel.ts
|
|
571
|
-
var StoredClassModel = class {
|
|
572
|
-
/**
|
|
573
|
-
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
574
|
-
* @param id The id of instance of the class. This id must be unique for the category.
|
|
575
|
-
*/
|
|
576
|
-
constructor(categoryId, id) {
|
|
577
|
-
this.categoryId = categoryId;
|
|
578
|
-
this._id = id;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Is id of the stored class. is unique for this class.
|
|
582
|
-
*/
|
|
583
|
-
get id() {
|
|
584
|
-
return this._id;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Update a property in the storage.
|
|
588
|
-
* @param propertyName The name of the property to set.
|
|
589
|
-
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
590
|
-
*/
|
|
591
|
-
setStorageProperty(propertyName, value) {
|
|
592
|
-
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
593
|
-
if (!storage) {
|
|
594
|
-
storage = {};
|
|
595
|
-
}
|
|
596
|
-
if (!storage.hasOwnProperty(this.id)) {
|
|
597
|
-
storage[this.id] = {};
|
|
598
|
-
}
|
|
599
|
-
if (value === void 0 || value === null) {
|
|
600
|
-
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
601
|
-
delete storage[this.id][propertyName];
|
|
602
|
-
}
|
|
603
|
-
} else {
|
|
604
|
-
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
605
|
-
}
|
|
606
|
-
if (Object.keys(storage[this.id]).length === 0) {
|
|
607
|
-
delete storage[this.id];
|
|
608
|
-
}
|
|
609
|
-
GameStorageManager.setVariable(this.categoryId, storage);
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Get a property from the storage.
|
|
613
|
-
* @param propertyName The name of the property to get.
|
|
614
|
-
* @returns The value of the property. If the property is not found, returns undefined.
|
|
615
|
-
*/
|
|
616
|
-
getStorageProperty(propertyName) {
|
|
617
|
-
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
618
|
-
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
619
|
-
return storage[this.id][propertyName];
|
|
620
|
-
}
|
|
621
|
-
return void 0;
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
|
|
625
570
|
// src/classes/ticker/TickerBase.ts
|
|
626
571
|
var TickerBase = class {
|
|
627
572
|
/**
|
|
@@ -943,6 +888,61 @@ ZoomTicker = __decorateClass([
|
|
|
943
888
|
// src/constants.ts
|
|
944
889
|
var Repeat = "repeat";
|
|
945
890
|
|
|
891
|
+
// src/classes/StoredClassModel.ts
|
|
892
|
+
var StoredClassModel = class {
|
|
893
|
+
/**
|
|
894
|
+
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
895
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
896
|
+
*/
|
|
897
|
+
constructor(categoryId, id) {
|
|
898
|
+
this.categoryId = categoryId;
|
|
899
|
+
this._id = id;
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Is id of the stored class. is unique for this class.
|
|
903
|
+
*/
|
|
904
|
+
get id() {
|
|
905
|
+
return this._id;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Update a property in the storage.
|
|
909
|
+
* @param propertyName The name of the property to set.
|
|
910
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
911
|
+
*/
|
|
912
|
+
setStorageProperty(propertyName, value) {
|
|
913
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
914
|
+
if (!storage) {
|
|
915
|
+
storage = {};
|
|
916
|
+
}
|
|
917
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
918
|
+
storage[this.id] = {};
|
|
919
|
+
}
|
|
920
|
+
if (value === void 0 || value === null) {
|
|
921
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
922
|
+
delete storage[this.id][propertyName];
|
|
923
|
+
}
|
|
924
|
+
} else {
|
|
925
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
926
|
+
}
|
|
927
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
928
|
+
delete storage[this.id];
|
|
929
|
+
}
|
|
930
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Get a property from the storage.
|
|
934
|
+
* @param propertyName The name of the property to get.
|
|
935
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
936
|
+
*/
|
|
937
|
+
getStorageProperty(propertyName) {
|
|
938
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
939
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
940
|
+
return storage[this.id][propertyName];
|
|
941
|
+
}
|
|
942
|
+
return void 0;
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
|
|
946
946
|
// src/functions/ExportUtility.ts
|
|
947
947
|
function createExportableElement(element) {
|
|
948
948
|
try {
|
|
@@ -1776,7 +1776,7 @@ _GameWindowManager._currentTickersTimeouts = {};
|
|
|
1776
1776
|
var GameWindowManager = _GameWindowManager;
|
|
1777
1777
|
|
|
1778
1778
|
// src/classes/CharacterBaseModel.ts
|
|
1779
|
-
var
|
|
1779
|
+
var CharacterBaseModel2 = class extends StoredClassModel {
|
|
1780
1780
|
/**
|
|
1781
1781
|
* @param id The id of the character.
|
|
1782
1782
|
* @param props The properties of the character.
|
|
@@ -1834,6 +1834,6 @@ var CharacterBaseModel = class extends StoredClassModel {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
};
|
|
1836
1836
|
|
|
1837
|
-
module.exports =
|
|
1837
|
+
module.exports = CharacterBaseModel2;
|
|
1838
1838
|
//# sourceMappingURL=CharacterBaseModel.js.map
|
|
1839
1839
|
//# sourceMappingURL=CharacterBaseModel.js.map
|