@drincs/pixi-vn 0.6.4 → 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 (266) hide show
  1. package/README.md +56 -7
  2. package/dist/classes/CharacterBaseModel.js +99 -90
  3. package/dist/classes/CharacterBaseModel.js.map +1 -1
  4. package/dist/classes/CharacterBaseModel.mjs +99 -90
  5. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  6. package/dist/classes/ChoiceMenuOption.d.mts +71 -8
  7. package/dist/classes/ChoiceMenuOption.d.ts +71 -8
  8. package/dist/classes/ChoiceMenuOption.js +160 -77
  9. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  10. package/dist/classes/ChoiceMenuOption.mjs +160 -77
  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 +77 -32
  15. package/dist/classes/CloseLabel.js.map +1 -1
  16. package/dist/classes/CloseLabel.mjs +77 -32
  17. package/dist/classes/CloseLabel.mjs.map +1 -1
  18. package/dist/classes/Label.d.mts +6 -33
  19. package/dist/classes/Label.d.ts +6 -33
  20. package/dist/classes/Label.js +74 -31
  21. package/dist/classes/Label.js.map +1 -1
  22. package/dist/classes/Label.mjs +74 -31
  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 +42 -33
  37. package/dist/classes/StoredClassModel.js.map +1 -1
  38. package/dist/classes/StoredClassModel.mjs +42 -33
  39. package/dist/classes/StoredClassModel.mjs.map +1 -1
  40. package/dist/classes/canvas/CanvasContainer.js +2 -2
  41. package/dist/classes/canvas/CanvasContainer.js.map +1 -1
  42. package/dist/classes/canvas/CanvasContainer.mjs +2 -2
  43. package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
  44. package/dist/classes/canvas/CanvasImage.js +2 -2
  45. package/dist/classes/canvas/CanvasImage.js.map +1 -1
  46. package/dist/classes/canvas/CanvasImage.mjs +2 -2
  47. package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
  48. package/dist/classes/canvas/CanvasSprite.js +2 -2
  49. package/dist/classes/canvas/CanvasSprite.js.map +1 -1
  50. package/dist/classes/canvas/CanvasSprite.mjs +2 -2
  51. package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
  52. package/dist/classes/canvas/CanvasText.js +2 -2
  53. package/dist/classes/canvas/CanvasText.js.map +1 -1
  54. package/dist/classes/canvas/CanvasText.mjs +2 -2
  55. package/dist/classes/canvas/CanvasText.mjs.map +1 -1
  56. package/dist/classes/canvas/index.js +2 -2
  57. package/dist/classes/canvas/index.js.map +1 -1
  58. package/dist/classes/canvas/index.mjs +2 -2
  59. package/dist/classes/canvas/index.mjs.map +1 -1
  60. package/dist/classes/index.d.mts +6 -1
  61. package/dist/classes/index.d.ts +6 -1
  62. package/dist/classes/index.js +945 -78
  63. package/dist/classes/index.js.map +1 -1
  64. package/dist/classes/index.mjs +945 -79
  65. package/dist/classes/index.mjs.map +1 -1
  66. package/dist/classes/ticker/FadeAlphaTicker.js +42 -33
  67. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  68. package/dist/classes/ticker/FadeAlphaTicker.mjs +42 -33
  69. package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
  70. package/dist/classes/ticker/MoveTicker.d.mts +1 -0
  71. package/dist/classes/ticker/MoveTicker.d.ts +1 -0
  72. package/dist/classes/ticker/MoveTicker.js +42 -33
  73. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  74. package/dist/classes/ticker/MoveTicker.mjs +42 -33
  75. package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
  76. package/dist/classes/ticker/RotateTicker.d.mts +1 -0
  77. package/dist/classes/ticker/RotateTicker.d.ts +1 -0
  78. package/dist/classes/ticker/RotateTicker.js +42 -33
  79. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  80. package/dist/classes/ticker/RotateTicker.mjs +42 -33
  81. package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
  82. package/dist/classes/ticker/ZoomTicker.d.mts +1 -0
  83. package/dist/classes/ticker/ZoomTicker.d.ts +1 -0
  84. package/dist/classes/ticker/ZoomTicker.js +42 -33
  85. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  86. package/dist/classes/ticker/ZoomTicker.mjs +42 -33
  87. package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
  88. package/dist/classes/ticker/index.js +42 -33
  89. package/dist/classes/ticker/index.js.map +1 -1
  90. package/dist/classes/ticker/index.mjs +42 -33
  91. package/dist/classes/ticker/index.mjs.map +1 -1
  92. package/dist/constants.d.mts +1 -1
  93. package/dist/constants.d.ts +1 -1
  94. package/dist/constants.js +1 -1
  95. package/dist/constants.js.map +1 -1
  96. package/dist/constants.mjs +1 -1
  97. package/dist/constants.mjs.map +1 -1
  98. package/dist/decorators/CanvasElementDecorator.js +2 -2
  99. package/dist/decorators/CanvasElementDecorator.js.map +1 -1
  100. package/dist/decorators/CanvasElementDecorator.mjs +2 -2
  101. package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
  102. package/dist/decorators/LabelDecorator.d.mts +19 -5
  103. package/dist/decorators/LabelDecorator.d.ts +19 -5
  104. package/dist/decorators/LabelDecorator.js +102 -65
  105. package/dist/decorators/LabelDecorator.js.map +1 -1
  106. package/dist/decorators/LabelDecorator.mjs +102 -66
  107. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  108. package/dist/decorators/index.d.mts +10 -2
  109. package/dist/decorators/index.d.ts +10 -2
  110. package/dist/decorators/index.js +98 -65
  111. package/dist/decorators/index.js.map +1 -1
  112. package/dist/decorators/index.mjs +98 -65
  113. package/dist/decorators/index.mjs.map +1 -1
  114. package/dist/functions/CanvasUtility.js +2 -2
  115. package/dist/functions/CanvasUtility.js.map +1 -1
  116. package/dist/functions/CanvasUtility.mjs +2 -2
  117. package/dist/functions/CanvasUtility.mjs.map +1 -1
  118. package/dist/functions/DialogueUtility.d.mts +10 -8
  119. package/dist/functions/DialogueUtility.d.ts +10 -8
  120. package/dist/functions/DialogueUtility.js +268 -131
  121. package/dist/functions/DialogueUtility.js.map +1 -1
  122. package/dist/functions/DialogueUtility.mjs +268 -131
  123. package/dist/functions/DialogueUtility.mjs.map +1 -1
  124. package/dist/functions/FlagsUtility.js +42 -33
  125. package/dist/functions/FlagsUtility.js.map +1 -1
  126. package/dist/functions/FlagsUtility.mjs +42 -33
  127. package/dist/functions/FlagsUtility.mjs.map +1 -1
  128. package/dist/functions/GameUtility.js +42 -33
  129. package/dist/functions/GameUtility.js.map +1 -1
  130. package/dist/functions/GameUtility.mjs +42 -33
  131. package/dist/functions/GameUtility.mjs.map +1 -1
  132. package/dist/functions/ImageUtility.js +45 -36
  133. package/dist/functions/ImageUtility.js.map +1 -1
  134. package/dist/functions/ImageUtility.mjs +45 -36
  135. package/dist/functions/ImageUtility.mjs.map +1 -1
  136. package/dist/functions/Importer.d.mts +24 -0
  137. package/dist/functions/Importer.d.ts +24 -0
  138. package/dist/functions/Importer.js +2804 -0
  139. package/dist/functions/Importer.js.map +1 -0
  140. package/dist/functions/Importer.mjs +2798 -0
  141. package/dist/functions/Importer.mjs.map +1 -0
  142. package/dist/functions/SavesUtility.d.mts +5 -3
  143. package/dist/functions/SavesUtility.d.ts +5 -3
  144. package/dist/functions/SavesUtility.js +310 -145
  145. package/dist/functions/SavesUtility.js.map +1 -1
  146. package/dist/functions/SavesUtility.mjs +310 -145
  147. package/dist/functions/SavesUtility.mjs.map +1 -1
  148. package/dist/functions/TickerUtility.d.mts +2 -1
  149. package/dist/functions/TickerUtility.d.ts +2 -1
  150. package/dist/functions/TickerUtility.js +19 -15
  151. package/dist/functions/TickerUtility.js.map +1 -1
  152. package/dist/functions/TickerUtility.mjs +19 -15
  153. package/dist/functions/TickerUtility.mjs.map +1 -1
  154. package/dist/functions/index.d.mts +7 -2
  155. package/dist/functions/index.d.ts +7 -2
  156. package/dist/functions/index.js +364 -140
  157. package/dist/functions/index.js.map +1 -1
  158. package/dist/functions/index.mjs +364 -141
  159. package/dist/functions/index.mjs.map +1 -1
  160. package/dist/index.d.mts +6 -0
  161. package/dist/index.d.ts +6 -0
  162. package/dist/index.js +453 -219
  163. package/dist/index.js.map +1 -1
  164. package/dist/index.mjs +453 -221
  165. package/dist/index.mjs.map +1 -1
  166. package/dist/interface/IHistoryStep.d.mts +3 -1
  167. package/dist/interface/IHistoryStep.d.ts +3 -1
  168. package/dist/interface/ISaveData.d.mts +3 -1
  169. package/dist/interface/ISaveData.d.ts +3 -1
  170. package/dist/interface/LabelProps.d.mts +38 -0
  171. package/dist/interface/LabelProps.d.ts +38 -0
  172. package/dist/interface/LabelProps.js +4 -0
  173. package/dist/interface/LabelProps.js.map +1 -0
  174. package/dist/interface/LabelProps.mjs +3 -0
  175. package/dist/interface/LabelProps.mjs.map +1 -0
  176. package/dist/interface/export/ExportedStep.d.mts +3 -1
  177. package/dist/interface/export/ExportedStep.d.ts +3 -1
  178. package/dist/interface/export/index.d.mts +3 -1
  179. package/dist/interface/export/index.d.ts +3 -1
  180. package/dist/interface/index.d.mts +3 -1
  181. package/dist/interface/index.d.ts +3 -1
  182. package/dist/labels/BaseCanvasElementTestLabel.d.mts +3 -1
  183. package/dist/labels/BaseCanvasElementTestLabel.d.ts +3 -1
  184. package/dist/labels/BaseCanvasElementTestLabel.js +303 -136
  185. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  186. package/dist/labels/BaseCanvasElementTestLabel.mjs +304 -137
  187. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  188. package/dist/labels/CanvasEventsTestLabel.d.mts +4 -5
  189. package/dist/labels/CanvasEventsTestLabel.d.ts +4 -5
  190. package/dist/labels/CanvasEventsTestLabel.js +313 -148
  191. package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
  192. package/dist/labels/CanvasEventsTestLabel.mjs +314 -149
  193. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
  194. package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +3 -1
  195. package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +3 -1
  196. package/dist/labels/CustomTickerCanvasElementTestLabel.js +294 -133
  197. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
  198. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +295 -134
  199. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
  200. package/dist/labels/ImagesAnimationsTestLabel.d.mts +3 -1
  201. package/dist/labels/ImagesAnimationsTestLabel.d.ts +3 -1
  202. package/dist/labels/ImagesAnimationsTestLabel.js +298 -181
  203. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
  204. package/dist/labels/ImagesAnimationsTestLabel.mjs +299 -182
  205. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
  206. package/dist/labels/MarkdownTest.d.mts +3 -1
  207. package/dist/labels/MarkdownTest.d.ts +3 -1
  208. package/dist/labels/MarkdownTest.js +294 -133
  209. package/dist/labels/MarkdownTest.js.map +1 -1
  210. package/dist/labels/MarkdownTest.mjs +294 -133
  211. package/dist/labels/MarkdownTest.mjs.map +1 -1
  212. package/dist/labels/StartLabel.d.mts +3 -1
  213. package/dist/labels/StartLabel.d.ts +3 -1
  214. package/dist/labels/StartLabel.js +360 -213
  215. package/dist/labels/StartLabel.js.map +1 -1
  216. package/dist/labels/StartLabel.mjs +361 -214
  217. package/dist/labels/StartLabel.mjs.map +1 -1
  218. package/dist/labels/StepLabelTest.d.mts +11 -0
  219. package/dist/labels/StepLabelTest.d.ts +11 -0
  220. package/dist/labels/StepLabelTest.js +2861 -0
  221. package/dist/labels/StepLabelTest.js.map +1 -0
  222. package/dist/labels/StepLabelTest.mjs +2855 -0
  223. package/dist/labels/StepLabelTest.mjs.map +1 -0
  224. package/dist/labels/TestConstant.js +43 -34
  225. package/dist/labels/TestConstant.js.map +1 -1
  226. package/dist/labels/TestConstant.mjs +43 -34
  227. package/dist/labels/TestConstant.mjs.map +1 -1
  228. package/dist/labels/index.d.mts +3 -1
  229. package/dist/labels/index.d.ts +3 -1
  230. package/dist/labels/index.js +360 -213
  231. package/dist/labels/index.js.map +1 -1
  232. package/dist/labels/index.mjs +361 -214
  233. package/dist/labels/index.mjs.map +1 -1
  234. package/dist/managers/StepManager.d.mts +10 -7
  235. package/dist/managers/StepManager.d.ts +10 -7
  236. package/dist/managers/StepManager.js +300 -139
  237. package/dist/managers/StepManager.js.map +1 -1
  238. package/dist/managers/StepManager.mjs +300 -139
  239. package/dist/managers/StepManager.mjs.map +1 -1
  240. package/dist/managers/WindowManager.js +2 -2
  241. package/dist/managers/WindowManager.js.map +1 -1
  242. package/dist/managers/WindowManager.mjs +2 -2
  243. package/dist/managers/WindowManager.mjs.map +1 -1
  244. package/dist/managers/index.d.mts +7 -5
  245. package/dist/managers/index.d.ts +7 -5
  246. package/dist/managers/index.js +300 -139
  247. package/dist/managers/index.js.map +1 -1
  248. package/dist/managers/index.mjs +300 -139
  249. package/dist/managers/index.mjs.map +1 -1
  250. package/dist/types/ChoiceMenuOptionsType.d.mts +3 -1
  251. package/dist/types/ChoiceMenuOptionsType.d.ts +3 -1
  252. package/dist/types/LabelJsonType.d.mts +22 -0
  253. package/dist/types/LabelJsonType.d.ts +22 -0
  254. package/dist/types/LabelJsonType.js +4 -0
  255. package/dist/types/LabelJsonType.js.map +1 -0
  256. package/dist/types/LabelJsonType.mjs +3 -0
  257. package/dist/types/LabelJsonType.mjs.map +1 -0
  258. package/dist/types/StepLabelJsonType.d.mts +30 -0
  259. package/dist/types/StepLabelJsonType.d.ts +30 -0
  260. package/dist/types/StepLabelJsonType.js +4 -0
  261. package/dist/types/StepLabelJsonType.js.map +1 -0
  262. package/dist/types/StepLabelJsonType.mjs +3 -0
  263. package/dist/types/StepLabelJsonType.mjs.map +1 -0
  264. package/dist/types/index.d.mts +4 -0
  265. package/dist/types/index.d.ts +4 -0
  266. package/package.json +7 -6
