@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.
Files changed (202) hide show
  1. package/README.md +49 -3
  2. package/dist/classes/CharacterBaseModel.js +57 -57
  3. package/dist/classes/CharacterBaseModel.js.map +1 -1
  4. package/dist/classes/CharacterBaseModel.mjs +57 -57
  5. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  6. package/dist/classes/ChoiceMenuOption.d.mts +5 -2
  7. package/dist/classes/ChoiceMenuOption.d.ts +5 -2
  8. package/dist/classes/ChoiceMenuOption.js +42 -25
  9. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  10. package/dist/classes/ChoiceMenuOption.mjs +42 -25
  11. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  12. package/dist/classes/CloseLabel.d.mts +3 -1
  13. package/dist/classes/CloseLabel.d.ts +3 -1
  14. package/dist/classes/CloseLabel.js +25 -16
  15. package/dist/classes/CloseLabel.js.map +1 -1
  16. package/dist/classes/CloseLabel.mjs +25 -16
  17. package/dist/classes/CloseLabel.mjs.map +1 -1
  18. package/dist/classes/Label.d.mts +45 -4
  19. package/dist/classes/Label.d.ts +45 -4
  20. package/dist/classes/Label.js +25 -16
  21. package/dist/classes/Label.js.map +1 -1
  22. package/dist/classes/Label.mjs +25 -16
  23. package/dist/classes/Label.mjs.map +1 -1
  24. package/dist/classes/LabelAbstract.d.mts +50 -0
  25. package/dist/classes/LabelAbstract.d.ts +50 -0
  26. package/dist/classes/LabelAbstract.js +100 -0
  27. package/dist/classes/LabelAbstract.js.map +1 -0
  28. package/dist/classes/LabelAbstract.mjs +98 -0
  29. package/dist/classes/LabelAbstract.mjs.map +1 -0
  30. package/dist/classes/LabelJson.d.mts +30 -0
  31. package/dist/classes/LabelJson.d.ts +30 -0
  32. package/dist/classes/LabelJson.js +2766 -0
  33. package/dist/classes/LabelJson.js.map +1 -0
  34. package/dist/classes/LabelJson.mjs +2760 -0
  35. package/dist/classes/LabelJson.mjs.map +1 -0
  36. package/dist/classes/StoredClassModel.js.map +1 -1
  37. package/dist/classes/StoredClassModel.mjs.map +1 -1
  38. package/dist/classes/index.d.mts +6 -1
  39. package/dist/classes/index.d.ts +6 -1
  40. package/dist/classes/index.js +827 -26
  41. package/dist/classes/index.js.map +1 -1
  42. package/dist/classes/index.mjs +827 -27
  43. package/dist/classes/index.mjs.map +1 -1
  44. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  45. package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
  46. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  47. package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
  48. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  49. package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
  50. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  51. package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
  52. package/dist/classes/ticker/index.js.map +1 -1
  53. package/dist/classes/ticker/index.mjs.map +1 -1
  54. package/dist/constants.d.mts +1 -1
  55. package/dist/constants.d.ts +1 -1
  56. package/dist/constants.js +1 -1
  57. package/dist/constants.js.map +1 -1
  58. package/dist/constants.mjs +1 -1
  59. package/dist/constants.mjs.map +1 -1
  60. package/dist/decorators/LabelDecorator.d.mts +19 -5
  61. package/dist/decorators/LabelDecorator.d.ts +19 -5
  62. package/dist/decorators/LabelDecorator.js +29 -16
  63. package/dist/decorators/LabelDecorator.js.map +1 -1
  64. package/dist/decorators/LabelDecorator.mjs +29 -17
  65. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  66. package/dist/decorators/index.d.mts +10 -2
  67. package/dist/decorators/index.d.ts +10 -2
  68. package/dist/decorators/index.js +25 -16
  69. package/dist/decorators/index.js.map +1 -1
  70. package/dist/decorators/index.mjs +25 -16
  71. package/dist/decorators/index.mjs.map +1 -1
  72. package/dist/functions/DialogueUtility.d.mts +3 -1
  73. package/dist/functions/DialogueUtility.d.ts +3 -1
  74. package/dist/functions/DialogueUtility.js +85 -26
  75. package/dist/functions/DialogueUtility.js.map +1 -1
  76. package/dist/functions/DialogueUtility.mjs +85 -26
  77. package/dist/functions/DialogueUtility.mjs.map +1 -1
  78. package/dist/functions/FlagsUtility.js.map +1 -1
  79. package/dist/functions/FlagsUtility.mjs.map +1 -1
  80. package/dist/functions/GameUtility.js.map +1 -1
  81. package/dist/functions/GameUtility.mjs.map +1 -1
  82. package/dist/functions/ImageUtility.js.map +1 -1
  83. package/dist/functions/ImageUtility.mjs.map +1 -1
  84. package/dist/functions/Importer.d.mts +24 -0
  85. package/dist/functions/Importer.d.ts +24 -0
  86. package/dist/functions/Importer.js +2804 -0
  87. package/dist/functions/Importer.js.map +1 -0
  88. package/dist/functions/Importer.mjs +2798 -0
  89. package/dist/functions/Importer.mjs.map +1 -0
  90. package/dist/functions/SavesUtility.d.mts +3 -1
  91. package/dist/functions/SavesUtility.d.ts +3 -1
  92. package/dist/functions/SavesUtility.js +139 -36
  93. package/dist/functions/SavesUtility.js.map +1 -1
  94. package/dist/functions/SavesUtility.mjs +139 -36
  95. package/dist/functions/SavesUtility.mjs.map +1 -1
  96. package/dist/functions/index.d.mts +6 -1
  97. package/dist/functions/index.d.ts +6 -1
  98. package/dist/functions/index.js +169 -27
  99. package/dist/functions/index.js.map +1 -1
  100. package/dist/functions/index.mjs +169 -28
  101. package/dist/functions/index.mjs.map +1 -1
  102. package/dist/index.d.mts +7 -1
  103. package/dist/index.d.ts +7 -1
  104. package/dist/index.js +131 -36
  105. package/dist/index.js.map +1 -1
  106. package/dist/index.mjs +130 -37
  107. package/dist/index.mjs.map +1 -1
  108. package/dist/interface/IHistoryStep.d.mts +4 -2
  109. package/dist/interface/IHistoryStep.d.ts +4 -2
  110. package/dist/interface/ISaveData.d.mts +3 -1
  111. package/dist/interface/ISaveData.d.ts +3 -1
  112. package/dist/interface/LabelProps.d.mts +38 -5
  113. package/dist/interface/LabelProps.d.ts +38 -5
  114. package/dist/interface/export/ExportedStep.d.mts +3 -1
  115. package/dist/interface/export/ExportedStep.d.ts +3 -1
  116. package/dist/interface/export/index.d.mts +3 -1
  117. package/dist/interface/export/index.d.ts +3 -1
  118. package/dist/interface/index.d.mts +6 -4
  119. package/dist/interface/index.d.ts +6 -4
  120. package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
  121. package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
  122. package/dist/labels/BaseCanvasElementTestLabel.js +129 -26
  123. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  124. package/dist/labels/BaseCanvasElementTestLabel.mjs +130 -27
  125. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  126. package/dist/labels/CanvasEventsTestLabel.d.mts +3 -1
  127. package/dist/labels/CanvasEventsTestLabel.d.ts +3 -1
  128. package/dist/labels/CanvasEventsTestLabel.js +129 -26
  129. package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
  130. package/dist/labels/CanvasEventsTestLabel.mjs +129 -26
  131. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
  132. package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +3 -1
  133. package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +3 -1
  134. package/dist/labels/CustomTickerCanvasElementTestLabel.js +129 -26
  135. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
  136. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +130 -27
  137. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
  138. package/dist/labels/ImagesAnimationsTestLabel.d.mts +3 -1
  139. package/dist/labels/ImagesAnimationsTestLabel.d.ts +3 -1
  140. package/dist/labels/ImagesAnimationsTestLabel.js +46 -35
  141. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
  142. package/dist/labels/ImagesAnimationsTestLabel.mjs +47 -36
  143. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
  144. package/dist/labels/MarkdownTest.d.mts +3 -1
  145. package/dist/labels/MarkdownTest.d.ts +3 -1
  146. package/dist/labels/MarkdownTest.js +129 -26
  147. package/dist/labels/MarkdownTest.js.map +1 -1
  148. package/dist/labels/MarkdownTest.mjs +129 -26
  149. package/dist/labels/MarkdownTest.mjs.map +1 -1
  150. package/dist/labels/StartLabel.d.mts +3 -1
  151. package/dist/labels/StartLabel.d.ts +3 -1
  152. package/dist/labels/StartLabel.js +47 -36
  153. package/dist/labels/StartLabel.js.map +1 -1
  154. package/dist/labels/StartLabel.mjs +47 -36
  155. package/dist/labels/StartLabel.mjs.map +1 -1
  156. package/dist/labels/StepLabelTest.d.mts +3 -1
  157. package/dist/labels/StepLabelTest.d.ts +3 -1
  158. package/dist/labels/StepLabelTest.js +129 -26
  159. package/dist/labels/StepLabelTest.js.map +1 -1
  160. package/dist/labels/StepLabelTest.mjs +129 -26
  161. package/dist/labels/StepLabelTest.mjs.map +1 -1
  162. package/dist/labels/TestConstant.js.map +1 -1
  163. package/dist/labels/TestConstant.mjs.map +1 -1
  164. package/dist/labels/index.d.mts +3 -1
  165. package/dist/labels/index.d.ts +3 -1
  166. package/dist/labels/index.js +47 -36
  167. package/dist/labels/index.js.map +1 -1
  168. package/dist/labels/index.mjs +47 -36
  169. package/dist/labels/index.mjs.map +1 -1
  170. package/dist/managers/StepManager.d.mts +6 -4
  171. package/dist/managers/StepManager.d.ts +6 -4
  172. package/dist/managers/StepManager.js +138 -35
  173. package/dist/managers/StepManager.js.map +1 -1
  174. package/dist/managers/StepManager.mjs +138 -35
  175. package/dist/managers/StepManager.mjs.map +1 -1
  176. package/dist/managers/WindowManager.js.map +1 -1
  177. package/dist/managers/WindowManager.mjs.map +1 -1
  178. package/dist/managers/index.d.mts +7 -5
  179. package/dist/managers/index.d.ts +7 -5
  180. package/dist/managers/index.js +138 -35
  181. package/dist/managers/index.js.map +1 -1
  182. package/dist/managers/index.mjs +138 -35
  183. package/dist/managers/index.mjs.map +1 -1
  184. package/dist/types/ChoiceMenuOptionsType.d.mts +3 -1
  185. package/dist/types/ChoiceMenuOptionsType.d.ts +3 -1
  186. package/dist/types/LabelJsonType.d.mts +22 -0
  187. package/dist/types/LabelJsonType.d.ts +22 -0
  188. package/dist/types/LabelJsonType.js +4 -0
  189. package/dist/types/LabelJsonType.js.map +1 -0
  190. package/dist/types/LabelJsonType.mjs +3 -0
  191. package/dist/types/LabelJsonType.mjs.map +1 -0
  192. package/dist/types/StepLabelJsonType.d.mts +30 -0
  193. package/dist/types/StepLabelJsonType.d.ts +30 -0
  194. package/dist/types/StepLabelJsonType.js +4 -0
  195. package/dist/types/StepLabelJsonType.js.map +1 -0
  196. package/dist/types/StepLabelJsonType.mjs +3 -0
  197. package/dist/types/StepLabelJsonType.mjs.map +1 -0
  198. package/dist/types/index.d.mts +5 -1
  199. package/dist/types/index.d.ts +5 -1
  200. package/package.json +3 -2
  201. package/dist/LabelProps-CFV-zRjG.d.ts +0 -113
  202. 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](https://pixi-vn.web.app/start/getting-started.html#pivi-vn-templates) provides a complete solution and is in effect a visual novel engine.
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
- ## Installation
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
- ```typescript
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 CharacterBaseModel = class extends StoredClassModel {
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 = CharacterBaseModel;
1837
+ module.exports = CharacterBaseModel2;
1838
1838
  //# sourceMappingURL=CharacterBaseModel.js.map
1839
1839
  //# sourceMappingURL=CharacterBaseModel.js.map