@drincs/pixi-vn 0.6.3 → 0.6.5

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 (238) hide show
  1. package/README.md +8 -5
  2. package/dist/LabelProps-CFV-zRjG.d.ts +113 -0
  3. package/dist/LabelProps-CmRpvUJm.d.mts +113 -0
  4. package/dist/classes/CharacterBaseModel.js +42 -33
  5. package/dist/classes/CharacterBaseModel.js.map +1 -1
  6. package/dist/classes/CharacterBaseModel.mjs +42 -33
  7. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  8. package/dist/classes/ChoiceMenuOption.d.mts +68 -8
  9. package/dist/classes/ChoiceMenuOption.d.ts +68 -8
  10. package/dist/classes/ChoiceMenuOption.js +119 -53
  11. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  12. package/dist/classes/ChoiceMenuOption.mjs +119 -53
  13. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  14. package/dist/classes/CloseLabel.d.mts +2 -2
  15. package/dist/classes/CloseLabel.d.ts +2 -2
  16. package/dist/classes/CloseLabel.js +53 -17
  17. package/dist/classes/CloseLabel.js.map +1 -1
  18. package/dist/classes/CloseLabel.mjs +53 -17
  19. package/dist/classes/CloseLabel.mjs.map +1 -1
  20. package/dist/classes/Label.d.mts +4 -72
  21. package/dist/classes/Label.d.ts +4 -72
  22. package/dist/classes/Label.js +50 -16
  23. package/dist/classes/Label.js.map +1 -1
  24. package/dist/classes/Label.mjs +50 -16
  25. package/dist/classes/Label.mjs.map +1 -1
  26. package/dist/classes/StoredClassModel.js +42 -33
  27. package/dist/classes/StoredClassModel.js.map +1 -1
  28. package/dist/classes/StoredClassModel.mjs +42 -33
  29. package/dist/classes/StoredClassModel.mjs.map +1 -1
  30. package/dist/classes/canvas/CanvasContainer.js +2 -2
  31. package/dist/classes/canvas/CanvasContainer.js.map +1 -1
  32. package/dist/classes/canvas/CanvasContainer.mjs +2 -2
  33. package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
  34. package/dist/classes/canvas/CanvasImage.js +2 -2
  35. package/dist/classes/canvas/CanvasImage.js.map +1 -1
  36. package/dist/classes/canvas/CanvasImage.mjs +2 -2
  37. package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
  38. package/dist/classes/canvas/CanvasSprite.js +2 -2
  39. package/dist/classes/canvas/CanvasSprite.js.map +1 -1
  40. package/dist/classes/canvas/CanvasSprite.mjs +2 -2
  41. package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
  42. package/dist/classes/canvas/CanvasText.js +2 -2
  43. package/dist/classes/canvas/CanvasText.js.map +1 -1
  44. package/dist/classes/canvas/CanvasText.mjs +2 -2
  45. package/dist/classes/canvas/CanvasText.mjs.map +1 -1
  46. package/dist/classes/canvas/index.js +2 -2
  47. package/dist/classes/canvas/index.js.map +1 -1
  48. package/dist/classes/canvas/index.mjs +2 -2
  49. package/dist/classes/canvas/index.mjs.map +1 -1
  50. package/dist/classes/index.d.mts +2 -2
  51. package/dist/classes/index.d.ts +2 -2
  52. package/dist/classes/index.js +119 -53
  53. package/dist/classes/index.js.map +1 -1
  54. package/dist/classes/index.mjs +119 -53
  55. package/dist/classes/index.mjs.map +1 -1
  56. package/dist/classes/ticker/FadeAlphaTicker.js +42 -33
  57. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  58. package/dist/classes/ticker/FadeAlphaTicker.mjs +42 -33
  59. package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
  60. package/dist/classes/ticker/MoveTicker.d.mts +1 -0
  61. package/dist/classes/ticker/MoveTicker.d.ts +1 -0
  62. package/dist/classes/ticker/MoveTicker.js +42 -33
  63. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  64. package/dist/classes/ticker/MoveTicker.mjs +42 -33
  65. package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
  66. package/dist/classes/ticker/RotateTicker.d.mts +1 -0
  67. package/dist/classes/ticker/RotateTicker.d.ts +1 -0
  68. package/dist/classes/ticker/RotateTicker.js +42 -33
  69. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  70. package/dist/classes/ticker/RotateTicker.mjs +42 -33
  71. package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
  72. package/dist/classes/ticker/ZoomTicker.d.mts +1 -0
  73. package/dist/classes/ticker/ZoomTicker.d.ts +1 -0
  74. package/dist/classes/ticker/ZoomTicker.js +42 -33
  75. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  76. package/dist/classes/ticker/ZoomTicker.mjs +42 -33
  77. package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
  78. package/dist/classes/ticker/index.js +42 -33
  79. package/dist/classes/ticker/index.js.map +1 -1
  80. package/dist/classes/ticker/index.mjs +42 -33
  81. package/dist/classes/ticker/index.mjs.map +1 -1
  82. package/dist/constants.d.mts +1 -1
  83. package/dist/constants.d.ts +1 -1
  84. package/dist/constants.js +1 -1
  85. package/dist/constants.js.map +1 -1
  86. package/dist/constants.mjs +1 -1
  87. package/dist/constants.mjs.map +1 -1
  88. package/dist/decorators/CanvasElementDecorator.js +2 -2
  89. package/dist/decorators/CanvasElementDecorator.js.map +1 -1
  90. package/dist/decorators/CanvasElementDecorator.mjs +2 -2
  91. package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
  92. package/dist/decorators/LabelDecorator.d.mts +3 -3
  93. package/dist/decorators/LabelDecorator.d.ts +3 -3
  94. package/dist/decorators/LabelDecorator.js +74 -50
  95. package/dist/decorators/LabelDecorator.js.map +1 -1
  96. package/dist/decorators/LabelDecorator.mjs +74 -50
  97. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  98. package/dist/decorators/index.d.mts +2 -2
  99. package/dist/decorators/index.d.ts +2 -2
  100. package/dist/decorators/index.js +74 -50
  101. package/dist/decorators/index.js.map +1 -1
  102. package/dist/decorators/index.mjs +74 -50
  103. package/dist/decorators/index.mjs.map +1 -1
  104. package/dist/functions/CanvasUtility.js +2 -2
  105. package/dist/functions/CanvasUtility.js.map +1 -1
  106. package/dist/functions/CanvasUtility.mjs +2 -2
  107. package/dist/functions/CanvasUtility.mjs.map +1 -1
  108. package/dist/functions/DialogueUtility.d.mts +9 -9
  109. package/dist/functions/DialogueUtility.d.ts +9 -9
  110. package/dist/functions/DialogueUtility.js +184 -106
  111. package/dist/functions/DialogueUtility.js.map +1 -1
  112. package/dist/functions/DialogueUtility.mjs +184 -106
  113. package/dist/functions/DialogueUtility.mjs.map +1 -1
  114. package/dist/functions/FlagsUtility.js +42 -33
  115. package/dist/functions/FlagsUtility.js.map +1 -1
  116. package/dist/functions/FlagsUtility.mjs +42 -33
  117. package/dist/functions/FlagsUtility.mjs.map +1 -1
  118. package/dist/functions/GameUtility.js +42 -33
  119. package/dist/functions/GameUtility.js.map +1 -1
  120. package/dist/functions/GameUtility.mjs +42 -33
  121. package/dist/functions/GameUtility.mjs.map +1 -1
  122. package/dist/functions/ImageUtility.js +45 -36
  123. package/dist/functions/ImageUtility.js.map +1 -1
  124. package/dist/functions/ImageUtility.mjs +45 -36
  125. package/dist/functions/ImageUtility.mjs.map +1 -1
  126. package/dist/functions/SavesUtility.d.mts +4 -4
  127. package/dist/functions/SavesUtility.d.ts +4 -4
  128. package/dist/functions/SavesUtility.js +173 -111
  129. package/dist/functions/SavesUtility.js.map +1 -1
  130. package/dist/functions/SavesUtility.mjs +173 -111
  131. package/dist/functions/SavesUtility.mjs.map +1 -1
  132. package/dist/functions/TickerUtility.d.mts +2 -1
  133. package/dist/functions/TickerUtility.d.ts +2 -1
  134. package/dist/functions/TickerUtility.js +19 -15
  135. package/dist/functions/TickerUtility.js.map +1 -1
  136. package/dist/functions/TickerUtility.mjs +19 -15
  137. package/dist/functions/TickerUtility.mjs.map +1 -1
  138. package/dist/functions/index.d.mts +3 -3
  139. package/dist/functions/index.d.ts +3 -3
  140. package/dist/functions/index.js +197 -115
  141. package/dist/functions/index.js.map +1 -1
  142. package/dist/functions/index.mjs +197 -115
  143. package/dist/functions/index.mjs.map +1 -1
  144. package/dist/index.d.mts +1 -1
  145. package/dist/index.d.ts +1 -1
  146. package/dist/index.js +325 -190
  147. package/dist/index.js.map +1 -1
  148. package/dist/index.mjs +326 -191
  149. package/dist/index.mjs.map +1 -1
  150. package/dist/interface/IHistoryStep.d.mts +1 -1
  151. package/dist/interface/IHistoryStep.d.ts +1 -1
  152. package/dist/interface/ISaveData.d.mts +2 -2
  153. package/dist/interface/ISaveData.d.ts +2 -2
  154. package/dist/interface/LabelProps.d.mts +5 -0
  155. package/dist/interface/LabelProps.d.ts +5 -0
  156. package/dist/interface/LabelProps.js +4 -0
  157. package/dist/interface/LabelProps.js.map +1 -0
  158. package/dist/interface/LabelProps.mjs +3 -0
  159. package/dist/interface/LabelProps.mjs.map +1 -0
  160. package/dist/interface/export/ExportedStep.d.mts +2 -2
  161. package/dist/interface/export/ExportedStep.d.ts +2 -2
  162. package/dist/interface/export/index.d.mts +2 -2
  163. package/dist/interface/export/index.d.ts +2 -2
  164. package/dist/interface/index.d.mts +4 -4
  165. package/dist/interface/index.d.ts +4 -4
  166. package/dist/labels/BaseCanvasElementTestLabel.d.mts +2 -2
  167. package/dist/labels/BaseCanvasElementTestLabel.d.ts +2 -2
  168. package/dist/labels/BaseCanvasElementTestLabel.js +175 -111
  169. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  170. package/dist/labels/BaseCanvasElementTestLabel.mjs +176 -112
  171. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  172. package/dist/labels/CanvasEventsTestLabel.d.mts +3 -6
  173. package/dist/labels/CanvasEventsTestLabel.d.ts +3 -6
  174. package/dist/labels/CanvasEventsTestLabel.js +186 -128
  175. package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
  176. package/dist/labels/CanvasEventsTestLabel.mjs +187 -129
  177. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
  178. package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +2 -2
  179. package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +2 -2
  180. package/dist/labels/CustomTickerCanvasElementTestLabel.js +166 -108
  181. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
  182. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +166 -108
  183. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
  184. package/dist/labels/ImagesAnimationsTestLabel.d.mts +2 -2
  185. package/dist/labels/ImagesAnimationsTestLabel.d.ts +2 -2
  186. package/dist/labels/ImagesAnimationsTestLabel.js +253 -147
  187. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
  188. package/dist/labels/ImagesAnimationsTestLabel.mjs +253 -147
  189. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
  190. package/dist/labels/MarkdownTest.d.mts +2 -2
  191. package/dist/labels/MarkdownTest.d.ts +2 -2
  192. package/dist/labels/MarkdownTest.js +166 -108
  193. package/dist/labels/MarkdownTest.js.map +1 -1
  194. package/dist/labels/MarkdownTest.mjs +166 -108
  195. package/dist/labels/MarkdownTest.mjs.map +1 -1
  196. package/dist/labels/StartLabel.d.mts +2 -2
  197. package/dist/labels/StartLabel.d.ts +2 -2
  198. package/dist/labels/StartLabel.js +316 -184
  199. package/dist/labels/StartLabel.js.map +1 -1
  200. package/dist/labels/StartLabel.mjs +317 -185
  201. package/dist/labels/StartLabel.mjs.map +1 -1
  202. package/dist/labels/StepLabelTest.d.mts +9 -0
  203. package/dist/labels/StepLabelTest.d.ts +9 -0
  204. package/dist/labels/StepLabelTest.js +2758 -0
  205. package/dist/labels/StepLabelTest.js.map +1 -0
  206. package/dist/labels/StepLabelTest.mjs +2752 -0
  207. package/dist/labels/StepLabelTest.mjs.map +1 -0
  208. package/dist/labels/TestConstant.js +43 -34
  209. package/dist/labels/TestConstant.js.map +1 -1
  210. package/dist/labels/TestConstant.mjs +43 -34
  211. package/dist/labels/TestConstant.mjs.map +1 -1
  212. package/dist/labels/index.d.mts +2 -2
  213. package/dist/labels/index.d.ts +2 -2
  214. package/dist/labels/index.js +316 -184
  215. package/dist/labels/index.js.map +1 -1
  216. package/dist/labels/index.mjs +317 -185
  217. package/dist/labels/index.mjs.map +1 -1
  218. package/dist/managers/StepManager.d.mts +6 -5
  219. package/dist/managers/StepManager.d.ts +6 -5
  220. package/dist/managers/StepManager.js +163 -105
  221. package/dist/managers/StepManager.js.map +1 -1
  222. package/dist/managers/StepManager.mjs +163 -105
  223. package/dist/managers/StepManager.mjs.map +1 -1
  224. package/dist/managers/WindowManager.js +2 -2
  225. package/dist/managers/WindowManager.js.map +1 -1
  226. package/dist/managers/WindowManager.mjs +2 -2
  227. package/dist/managers/WindowManager.mjs.map +1 -1
  228. package/dist/managers/index.d.mts +2 -2
  229. package/dist/managers/index.d.ts +2 -2
  230. package/dist/managers/index.js +163 -105
  231. package/dist/managers/index.js.map +1 -1
  232. package/dist/managers/index.mjs +163 -105
  233. package/dist/managers/index.mjs.map +1 -1
  234. package/dist/types/ChoiceMenuOptionsType.d.mts +2 -2
  235. package/dist/types/ChoiceMenuOptionsType.d.ts +2 -2
  236. package/dist/types/index.d.mts +1 -1
  237. package/dist/types/index.d.ts +1 -1
  238. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -83,14 +83,15 @@ var Label = class {
83
83
  /**
84
84
  * @param id is the id of the label
85
85
  * @param steps is the list of steps that the label will perform
86
- * @param onStepRun is a function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
87
- * @param choiseIndex is the index of the choice that the label will perform
86
+ * @param props is the properties of the label
88
87
  */
89
- constructor(id, steps, onStepRun, choiseIndex) {
88
+ constructor(id, steps, props) {
90
89
  this._id = id;
91
90
  this._steps = steps;
92
- this._onStepRun = onStepRun;
93
- this._choiseIndex = choiseIndex;
91
+ this._onStepStart = props == null ? void 0 : props.onStepStart;
92
+ this._onLoadStep = props == null ? void 0 : props.onLoadStep;
93
+ this._onStepEnd = props == null ? void 0 : props.onStepEnd;
94
+ this._choiseIndex = props == null ? void 0 : props.choiseIndex;
94
95
  }
95
96
  /**
96
97
  * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
@@ -127,18 +128,32 @@ var Label = class {
127
128
  return res;
128
129
  }
129
130
  /**
130
- * Get the function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
131
+ * Is a function that will be executed in {@link Label#onStepStart} and when the user goes back to it or when the user laods a save file.
132
+ * @returns Promise<void> or void
133
+ */
134
+ get onStepStart() {
135
+ return (stepIndex, label) => __async(this, null, function* () {
136
+ if (this._onLoadStep) {
137
+ yield this._onLoadStep(stepIndex, label);
138
+ }
139
+ if (this._onStepStart) {
140
+ return yield this._onStepStart(stepIndex, label);
141
+ }
142
+ });
143
+ }
144
+ /**
145
+ * Get the function that will be executed a old step is reloaded. A step is reloaded when the user goes back to it or when the user laods a save file.
146
+ * @returns Promise<void> or void
147
+ */
148
+ get onLoadStep() {
149
+ return this._onLoadStep;
150
+ }
151
+ /**
152
+ * Is a function that will be executed when the step ends.
131
153
  * @returns Promise<void> or void
132
- * @example
133
- * ```typescript
134
- * newLabel("id", [], () => {
135
- * Assets.load('path/to/image1.png')
136
- * Assets.load('path/to/image2.png')
137
- * })
138
- * ```
139
154
  */
140
- get onStepRun() {
141
- return this._onStepRun;
155
+ get onStepEnd() {
156
+ return this._onStepEnd;
142
157
  }
143
158
  get choiseIndex() {
144
159
  return this._choiseIndex;
@@ -148,16 +163,18 @@ var Label = class {
148
163
  // src/classes/CloseLabel.ts
149
164
  var CLOSE_LABEL_ID = "__close-label-id__";
150
165
  function newCloseLabel(choiseIndex) {
151
- return new Label(CLOSE_LABEL_ID, [], void 0, choiseIndex);
166
+ return new Label(CLOSE_LABEL_ID, [], {
167
+ choiseIndex
168
+ });
152
169
  }
153
170
 
154
171
  // src/decorators/LabelDecorator.ts
155
172
  var registeredLabels = {};
156
- function newLabel(id, steps, onStepRun) {
173
+ function newLabel(id, steps, props) {
157
174
  if (registeredLabels[id]) {
158
175
  console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
159
176
  }
160
- let label = new Label(id, steps, onStepRun);
177
+ let label = new Label(id, steps, props);
161
178
  registeredLabels[id] = label;
162
179
  return label;
163
180
  }
@@ -267,8 +284,6 @@ function getMemoryContainer(element) {
267
284
  };
268
285
  }
269
286
  function setMemoryContainer(element, memory) {
270
- memory.width && (element.width = memory.width);
271
- memory.height && (element.height = memory.height);
272
287
  memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
273
288
  memory.blendMode && (element.blendMode = memory.blendMode);
274
289
  memory.tint && (element.tint = memory.tint);
@@ -301,6 +316,8 @@ function setMemoryContainer(element, memory) {
301
316
  memory.interactive && (element.interactive = memory.interactive);
302
317
  memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
303
318
  memory.hitArea && (element.hitArea = memory.hitArea);
319
+ memory.width && (element.width = memory.width);
320
+ memory.height && (element.height = memory.height);
304
321
  }
305
322
  function getTexture(imageUrl) {
306
323
  return __async(this, null, function* () {
@@ -762,12 +779,32 @@ var ChoiceMenuOption = class {
762
779
  /**
763
780
  * @param text Text to be displayed in the menu
764
781
  * @param label Label to be opened when the option is selected or the id of the label
782
+ * @param props Properties to be passed to the label and olther parameters that you can use when get all the choice menu options. It be converted to a JSON string, so it cannot contain functions or classes.
765
783
  * @param type Type of the label to be opened. @default "call"
766
- * @param props Properties to be passed to the label, when the label is called. it cannot contain functions or classes. @default {}
767
784
  */
768
- constructor(text, label, type = "call", props) {
785
+ constructor(text, label, props, type = "call") {
769
786
  /**
770
- * Properties to be passed to the label
787
+ * Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
788
+ * @example
789
+ * ```tsx
790
+ * setChoiceMenuOptions([
791
+ * new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
792
+ * ])
793
+ * return <List>
794
+ * {getChoiceMenuOptions()?.map((item, index) => {
795
+ * return (
796
+ * <ChoiceButton
797
+ * disabled={item.props.disabled}
798
+ * onClick={() => {
799
+ * afterSelectChoice(item)
800
+ * }}
801
+ * >
802
+ * {item.text}
803
+ * </ChoiceButton>
804
+ * )
805
+ * })}
806
+ * </List>
807
+ * ```
771
808
  */
772
809
  this.props = {};
773
810
  if (typeof label === "string") {
@@ -801,7 +838,27 @@ var ChoiceMenuOptionClose = class {
801
838
  */
802
839
  this.type = Close;
803
840
  /**
804
- * Properties to be passed to the label
841
+ * Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
842
+ * @example
843
+ * ```tsx
844
+ * setChoiceMenuOptions([
845
+ * new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
846
+ * ])
847
+ * return <List>
848
+ * {getChoiceMenuOptions()?.map((item, index) => {
849
+ * return (
850
+ * <ChoiceButton
851
+ * disabled={item.props.disabled}
852
+ * onClick={() => {
853
+ * afterSelectChoice(item)
854
+ * }}
855
+ * >
856
+ * {item.text}
857
+ * </ChoiceButton>
858
+ * )
859
+ * })}
860
+ * </List>
861
+ * ```
805
862
  */
806
863
  this.props = {};
807
864
  this.text = text;
@@ -873,7 +930,10 @@ function getChoiceMenuOptions() {
873
930
  }
874
931
  let label = getLabelById(option.label);
875
932
  if (label) {
876
- let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
933
+ let itemLabel = new Label(label.id, label.steps, {
934
+ onStepStart: label.onStepStart,
935
+ choiseIndex: index
936
+ });
877
937
  options.push(__spreadProps(__spreadValues({}, option), {
878
938
  label: itemLabel
879
939
  }));
@@ -1029,8 +1089,9 @@ exports.FadeAlphaTicker = __decorateClass([
1029
1089
  ], exports.FadeAlphaTicker);
1030
1090
 
1031
1091
  // src/functions/TickerUtility.ts
1032
- function updateTickerProgression(args, propertyName, progression) {
1033
- if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
1092
+ function updateTickerProgression(args, propertyName, progression, valueConvert) {
1093
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
1094
+ if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
1034
1095
  return;
1035
1096
  }
1036
1097
  if (typeof args[propertyName] === "number") {
@@ -1049,22 +1110,25 @@ function updateTickerProgression(args, propertyName, progression) {
1049
1110
  }
1050
1111
  }
1051
1112
  }
1052
- function getLinearProgression(number, progression) {
1053
- if (progression.limit !== void 0) {
1054
- if (number > progression.limit && progression.amt > 0) {
1055
- return progression.limit;
1056
- } else if (number < progression.limit && progression.amt < 0) {
1057
- return progression.limit;
1113
+ function getLinearProgression(number, progression, valueConvert) {
1114
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
1115
+ let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
1116
+ if (limit !== void 0) {
1117
+ if (number > limit && amt > 0) {
1118
+ return limit;
1119
+ } else if (number < limit && amt < 0) {
1120
+ return limit;
1058
1121
  }
1059
1122
  }
1060
- return number + progression.amt / 60;
1123
+ return number + amt;
1061
1124
  }
1062
- function getExponentialProgression(number, progression) {
1063
- if (progression.limit !== void 0) {
1064
- if (number > progression.limit && progression.percentage > 0) {
1065
- return progression.limit;
1066
- } else if (number < progression.limit && progression.percentage < 0) {
1067
- return progression.limit;
1125
+ function getExponentialProgression(number, progression, valueConvert) {
1126
+ let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
1127
+ if (limit !== void 0) {
1128
+ if (number > limit && progression.percentage > 0) {
1129
+ return limit;
1130
+ } else if (number < limit && progression.percentage < 0) {
1131
+ return limit;
1068
1132
  }
1069
1133
  }
1070
1134
  return number + number * progression.percentage;
@@ -1077,15 +1141,13 @@ exports.MoveTicker = class MoveTicker extends TickerBase {
1077
1141
  let ySpeed = 1;
1078
1142
  if (args.speed) {
1079
1143
  if (typeof args.speed === "number") {
1080
- xSpeed = args.speed;
1081
- ySpeed = args.speed;
1144
+ xSpeed = this.speedConvert(args.speed);
1145
+ ySpeed = this.speedConvert(args.speed);
1082
1146
  } else {
1083
- xSpeed = args.speed.x;
1084
- ySpeed = args.speed.y;
1147
+ xSpeed = this.speedConvert(args.speed.x);
1148
+ ySpeed = this.speedConvert(args.speed.y);
1085
1149
  }
1086
1150
  }
1087
- xSpeed /= 60;
1088
- ySpeed /= 60;
1089
1151
  let destination = args.destination;
1090
1152
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
1091
1153
  if (typeof tagToRemoveAfter2 === "string") {
@@ -1125,7 +1187,10 @@ exports.MoveTicker = class MoveTicker extends TickerBase {
1125
1187
  }
1126
1188
  });
1127
1189
  if (args.speedProgression)
1128
- updateTickerProgression(args, "speed", args.speedProgression);
1190
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
1191
+ }
1192
+ speedConvert(speed) {
1193
+ return speed / 6;
1129
1194
  }
1130
1195
  };
1131
1196
  exports.MoveTicker = __decorateClass([
@@ -1133,7 +1198,7 @@ exports.MoveTicker = __decorateClass([
1133
1198
  ], exports.MoveTicker);
1134
1199
  exports.RotateTicker = class RotateTicker extends TickerBase {
1135
1200
  fn(ticker, args, tags, tickerId) {
1136
- let speed = (args.speed === void 0 ? 1 : args.speed) / 60;
1201
+ let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
1137
1202
  let clockwise = args.clockwise === void 0 ? true : args.clockwise;
1138
1203
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
1139
1204
  if (typeof tagToRemoveAfter2 === "string") {
@@ -1161,7 +1226,10 @@ exports.RotateTicker = class RotateTicker extends TickerBase {
1161
1226
  }
1162
1227
  });
1163
1228
  if (args.speedProgression)
1164
- updateTickerProgression(args, "speed", args.speedProgression);
1229
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
1230
+ }
1231
+ speedConvert(speed) {
1232
+ return speed / 60;
1165
1233
  }
1166
1234
  };
1167
1235
  exports.RotateTicker = __decorateClass([
@@ -1173,15 +1241,13 @@ exports.ZoomTicker = class ZoomTicker extends TickerBase {
1173
1241
  let ySpeed = 0.1;
1174
1242
  if (args.speed) {
1175
1243
  if (typeof args.speed === "number") {
1176
- xSpeed = args.speed;
1177
- ySpeed = args.speed;
1244
+ xSpeed = this.speedConvert(args.speed);
1245
+ ySpeed = this.speedConvert(args.speed);
1178
1246
  } else {
1179
- xSpeed = args.speed.x;
1180
- ySpeed = args.speed.y;
1247
+ xSpeed = this.speedConvert(args.speed.x);
1248
+ ySpeed = this.speedConvert(args.speed.y);
1181
1249
  }
1182
1250
  }
1183
- xSpeed /= 60;
1184
- ySpeed /= 60;
1185
1251
  let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
1186
1252
  if (typeof tagToRemoveAfter2 === "string") {
1187
1253
  tagToRemoveAfter2 = [tagToRemoveAfter2];
@@ -1248,7 +1314,10 @@ exports.ZoomTicker = class ZoomTicker extends TickerBase {
1248
1314
  }
1249
1315
  });
1250
1316
  if (args.speedProgression)
1251
- updateTickerProgression(args, "speed", args.speedProgression);
1317
+ updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
1318
+ }
1319
+ speedConvert(speed) {
1320
+ return speed / 60;
1252
1321
  }
1253
1322
  onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
1254
1323
  GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
@@ -1271,7 +1340,7 @@ var ZoomInOutTicker = class extends exports.ZoomTicker {
1271
1340
  };
1272
1341
 
1273
1342
  // src/constants.ts
1274
- var PIXIVN_VERSION = "0.6.3";
1343
+ var PIXIVN_VERSION = "0.6.5";
1275
1344
  var Repeat = "repeat";
1276
1345
  function Pause(duration) {
1277
1346
  return {
@@ -1456,14 +1525,14 @@ function zoomIn(_0, _1) {
1456
1525
  } else {
1457
1526
  canvasElement = image;
1458
1527
  }
1459
- if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
1460
- yield canvasElement.load();
1461
- }
1462
1528
  let container = new CanvasContainer();
1463
1529
  container.addChild(canvasElement);
1464
1530
  container.height = GameWindowManager.canvasHeight;
1465
1531
  container.width = GameWindowManager.canvasWidth;
1466
1532
  GameWindowManager.addCanvasElement(tag, container);
1533
+ if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
1534
+ yield canvasElement.load();
1535
+ }
1467
1536
  if (props.direction == "up") {
1468
1537
  container.pivot.y = GameWindowManager.canvasHeight;
1469
1538
  container.pivot.x = GameWindowManager.canvasWidth / 2;
@@ -1551,13 +1620,17 @@ function getSaveJson() {
1551
1620
  return JSON.stringify(saveData);
1552
1621
  }
1553
1622
  function loadSaveData(data, navigate) {
1554
- GameStepManager.import(data.stepData);
1555
- GameStorageManager.import(data.storageData);
1556
- GameWindowManager.import(data.canvasData);
1557
- navigate(data.path);
1623
+ return __async(this, null, function* () {
1624
+ yield GameStepManager.import(data.stepData);
1625
+ GameStorageManager.import(data.storageData);
1626
+ GameWindowManager.import(data.canvasData);
1627
+ navigate(data.path);
1628
+ });
1558
1629
  }
1559
1630
  function loadSaveJson(dataString, navigate) {
1560
- loadSaveData(jsonToSaveData(dataString), navigate);
1631
+ return __async(this, null, function* () {
1632
+ yield loadSaveData(jsonToSaveData(dataString), navigate);
1633
+ });
1561
1634
  }
1562
1635
  function jsonToSaveData(json) {
1563
1636
  return JSON.parse(json);
@@ -2512,6 +2585,16 @@ var _GameStepManager = class _GameStepManager {
2512
2585
  static set originalStepData(value) {
2513
2586
  _GameStepManager._originalStepData = createExportableElement(value);
2514
2587
  }
2588
+ static get currentStepData() {
2589
+ let currentStepData = {
2590
+ path: window.location.pathname,
2591
+ storage: GameStorageManager.export(),
2592
+ canvas: GameWindowManager.export(),
2593
+ labelIndex: _GameStepManager.currentLabelStepIndex || 0,
2594
+ openedLabels: createExportableElement(_GameStepManager._openedLabels)
2595
+ };
2596
+ return currentStepData;
2597
+ }
2515
2598
  /* Edit History Methods */
2516
2599
  /**
2517
2600
  * Add a label to the history.
@@ -2519,19 +2602,13 @@ var _GameStepManager = class _GameStepManager {
2519
2602
  */
2520
2603
  static addStepHistory(step, choiseMade) {
2521
2604
  let stepHistory = getStepSha1(step);
2522
- let historyStep = {
2523
- path: window.location.pathname,
2524
- storage: GameStorageManager.export(),
2525
- canvas: GameWindowManager.export(),
2526
- labelIndex: _GameStepManager.currentLabelStepIndex || 0,
2527
- openedLabels: createExportableElement(_GameStepManager._openedLabels)
2528
- };
2605
+ let currentStepData = _GameStepManager.currentStepData;
2529
2606
  if (_GameStepManager.originalStepData) {
2530
- if (_GameStepManager.originalStepData.openedLabels.length === historyStep.openedLabels.length) {
2607
+ if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
2531
2608
  try {
2532
2609
  let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
2533
- let historyStepOpenedLabelsString = JSON.stringify(historyStep.openedLabels);
2534
- if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === historyStep.path && _GameStepManager.originalStepData.labelIndex === historyStep.labelIndex) {
2610
+ let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
2611
+ if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
2535
2612
  return;
2536
2613
  }
2537
2614
  } catch (e) {
@@ -2539,7 +2616,7 @@ var _GameStepManager = class _GameStepManager {
2539
2616
  }
2540
2617
  }
2541
2618
  }
2542
- let data = deepDiff.diff(_GameStepManager.originalStepData, historyStep);
2619
+ let data = deepDiff.diff(_GameStepManager.originalStepData, currentStepData);
2543
2620
  if (data) {
2544
2621
  let dialoge = void 0;
2545
2622
  let requiredChoices = void 0;
@@ -2558,7 +2635,7 @@ var _GameStepManager = class _GameStepManager {
2558
2635
  index: _GameStepManager.lastStepIndex,
2559
2636
  choiceIndexMade: choiseMade
2560
2637
  });
2561
- _GameStepManager.originalStepData = historyStep;
2638
+ _GameStepManager.originalStepData = currentStepData;
2562
2639
  }
2563
2640
  _GameStepManager.increaseLastStepIndex();
2564
2641
  }
@@ -2649,6 +2726,9 @@ var _GameStepManager = class _GameStepManager {
2649
2726
  console.warn("[Pixi'VN] The player must make a choice");
2650
2727
  return;
2651
2728
  }
2729
+ if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
2730
+ yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
2731
+ }
2652
2732
  _GameStepManager.increaseCurrentStepIndex();
2653
2733
  return yield _GameStepManager.runCurrentStep(props, choiseMade);
2654
2734
  });
@@ -2673,6 +2753,10 @@ var _GameStepManager = class _GameStepManager {
2673
2753
  return;
2674
2754
  }
2675
2755
  if (currentLabel.steps.length > currentLabelStepIndex) {
2756
+ let onStepRun = currentLabel.onStepStart;
2757
+ if (onStepRun) {
2758
+ yield onStepRun(currentLabelStepIndex, currentLabel);
2759
+ }
2676
2760
  let step = currentLabel.steps[currentLabelStepIndex];
2677
2761
  let result = yield step(props);
2678
2762
  _GameStepManager.addStepHistory(step, choiseMade);
@@ -2737,6 +2821,9 @@ var _GameStepManager = class _GameStepManager {
2737
2821
  if (!tempLabel) {
2738
2822
  throw new Error(`[Pixi'VN] Label ${labelId} not found`);
2739
2823
  }
2824
+ if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
2825
+ yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
2826
+ }
2740
2827
  _GameStepManager.pushNewLabel(tempLabel.id);
2741
2828
  } catch (e) {
2742
2829
  console.error("[Pixi'VN] Error calling label", e);
@@ -2795,6 +2882,9 @@ var _GameStepManager = class _GameStepManager {
2795
2882
  if (!tempLabel) {
2796
2883
  throw new Error(`[Pixi'VN] Label ${labelId} not found`);
2797
2884
  }
2885
+ if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
2886
+ yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
2887
+ }
2798
2888
  _GameStepManager.pushNewLabel(tempLabel.id);
2799
2889
  } catch (e) {
2800
2890
  console.error("[Pixi'VN] Error jumping label", e);
@@ -2900,24 +2990,29 @@ var _GameStepManager = class _GameStepManager {
2900
2990
  * ```
2901
2991
  */
2902
2992
  static goBack(navigate, steps = 1) {
2903
- if (steps <= 0) {
2904
- console.warn("[Pixi'VN] Steps must be greater than 0");
2905
- return;
2906
- }
2907
- if (_GameStepManager._stepsHistory.length <= 1) {
2908
- console.warn("[Pixi'VN] No steps to go back");
2909
- return;
2910
- }
2911
- let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
2912
- if (restoredStep) {
2913
- _GameStepManager._originalStepData = restoredStep;
2914
- _GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
2915
- GameStorageManager.import(createExportableElement(restoredStep.storage));
2916
- GameWindowManager.import(createExportableElement(restoredStep.canvas));
2917
- navigate(restoredStep.path);
2918
- } else {
2919
- console.error("[Pixi'VN] Error going back");
2920
- }
2993
+ return __async(this, null, function* () {
2994
+ if (steps <= 0) {
2995
+ console.warn("[Pixi'VN] Steps must be greater than 0");
2996
+ return;
2997
+ }
2998
+ if (_GameStepManager._stepsHistory.length <= 1) {
2999
+ console.warn("[Pixi'VN] No steps to go back");
3000
+ return;
3001
+ }
3002
+ let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
3003
+ if (restoredStep) {
3004
+ _GameStepManager._originalStepData = restoredStep;
3005
+ _GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
3006
+ if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
3007
+ yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
3008
+ }
3009
+ GameStorageManager.import(createExportableElement(restoredStep.storage));
3010
+ GameWindowManager.import(createExportableElement(restoredStep.canvas));
3011
+ navigate(restoredStep.path);
3012
+ } else {
3013
+ console.error("[Pixi'VN] Error going back");
3014
+ }
3015
+ });
2921
3016
  }
2922
3017
  static goBackInternal(steps, restoredStep) {
2923
3018
  if (steps <= 0) {
@@ -2979,38 +3074,45 @@ var _GameStepManager = class _GameStepManager {
2979
3074
  * @param dataString The history in a JSON string.
2980
3075
  */
2981
3076
  static importJson(dataString) {
2982
- _GameStepManager.import(JSON.parse(dataString));
3077
+ return __async(this, null, function* () {
3078
+ yield _GameStepManager.import(JSON.parse(dataString));
3079
+ });
2983
3080
  }
2984
3081
  /**
2985
3082
  * Import the history from an object.
2986
3083
  * @param data The history in an object.
2987
3084
  */
2988
3085
  static import(data) {
2989
- _GameStepManager.clear();
2990
- try {
2991
- if (data.hasOwnProperty("stepsHistory")) {
2992
- _GameStepManager._stepsHistory = data["stepsHistory"];
2993
- } else {
2994
- console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
2995
- }
2996
- if (data.hasOwnProperty("openedLabels")) {
2997
- _GameStepManager._openedLabels = data["openedLabels"];
2998
- } else {
2999
- console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
3000
- }
3001
- if (data.hasOwnProperty("lastStepIndex")) {
3002
- _GameStepManager._lastStepIndex = data["lastStepIndex"];
3003
- } else {
3004
- console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
3005
- }
3006
- if (data.hasOwnProperty("originalStepData")) {
3007
- _GameStepManager._originalStepData = data["originalStepData"];
3008
- } else {
3009
- console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
3086
+ return __async(this, null, function* () {
3087
+ _GameStepManager.clear();
3088
+ try {
3089
+ if (data.hasOwnProperty("stepsHistory")) {
3090
+ _GameStepManager._stepsHistory = data["stepsHistory"];
3091
+ } else {
3092
+ console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
3093
+ }
3094
+ if (data.hasOwnProperty("openedLabels")) {
3095
+ _GameStepManager._openedLabels = data["openedLabels"];
3096
+ } else {
3097
+ console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
3098
+ }
3099
+ if (data.hasOwnProperty("lastStepIndex")) {
3100
+ _GameStepManager._lastStepIndex = data["lastStepIndex"];
3101
+ } else {
3102
+ console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
3103
+ }
3104
+ if (data.hasOwnProperty("originalStepData")) {
3105
+ _GameStepManager._originalStepData = data["originalStepData"];
3106
+ } else {
3107
+ console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
3108
+ }
3109
+ if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
3110
+ yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
3111
+ }
3112
+ } catch (e) {
3113
+ console.error("[Pixi'VN] Error importing data", e);
3010
3114
  }
3011
- } catch (e) {
3012
- console.error("[Pixi'VN] Error importing data", e);
3013
- }
3115
+ });
3014
3116
  }
3015
3117
  };
3016
3118
  /**
@@ -3186,7 +3288,7 @@ var DialogueBaseModel = class {
3186
3288
  var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
3187
3289
  name: "Juliette",
3188
3290
  age: 25,
3189
- icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media&token=5856ae7b-d99e-4563-86ec-cbc48cc9c6b4",
3291
+ icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",
3190
3292
  color: "#ac0086"
3191
3293
  });
3192
3294
  saveCharacter(juliette);
@@ -3231,10 +3333,16 @@ var baseCanvasElementTestLabel = newLabel(
3231
3333
  removeCanvasElement("container");
3232
3334
  setDialogue({
3233
3335
  character: juliette,
3234
- text: `Here's what's going to happen: I'm going to create some text elements with different styles and put them on the stage.
3336
+ text: `Here's what's going to happen: I'm going to create some CanvasText with different styles and put them on the stage.
3235
3337
  But it will generate a warn message, because the FillGradient or FillPattern has not yet been supported by the Pixi\u2019VN ( you can see the status of the issue here: [#76](https://github.com/DRincs-Productions/pixi-vn/issues/76)).`
3236
3338
  });
3237
- const basicText = new CanvasText({ text: "Basic text in pixi" });
3339
+ const basicStyle = new pixi_js.TextStyle({
3340
+ fill: "#ffffff"
3341
+ });
3342
+ const basicText = new CanvasText({
3343
+ text: "Basic text in pixi",
3344
+ style: basicStyle
3345
+ });
3238
3346
  basicText.x = 50;
3239
3347
  basicText.y = 100;
3240
3348
  GameWindowManager.addCanvasElement("basicText", basicText);
@@ -3252,7 +3360,7 @@ But it will generate a warn message, because the FillGradient or FillPattern has
3252
3360
  fill: { fill },
3253
3361
  stroke: { color: "#4a1850", width: 5, join: "round" },
3254
3362
  dropShadow: {
3255
- color: "#000000",
3363
+ color: "#ff5f74",
3256
3364
  blur: 4,
3257
3365
  angle: Math.PI / 6,
3258
3366
  distance: 6
@@ -3305,36 +3413,30 @@ EventTest1 = __decorateClass([
3305
3413
  eventDecorator("___pixi_vn_canvas_events_test_event1___")
3306
3414
  ], EventTest1);
3307
3415
  var EventTest2 = class extends CanvasEvent {
3308
- constructor() {
3309
- super(...arguments);
3310
- this.textureButtonDown = pixi_js.Texture.from("https://pixijs.com/assets/button_down.png");
3311
- this.textureButtonOver = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
3312
- this.textureButton = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
3313
- }
3314
3416
  fn(event, sprite) {
3315
3417
  if (event === "pointerdown") {
3316
3418
  sprite.isdown = true;
3317
- sprite.texture = this.textureButtonDown;
3419
+ sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_down.png");
3318
3420
  sprite.alpha = 1;
3319
3421
  } else if (event === "pointerup" || event === "pointerupoutside") {
3320
3422
  sprite.isdown = false;
3321
3423
  if (sprite.isOver) {
3322
- sprite.texture = this.textureButtonOver;
3424
+ sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
3323
3425
  } else {
3324
- sprite.texture = this.textureButton;
3426
+ sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
3325
3427
  }
3326
3428
  } else if (event === "pointerover") {
3327
3429
  sprite.isOver = true;
3328
3430
  if (sprite.isdown) {
3329
3431
  return;
3330
3432
  }
3331
- sprite.texture = this.textureButtonOver;
3433
+ sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button_over.png");
3332
3434
  } else if (event === "pointerout") {
3333
3435
  sprite.isOver = false;
3334
3436
  if (sprite.isdown) {
3335
3437
  return;
3336
3438
  }
3337
- sprite.texture = this.textureButton;
3439
+ sprite.texture = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
3338
3440
  }
3339
3441
  }
3340
3442
  };
@@ -3356,6 +3458,7 @@ var canvasEventsTestLabel = newLabel(
3356
3458
  });
3357
3459
  const texture = yield pixi_js.Assets.load(bunnyImage);
3358
3460
  const sprite = CanvasSprite.from(texture);
3461
+ sprite.scale.set(3);
3359
3462
  sprite.anchor.set(0.5);
3360
3463
  sprite.x = GameWindowManager.screen.width / 2;
3361
3464
  sprite.y = GameWindowManager.screen.height / 2;
@@ -3370,17 +3473,12 @@ var canvasEventsTestLabel = newLabel(
3370
3473
  character: juliette,
3371
3474
  text: `This is the test of buttons in a canvas. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`
3372
3475
  });
3373
- yield pixi_js.Assets.load([
3374
- "https://pixijs.com/assets/bg_button.jpg",
3375
- "https://pixijs.com/assets/button.png",
3376
- "https://pixijs.com/assets/button_down.png",
3377
- "https://pixijs.com/assets/button_over.png"
3378
- ]);
3379
- const background = CanvasSprite.from("https://pixijs.com/assets/bg_button.jpg");
3476
+ const backgroundT = yield pixi_js.Assets.load("https://pixijs.com/assets/bg_button.jpg");
3477
+ const background = new CanvasSprite(backgroundT);
3380
3478
  background.width = GameWindowManager.screen.width;
3381
3479
  background.height = GameWindowManager.screen.height;
3382
3480
  GameWindowManager.addCanvasElement("bg", background);
3383
- const textureButton = pixi_js.Texture.from("https://pixijs.com/assets/button.png");
3481
+ const textureButton = yield pixi_js.Assets.load("https://pixijs.com/assets/button.png");
3384
3482
  const buttons = [];
3385
3483
  const buttonPositions = [175, 75, 655, 75, 410, 325, 150, 465, 685, 445];
3386
3484
  for (let i = 0; i < 5; i++) {
@@ -3400,7 +3498,17 @@ var canvasEventsTestLabel = newLabel(
3400
3498
  buttons[4].scale.set(0.8, 1.2);
3401
3499
  buttons[4].rotation = Math.PI;
3402
3500
  })
3403
- ]
3501
+ ],
3502
+ {
3503
+ onLoadStep: () => __async(void 0, null, function* () {
3504
+ yield pixi_js.Assets.load([
3505
+ "https://pixijs.com/assets/bg_button.jpg",
3506
+ "https://pixijs.com/assets/button.png",
3507
+ "https://pixijs.com/assets/button_down.png",
3508
+ "https://pixijs.com/assets/button_over.png"
3509
+ ]);
3510
+ })
3511
+ }
3404
3512
  );
3405
3513
  var AlienTintingTest = class extends CanvasSprite {
3406
3514
  constructor() {
@@ -3520,13 +3628,13 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
3520
3628
  () => __async(void 0, null, function* () {
3521
3629
  setDialogue({ character: juliette, text: "Here's what they can do." });
3522
3630
  setChoiceMenuOptions([
3523
- new ChoiceMenuOption("Dissolve effect", imagesDissolveTest),
3524
- new ChoiceMenuOption("Fade effect", imagesFadeTest),
3525
- new ChoiceMenuOption("Rotate", imagesRotateTest),
3526
- new ChoiceMenuOption("Move", imagesMoveTest),
3527
- new ChoiceMenuOption("Zoom", imagesZoomTest),
3528
- new ChoiceMenuOption("Move in/out", imagesMoveInOutTest),
3529
- new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest),
3631
+ new ChoiceMenuOption("Dissolve effect", imagesDissolveTest, {}),
3632
+ new ChoiceMenuOption("Fade effect", imagesFadeTest, {}),
3633
+ new ChoiceMenuOption("Rotate", imagesRotateTest, {}),
3634
+ new ChoiceMenuOption("Move", imagesMoveTest, {}),
3635
+ new ChoiceMenuOption("Zoom", imagesZoomTest, {}),
3636
+ new ChoiceMenuOption("Move in/out", imagesMoveInOutTest, {}),
3637
+ new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest, {}),
3530
3638
  new ChoiceMenuOptionClose("Cancel", true)
3531
3639
  ]);
3532
3640
  }),
@@ -3636,8 +3744,8 @@ var imagesRotateTest = newLabel("___pixi_vn_images_rotate_test___", [
3636
3744
  text: `Here's what's going to happen:
3637
3745
  - ${eggHeadName} will rotate with a anchor set to 0.
3638
3746
  - ${flowerTopName} will rotate with a anchor set to 0.5 and a exponential speed progression.
3639
- - ${helmlokName} will rotate with a anchor set to 0.5, rotate 2 times, move to the right, rotate 5 times, and repeat.
3640
- - ${skullyName} will rotate with a anchor set to 1, rotate 3 times, wait for 0.5 seconds, rotate 7 times.`
3747
+ - ${helmlokName} will rotate with a anchor set to 0.5, rotate clockwise for 2 seconds, rotate counterclockwise with a exponential (-0.05) speed progression, and when it reaches 0, it will repeat.
3748
+ - ${skullyName} will rotate with a anchor set to 1, rotate 3 seconds clockwise, wait for 0.5 seconds, and rotate 7 seconds counterclockwise.`
3641
3749
  });
3642
3750
  let eggHead = GameWindowManager.getCanvasElement("eggHead");
3643
3751
  if (eggHead)
@@ -3690,10 +3798,10 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
3690
3798
  setDialogue({
3691
3799
  character: juliette,
3692
3800
  text: `Here's what's going to happen:
3693
- - ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 0.4.
3694
- - ${flowerTopName} will move to { x: 500, y: 300 } with a speed of 0.3.
3695
- - ${helmlokName} will move to the right with a speed of 20 and a linear speed progression of -0.2, and then move to the left with a speed of 0.1 and a linear speed progression of 0.05.
3696
- - ${skullyName} will move to { x: 500, y: 500 } with a speed of 0.5, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 0.5.`
3801
+ - ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
3802
+ - ${flowerTopName} will move to { x: 500, y: 300 } with a speed of 18.
3803
+ - ${helmlokName} will move to { x: 100, y: 500 } with a speed of 150 and a linear speed progression of -2 ( limit 10 ), and then move to { x: 1700, y: 500 } with a speed of 10 and a linear speed progression of 2 ( limit 150 ), and repeat.
3804
+ - ${skullyName} will move to { x: 500, y: 500 } with a speed of 40, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 40.`
3697
3805
  });
3698
3806
  GameWindowManager.addTicker("eggHead", new exports.MoveTicker({
3699
3807
  destination: { x: 500, y: 100 },
@@ -3706,25 +3814,25 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
3706
3814
  GameWindowManager.addTickersSteps("helmlok", [
3707
3815
  new exports.MoveTicker({
3708
3816
  destination: { x: 100, y: 500 },
3709
- speed: 1200,
3710
- speedProgression: { type: "linear", amt: -12, limit: 60 }
3817
+ speed: 150,
3818
+ speedProgression: { type: "linear", amt: -2, limit: 10 }
3711
3819
  }),
3712
3820
  new exports.MoveTicker({
3713
3821
  destination: { x: 1700, y: 500 },
3714
- speed: 6,
3715
- speedProgression: { type: "linear", amt: 3 }
3822
+ speed: 10,
3823
+ speedProgression: { type: "linear", amt: 2, limit: 150 }
3716
3824
  }),
3717
3825
  Repeat
3718
3826
  ]);
3719
3827
  GameWindowManager.addTickersSteps("skully", [
3720
3828
  new exports.MoveTicker({
3721
3829
  destination: { x: 500, y: 500 },
3722
- speed: 60
3830
+ speed: 40
3723
3831
  }),
3724
3832
  Pause(0.5),
3725
3833
  new exports.MoveTicker({
3726
3834
  destination: { x: 100, y: 100 },
3727
- speed: 60
3835
+ speed: 40
3728
3836
  })
3729
3837
  ]);
3730
3838
  }
@@ -3786,37 +3894,45 @@ var imagesMoveInOutTest = newLabel("___pixi_vn_images_move_in_out_test___", [
3786
3894
  setDialogue({
3787
3895
  character: juliette,
3788
3896
  text: `Here's what's going to happen:
3789
- - ${eggHeadName} will move in from the top with a speed of 800. If you go next, ${eggHeadName} will move out from the bottom with a speed of 800.
3790
- - ${flowerTopName} will move in from the right with a speed of 800 and a speed progression of 0.02. If you go next, ${flowerTopName} will move out from the left with a speed of 800 and a speed progression of 0.02.
3791
- - ${helmlokName} will move in from the left with a speed of 800. If you go next, ${helmlokName} will move out from the right with a speed of 800.
3792
- - ${skullyName} will move in from the bottom with a speed of 800 and a speed progression of 0.02. If you go next, ${skullyName} will move out from the top with a speed of 800 and a speed progression of 0.02.`
3897
+ - ${eggHeadName} will move in from the top with a speed of 80. If you go next, ${eggHeadName} will move out from the bottom with a speed of 80.
3898
+ - ${flowerTopName} will move in from the right with a speed of 80 and a speed progression of 0.02. If you go next, ${flowerTopName} will move out from the left with a speed of 80 and a speed progression of 0.02.
3899
+ - ${helmlokName} will move in from the left with a speed of 80. If you go next, ${helmlokName} will move out from the right with a speed of 80.
3900
+ - ${skullyName} will move in from the bottom with a speed of 80 and a speed progression of 0.02. If you go next, ${skullyName} will move out from the top with a speed of 80 and a speed progression of 0.02.`
3793
3901
  });
3794
3902
  let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
3795
3903
  let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
3796
3904
  let helmlok = new CanvasImage({ x: 100, y: 300 }, helmlokImage);
3797
3905
  let skully = new CanvasImage({ x: 300, y: 300 }, skullyImage);
3798
- moveIn("eggHead", eggHead, { speed: 800, direction: "down" });
3906
+ moveIn("eggHead", eggHead, { speed: 80, direction: "down" });
3799
3907
  moveIn("flowerTop", flowerTop, {
3800
- speed: 800,
3908
+ speed: 80,
3801
3909
  direction: "left",
3802
3910
  speedProgression: { type: "exponential", percentage: 0.02 }
3803
3911
  });
3804
- moveIn("helmlok", helmlok, { speed: 800, direction: "right" });
3912
+ moveIn("helmlok", helmlok, { speed: 80, direction: "right" });
3805
3913
  moveIn("skully", skully, {
3806
- speed: 800,
3914
+ speed: 80,
3807
3915
  direction: "up",
3808
3916
  speedProgression: { type: "exponential", percentage: 0.02 }
3809
3917
  });
3810
3918
  }),
3811
3919
  () => {
3812
- moveOut("eggHead", { speed: 800, direction: "down" });
3813
- moveOut("flowerTop", { speed: 800, direction: "left" });
3814
- moveOut("helmlok", { speed: 800, direction: "right" });
3815
- moveOut("skully", { speed: 800, direction: "up" });
3920
+ moveOut("eggHead", { speed: 80, direction: "down" });
3921
+ moveOut("flowerTop", { speed: 80, direction: "left" });
3922
+ moveOut("helmlok", { speed: 80, direction: "right" });
3923
+ moveOut("skully", { speed: 80, direction: "up" });
3816
3924
  }
3817
3925
  ]);
3818
3926
  var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
3819
3927
  () => __async(void 0, null, function* () {
3928
+ setDialogue({
3929
+ character: juliette,
3930
+ text: `Here's what's going to happen:
3931
+ - ${eggHeadName} will zoom in with a speed of 3. If you go next, ${eggHeadName} will zoom out with a speed of 3.
3932
+ - ${flowerTopName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${flowerTopName} will zoom out with a speed of 3.
3933
+ - ${helmlokName} will zoom in with a speed of 3. If you go next, ${helmlokName} will zoom out with a speed of 1.
3934
+ - ${skullyName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${skullyName} will zoom out with a speed of 3 and a speed progression of 0.02.`
3935
+ });
3820
3936
  GameWindowManager.removeCanvasElements();
3821
3937
  let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
3822
3938
  let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
@@ -3842,7 +3958,7 @@ var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
3842
3958
  speedProgression: { type: "exponential", percentage: 0.02 }
3843
3959
  });
3844
3960
  zoomOut("flowerTop", { speed: 3, direction: "left" });
3845
- zoomOut("helmlok", { speed: 3, direction: "right" });
3961
+ zoomOut("helmlok", { speed: 1, direction: "right" });
3846
3962
  zoomOut("skully", {
3847
3963
  speed: 3,
3848
3964
  direction: "up",
@@ -3924,6 +4040,23 @@ Footer
3924
4040
  })
3925
4041
  ]);
3926
4042
 
4043
+ // src/labels/StepLabelTest.ts
4044
+ var STEP_LABEL_TEST_LABEL = "___pixi_vn_step_label_test___";
4045
+ var stepLabelTestLAbel = newLabel(STEP_LABEL_TEST_LABEL, [
4046
+ () => __async(void 0, null, function* () {
4047
+ setDialogue({ character: juliette, text: `Pixi'VN manages the succession of "screens" with steps. Each step is a function that can be asynchronous.` });
4048
+ }),
4049
+ () => __async(void 0, null, function* () {
4050
+ setDialogue({ character: juliette, text: "The labels are containers of steps, they are used to organize the steps in a more readable way. For start a steps sequence, you must call or jump to a label." });
4051
+ }),
4052
+ () => __async(void 0, null, function* () {
4053
+ setDialogue({ character: juliette, text: "It is also possible to ask the player to make a choice." });
4054
+ }),
4055
+ () => __async(void 0, null, function* () {
4056
+ setDialogue({ character: juliette, text: "Browsing through available tests is one way to test the steps/labels system." });
4057
+ })
4058
+ ]);
4059
+
3927
4060
  // src/labels/StartLabel.ts
3928
4061
  var pixivnTestStartLabel = newLabel(
3929
4062
  "___pixi_vn_example_start_label___",
@@ -3932,25 +4065,25 @@ var pixivnTestStartLabel = newLabel(
3932
4065
  let currentTimeName = "";
3933
4066
  const hour = (/* @__PURE__ */ new Date()).getHours();
3934
4067
  if (hour >= 5 && hour < 12) {
3935
- currentTimeName = "morning";
4068
+ currentTimeName = "morning\u{1F505}";
3936
4069
  } else if (hour >= 12 && hour < 18) {
3937
- currentTimeName = "afternoon";
4070
+ currentTimeName = "afternoon\u{1F506}";
3938
4071
  } else if (hour >= 18 && hour < 22) {
3939
- currentTimeName = "evening";
4072
+ currentTimeName = "evening\u26C5";
3940
4073
  } else {
3941
- currentTimeName = "night";
4074
+ currentTimeName = "night\u{1F319}";
3942
4075
  }
3943
4076
  setDialogue({ character: juliette, text: `Good ${currentTimeName}! I'm ${juliette.name}, your virtual assistant. I'm here to help you with your tests.` });
3944
4077
  },
3945
- () => setDialogue({ character: juliette, text: `You are running the Pixi\u2019VN test. This test will guide you through the different features of the library.` }),
4078
+ () => setDialogue({ character: juliette, text: `You are running the Pixi\u2019VN v${PIXIVN_VERSION} test. This test will guide you through the different features of the library.` }),
3946
4079
  (props) => GameStepManager.jumpLabel(pixivnTestStartLabel2, props)
3947
4080
  ]
3948
4081
  );
3949
- var openWiki = newLabel(
3950
- "___pixi_vn_open_wiki___",
4082
+ var openLink = newLabel(
4083
+ "___pixi_vn_open_link___",
3951
4084
  [
3952
4085
  (props) => {
3953
- window.open("https://pixi-vn.web.app/");
4086
+ window.open(props.link);
3954
4087
  GameStepManager.goNext(props);
3955
4088
  }
3956
4089
  ]
@@ -3963,12 +4096,14 @@ var pixivnTestStartLabel2 = newLabel(
3963
4096
  GameWindowManager.clear();
3964
4097
  setDialogue({ character: juliette, text: "Which test would you like to start with?" });
3965
4098
  setChoiceMenuOptions([
3966
- new ChoiceMenuOption("Open Pixi\u2019VN Wiki", openWiki),
3967
- new ChoiceMenuOption("Images, Transitions and Animations Test", imagesAnimationsTest),
3968
- new ChoiceMenuOption("Canvas Events Test Label", canvasEventsTestLabel),
3969
- new ChoiceMenuOption("Base Canvas Element Test", baseCanvasElementTestLabel),
3970
- new ChoiceMenuOption("Custom Ticker Canvas Element Test", customTickerCanvasElementTestLabel),
3971
- new ChoiceMenuOption("Markdown Test", markdownTest)
4099
+ new ChoiceMenuOption("Open Pixi\u2019VN Wiki", openLink, { link: "https://pixi-vn.web.app/" }),
4100
+ new ChoiceMenuOption("Images, Transitions and Animations Test", imagesAnimationsTest, {}),
4101
+ new ChoiceMenuOption("Canvas Events Test", canvasEventsTestLabel, {}),
4102
+ new ChoiceMenuOption("Base Canvas Element Test", baseCanvasElementTestLabel, {}),
4103
+ new ChoiceMenuOption("Custom Ticker Canvas Element Test", customTickerCanvasElementTestLabel, {}),
4104
+ new ChoiceMenuOption("Steps and Labels Test", stepLabelTestLAbel, {}),
4105
+ new ChoiceMenuOption("Markdown Test", markdownTest, {}),
4106
+ new ChoiceMenuOption("Open Pixi\u2019VN Github Issues", openLink, { link: "https://github.com/DRincs-Productions/pixi-vn/issues" })
3972
4107
  ]);
3973
4108
  },
3974
4109
  (props) => GameStepManager.jumpLabel(RESTART_TEST_LABEL, props)