package/README.md CHANGED
@@ -1,13 +1,16 @@
1
1
  # Pixi'VN - PixiJS Visual Novel Engine
2
2
 
3
- Pixi'VN is a npm package that provides various features for creating visual novels.
3
+ PixiVN 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 has functions to manage story steps, saving and loading, variable storage, dialogues, and character creation.
5
+ PixiVN + [Templates](#project-initialization) provides a complete solution and is in effect a visual novel engine.
6
6
 
7
- Pixi'VN is based on [Pixi.js](https://pixijs.com/), a modern 2D rendering engine, expanding the features by adding a save and load system, and functions to simplify the addition of images and animations.
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
 
9
- In addition to managing the Pixi.js "Canvas", Pixi'VN offers the possibility of adding an HTML Element with the same dimensions as the "Canvas" to add interactions with the user.
10
- This allows the use of systems such as React, Vue, Angular, etc. to create much more complex interfaces with excellent performance.
9
+ It is based on [Pixi.js](https://pixijs.com/), a rendering engine that allows you to create fast 2D graphics. It is based on WebGL and is very fast and efficient. It is used by many developers to create games, websites, and applications.
10
+
11
+ In addition to managing the Pixi.js "Canvas", Pixi’VN offers the possibility of adding an HTML Element with the same dimensions as the "Canvas" to add interactions with the user.
12
+
13
+ This allows the use of systems such as React, Vue, Angular, etc. to create much more complex **interface screens** with excellent performance.
11
14
 
12
15
  ## Wiki
13
16
 
@@ -36,17 +39,63 @@ For more information, visit the [Web Page](https://pixi-vn.web.app/)
36
39
  * [Stored Classes](https://pixi-vn.web.app/advanced/stored-classes.html)
37
40
  * [Intecept Events](https://pixi-vn.web.app/advanced/intercept-events.html)
38
41
 
39
- ## 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:
40
51
 
41
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
42
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
43
92
  ```
44
93
 
45
94
  ## Usage
46
95
 
47
96
  For the following example, we will use React to create the interface and Pixi'VN to manage the visual novel.
48
97
 
49
- ```typescript
98
+ ```tsx
50
99
  // main.tsx
51
100
 
52
101
  import { GameWindowManager } from '@drincs/pixi-vn'
@@ -133,8 +133,6 @@ function getMemoryContainer(element) {
133
133
  };
134
134
  }
135
135
  function setMemoryContainer(element, memory) {
136
- memory.width && (element.width = memory.width);
137
- memory.height && (element.height = memory.height);
138
136
  memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
139
137
  memory.blendMode && (element.blendMode = memory.blendMode);
140
138
  memory.tint && (element.tint = memory.tint);
@@ -167,6 +165,8 @@ function setMemoryContainer(element, memory) {
167
165
  memory.interactive && (element.interactive = memory.interactive);
168
166
  memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
169
167
  memory.hitArea && (element.hitArea = memory.hitArea);
168
+ memory.width && (element.width = memory.width);
169
+ memory.height && (element.height = memory.height);
170
170
  }
171
171
  function getTexture(imageUrl) {
172
172
  return __async(this, null, function* () {
@@ -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
  /**
@@ -702,8 +647,9 @@ FadeAlphaTicker = __decorateClass([
702
647
  ], FadeAlphaTicker);
703
648
 
704
649
  // src/functions/TickerUtility.ts
705
- function updateTickerProgression(args, propertyName, progression) {
706
- if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
650
+ function updateTickerProgression(args, propertyName, progression, valueConvert) {
651
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
652
+ if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
707
653
  return;
708
654
  }
709
655
  if (typeof args[propertyName] === "number") {
@@ -722,22 +668,25 @@ function updateTickerProgression(args, propertyName, progression) {
722
668
  }
723
669
  }
724
670
  }
725
- function getLinearProgression(number, progression) {
726
- if (progression.limit !== void 0) {
727
- if (number > progression.limit && progression.amt > 0) {
728
- return progression.limit;
729
- } else if (number < progression.limit && progression.amt < 0) {
730
- return progression.limit;
671
+ function getLinearProgression(number, progression, valueConvert) {
672
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
673
+ let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
674
+ if (limit !== void 0) {
675
+ if (number > limit && amt > 0) {
676
+ return limit;
677
+ } else if (number < limit && amt < 0) {
678
+ return limit;
731
679
  }
732
680
  }
733
- return number + progression.amt / 60;
681
+ return number + amt;
734
682
  }
735
- function getExponentialProgression(number, progression) {
736
- if (progression.limit !== void 0) {
737
- if (number > progression.limit && progression.percentage > 0) {
738
- return progression.limit;
739
- } else if (number < progression.limit && progression.percentage < 0) {
740
- return progression.limit;
683
+ function getExponentialProgression(number, progression, valueConvert) {
684
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
685
+ if (limit !== void 0) {
686
+ if (number > limit && progression.percentage > 0) {
687
+ return limit;
688
+ } else if (number < limit && progression.percentage < 0) {
689
+ return limit;
741
690
  }
742
691
  }
743
692
  return number + number * progression.percentage;
@@ -750,15 +699,13 @@ var MoveTicker = class extends TickerBase {
750
699
  let ySpeed = 1;
751
700
  if (args.speed) {
752
701
  if (typeof args.speed === "number") {
753
- xSpeed = args.speed;
754
- ySpeed = args.speed;
702
+ xSpeed = this.speedConvert(args.speed);
703
+ ySpeed = this.speedConvert(args.speed);
755
704
  } else {
756
- xSpeed = args.speed.x;
757
- ySpeed = args.speed.y;
705
+ xSpeed = this.speedConvert(args.speed.x);
706
+ ySpeed = this.speedConvert(args.speed.y);
758
707
  }
759
708
  }
760
- xSpeed /= 60;
761
- ySpeed /= 60;
762
709
  let destination = args.destination;
763
710
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
764
711
  if (typeof tagToRemoveAfter2 === "string") {
@@ -798,7 +745,10 @@ var MoveTicker = class extends TickerBase {
798
745
  }
799
746
  });
800
747
  if (args.speedProgression)
801
- updateTickerProgression(args, "speed", args.speedProgression);
748
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
749
+ }
750
+ speedConvert(speed) {
751
+ return speed / 6;
802
752
  }
803
753
  };
804
754
  MoveTicker = __decorateClass([
@@ -806,7 +756,7 @@ MoveTicker = __decorateClass([
806
756
  ], MoveTicker);
807
757
  var RotateTicker = class extends TickerBase {
808
758
  fn(ticker, args, tags, tickerId) {
809
- let speed = (args.speed === void 0 ? 1 : args.speed) / 60;
759
+ let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
810
760
  let clockwise = args.clockwise === void 0 ? true : args.clockwise;
811
761
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
812
762
  if (typeof tagToRemoveAfter2 === "string") {
@@ -834,7 +784,10 @@ var RotateTicker = class extends TickerBase {
834
784
  }
835
785
  });
836
786
  if (args.speedProgression)
837
- updateTickerProgression(args, "speed", args.speedProgression);
787
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
788
+ }
789
+ speedConvert(speed) {
790
+ return speed / 60;
838
791
  }
839
792
  };
840
793
  RotateTicker = __decorateClass([
@@ -846,15 +799,13 @@ var ZoomTicker = class extends TickerBase {
846
799
  let ySpeed = 0.1;
847
800
  if (args.speed) {
848
801
  if (typeof args.speed === "number") {
849
- xSpeed = args.speed;
850
- ySpeed = args.speed;
802
+ xSpeed = this.speedConvert(args.speed);
803
+ ySpeed = this.speedConvert(args.speed);
851
804
  } else {
852
- xSpeed = args.speed.x;
853
- ySpeed = args.speed.y;
805
+ xSpeed = this.speedConvert(args.speed.x);
806
+ ySpeed = this.speedConvert(args.speed.y);
854
807
  }
855
808
  }
856
- xSpeed /= 60;
857
- ySpeed /= 60;
858
809
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
859
810
  if (typeof tagToRemoveAfter2 === "string") {
860
811
  tagToRemoveAfter2 = [tagToRemoveAfter2];
@@ -921,7 +872,10 @@ var ZoomTicker = class extends TickerBase {
921
872
  }
922
873
  });
923
874
  if (args.speedProgression)
924
- updateTickerProgression(args, "speed", args.speedProgression);
875
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
876
+ }
877
+ speedConvert(speed) {
878
+ return speed / 60;
925
879
  }
926
880
  onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
927
881
  GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
@@ -934,6 +888,61 @@ ZoomTicker = __decorateClass([
934
888
  // src/constants.ts
935
889
  var Repeat = "repeat";
936
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
+
937
946
  // src/functions/ExportUtility.ts
938
947
  function createExportableElement(element) {
939
948
  try {
@@ -1767,7 +1776,7 @@ _GameWindowManager._currentTickersTimeouts = {};
1767
1776
  var GameWindowManager = _GameWindowManager;
1768
1777
 
1769
1778
  // src/classes/CharacterBaseModel.ts
1770
- var CharacterBaseModel = class extends StoredClassModel {
1779
+ var CharacterBaseModel2 = class extends StoredClassModel {
1771
1780
  /**
1772
1781
  * @param id The id of the character.
1773
1782
  * @param props The properties of the character.
@@ -1825,6 +1834,6 @@ var CharacterBaseModel = class extends StoredClassModel {
1825
1834
  }
1826
1835
  };
1827
1836
 
1828
- module.exports = CharacterBaseModel;
1837
+ module.exports = CharacterBaseModel2;
1829
1838
  //# sourceMappingURL=CharacterBaseModel.js.map
1830
1839
  //# sourceMappingURL=CharacterBaseModel.js.map