@drincs/pixi-vn 0.9.9 → 0.9.10

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 (187) hide show
  1. package/dist/{ContainerChild-AjuVp3wW.d.ts → ContainerChild-Cnp3QQhi.d.ts} +6 -1
  2. package/dist/{ContainerChild-BUFxM6Ya.d.cts → ContainerChild-DcpXQmd7.d.cts} +6 -1
  3. package/dist/{chunk-RGKEAZTY.js → chunk-7MKMIPPX.js} +73 -25
  4. package/dist/{chunk-V7WJOX65.js → chunk-HCINNHUZ.js} +1 -1
  5. package/dist/classes/CharacterBaseModel.cjs +70 -41
  6. package/dist/classes/CharacterBaseModel.js +5 -5
  7. package/dist/classes/CharacterStoredClass.cjs +70 -41
  8. package/dist/classes/CharacterStoredClass.js +5 -5
  9. package/dist/classes/ChoiceMenuOption.cjs +70 -41
  10. package/dist/classes/ChoiceMenuOption.js +5 -5
  11. package/dist/classes/Sound.cjs +70 -41
  12. package/dist/classes/Sound.js +5 -5
  13. package/dist/classes/StoredClassModel.cjs +70 -41
  14. package/dist/classes/StoredClassModel.js +5 -5
  15. package/dist/classes/canvas/AdditionalPositions.cjs +70 -41
  16. package/dist/classes/canvas/AdditionalPositions.js +5 -5
  17. package/dist/classes/canvas/CanvasBaseItem.d.cts +1 -1
  18. package/dist/classes/canvas/CanvasBaseItem.d.ts +1 -1
  19. package/dist/classes/canvas/Container.cjs +70 -41
  20. package/dist/classes/canvas/Container.d.cts +1 -1
  21. package/dist/classes/canvas/Container.d.ts +1 -1
  22. package/dist/classes/canvas/Container.js +5 -5
  23. package/dist/classes/canvas/ImageContainer.cjs +70 -41
  24. package/dist/classes/canvas/ImageContainer.d.cts +1 -1
  25. package/dist/classes/canvas/ImageContainer.d.ts +1 -1
  26. package/dist/classes/canvas/ImageContainer.js +5 -5
  27. package/dist/classes/canvas/ImageSprite.cjs +70 -41
  28. package/dist/classes/canvas/ImageSprite.d.cts +1 -1
  29. package/dist/classes/canvas/ImageSprite.d.ts +1 -1
  30. package/dist/classes/canvas/ImageSprite.js +5 -5
  31. package/dist/classes/canvas/Sprite.cjs +70 -41
  32. package/dist/classes/canvas/Sprite.d.cts +1 -1
  33. package/dist/classes/canvas/Sprite.d.ts +1 -1
  34. package/dist/classes/canvas/Sprite.js +5 -5
  35. package/dist/classes/canvas/Text.cjs +70 -41
  36. package/dist/classes/canvas/Text.d.cts +1 -1
  37. package/dist/classes/canvas/Text.d.ts +1 -1
  38. package/dist/classes/canvas/Text.js +5 -5
  39. package/dist/classes/canvas/VideoSprite.cjs +70 -41
  40. package/dist/classes/canvas/VideoSprite.d.cts +2 -1
  41. package/dist/classes/canvas/VideoSprite.d.ts +2 -1
  42. package/dist/classes/canvas/VideoSprite.js +5 -5
  43. package/dist/classes/index.cjs +70 -41
  44. package/dist/classes/index.d.cts +1 -1
  45. package/dist/classes/index.d.ts +1 -1
  46. package/dist/classes/index.js +5 -5
  47. package/dist/classes/ticker/FadeAlphaTicker.cjs +70 -41
  48. package/dist/classes/ticker/FadeAlphaTicker.js +5 -5
  49. package/dist/classes/ticker/MoveTicker.cjs +70 -41
  50. package/dist/classes/ticker/MoveTicker.js +5 -5
  51. package/dist/classes/ticker/RotateTicker.cjs +70 -41
  52. package/dist/classes/ticker/RotateTicker.js +5 -5
  53. package/dist/classes/ticker/TickerBase.cjs +70 -41
  54. package/dist/classes/ticker/TickerBase.js +5 -5
  55. package/dist/classes/ticker/ZoomTicker.cjs +70 -41
  56. package/dist/classes/ticker/ZoomTicker.js +5 -5
  57. package/dist/classes/ticker/index.cjs +70 -41
  58. package/dist/classes/ticker/index.js +5 -5
  59. package/dist/constants.cjs +1 -1
  60. package/dist/constants.d.cts +1 -1
  61. package/dist/constants.d.ts +1 -1
  62. package/dist/constants.js +1 -1
  63. package/dist/decorators/canvas-element-decorator.cjs +70 -41
  64. package/dist/decorators/canvas-element-decorator.d.cts +1 -1
  65. package/dist/decorators/canvas-element-decorator.d.ts +1 -1
  66. package/dist/decorators/canvas-element-decorator.js +5 -5
  67. package/dist/decorators/event-decorator.d.cts +1 -1
  68. package/dist/decorators/event-decorator.d.ts +1 -1
  69. package/dist/decorators/index.cjs +70 -41
  70. package/dist/decorators/index.d.cts +1 -1
  71. package/dist/decorators/index.d.ts +1 -1
  72. package/dist/decorators/index.js +5 -5
  73. package/dist/decorators/label-decorator.cjs +70 -41
  74. package/dist/decorators/label-decorator.js +5 -5
  75. package/dist/functions/canvas/canvas-effect.cjs +70 -41
  76. package/dist/functions/canvas/canvas-effect.js +5 -5
  77. package/dist/functions/canvas/canvas-memory-utility.cjs +70 -41
  78. package/dist/functions/canvas/canvas-memory-utility.d.cts +1 -1
  79. package/dist/functions/canvas/canvas-memory-utility.d.ts +1 -1
  80. package/dist/functions/canvas/canvas-memory-utility.js +5 -5
  81. package/dist/functions/canvas/canvas-transition.cjs +70 -41
  82. package/dist/functions/canvas/canvas-transition.d.cts +1 -1
  83. package/dist/functions/canvas/canvas-transition.d.ts +1 -1
  84. package/dist/functions/canvas/canvas-transition.js +5 -5
  85. package/dist/functions/canvas/canvas-utility.cjs +70 -41
  86. package/dist/functions/canvas/canvas-utility.js +5 -5
  87. package/dist/functions/canvas/image-container-utility.cjs +70 -41
  88. package/dist/functions/canvas/image-container-utility.d.cts +1 -1
  89. package/dist/functions/canvas/image-container-utility.d.ts +1 -1
  90. package/dist/functions/canvas/image-container-utility.js +5 -5
  91. package/dist/functions/canvas/image-utility.cjs +70 -22
  92. package/dist/functions/canvas/image-utility.d.cts +1 -1
  93. package/dist/functions/canvas/image-utility.d.ts +1 -1
  94. package/dist/functions/canvas/image-utility.js +5 -5
  95. package/dist/functions/canvas/video-utility.cjs +70 -41
  96. package/dist/functions/canvas/video-utility.d.cts +1 -1
  97. package/dist/functions/canvas/video-utility.d.ts +1 -1
  98. package/dist/functions/canvas/video-utility.js +5 -5
  99. package/dist/functions/dialogue-utility.cjs +70 -41
  100. package/dist/functions/dialogue-utility.js +5 -5
  101. package/dist/functions/flags-utility.cjs +70 -41
  102. package/dist/functions/flags-utility.js +5 -5
  103. package/dist/functions/game-utility.cjs +70 -41
  104. package/dist/functions/game-utility.js +5 -5
  105. package/dist/functions/index.cjs +70 -22
  106. package/dist/functions/index.d.cts +1 -1
  107. package/dist/functions/index.d.ts +1 -1
  108. package/dist/functions/index.js +5 -5
  109. package/dist/functions/saves-utility.cjs +70 -41
  110. package/dist/functions/saves-utility.d.cts +1 -1
  111. package/dist/functions/saves-utility.d.ts +1 -1
  112. package/dist/functions/saves-utility.js +5 -5
  113. package/dist/functions/texture-utility.cjs +70 -41
  114. package/dist/functions/texture-utility.d.cts +1 -1
  115. package/dist/functions/texture-utility.d.ts +1 -1
  116. package/dist/functions/texture-utility.js +5 -5
  117. package/dist/index.cjs +70 -22
  118. package/dist/index.d.cts +1 -1
  119. package/dist/index.d.ts +1 -1
  120. package/dist/index.js +9 -9
  121. package/dist/interface/HistoryStep.d.cts +1 -1
  122. package/dist/interface/HistoryStep.d.ts +1 -1
  123. package/dist/interface/SaveData.d.cts +1 -1
  124. package/dist/interface/SaveData.d.ts +1 -1
  125. package/dist/interface/canvas/canvas-memory.d.cts +1 -1
  126. package/dist/interface/canvas/canvas-memory.d.ts +1 -1
  127. package/dist/interface/canvas/canvas-options.d.cts +1 -1
  128. package/dist/interface/canvas/canvas-options.d.ts +1 -1
  129. package/dist/interface/export/ExportedCanvas.d.cts +1 -1
  130. package/dist/interface/export/ExportedCanvas.d.ts +1 -1
  131. package/dist/interface/export/ExportedStep.d.cts +1 -1
  132. package/dist/interface/export/ExportedStep.d.ts +1 -1
  133. package/dist/interface/index.d.cts +1 -1
  134. package/dist/interface/index.d.ts +1 -1
  135. package/dist/labels/BaseCanvasElementTestLabel.cjs +70 -41
  136. package/dist/labels/BaseCanvasElementTestLabel.js +5 -5
  137. package/dist/labels/CanvasEventsTestLabel.cjs +70 -41
  138. package/dist/labels/CanvasEventsTestLabel.d.cts +1 -1
  139. package/dist/labels/CanvasEventsTestLabel.d.ts +1 -1
  140. package/dist/labels/CanvasEventsTestLabel.js +5 -5
  141. package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +70 -41
  142. package/dist/labels/CustomTickerCanvasElementTestLabel.js +5 -5
  143. package/dist/labels/ImagesAnimationsTestLabel.cjs +70 -41
  144. package/dist/labels/ImagesAnimationsTestLabel.js +5 -5
  145. package/dist/labels/InputTestLabel.cjs +70 -41
  146. package/dist/labels/InputTestLabel.js +5 -5
  147. package/dist/labels/MarkdownTest.cjs +70 -41
  148. package/dist/labels/MarkdownTest.js +5 -5
  149. package/dist/labels/SoundTestLabel.cjs +70 -41
  150. package/dist/labels/SoundTestLabel.js +5 -5
  151. package/dist/labels/StartLabel.cjs +70 -41
  152. package/dist/labels/StartLabel.js +5 -5
  153. package/dist/labels/StepLabelTest.cjs +70 -41
  154. package/dist/labels/StepLabelTest.js +5 -5
  155. package/dist/labels/VideoTestLabel.cjs +70 -41
  156. package/dist/labels/VideoTestLabel.js +5 -5
  157. package/dist/labels/index.cjs +70 -41
  158. package/dist/labels/index.js +5 -5
  159. package/dist/managers/CanvasManager.cjs +70 -41
  160. package/dist/managers/CanvasManager.d.cts +1 -1
  161. package/dist/managers/CanvasManager.d.ts +1 -1
  162. package/dist/managers/CanvasManager.js +5 -5
  163. package/dist/managers/CanvasManagerStatic.d.cts +1 -1
  164. package/dist/managers/CanvasManagerStatic.d.ts +1 -1
  165. package/dist/managers/NarrationManager.cjs +70 -41
  166. package/dist/managers/NarrationManager.d.cts +1 -1
  167. package/dist/managers/NarrationManager.d.ts +1 -1
  168. package/dist/managers/NarrationManager.js +5 -5
  169. package/dist/managers/NarrationManagerStatic.cjs +70 -41
  170. package/dist/managers/NarrationManagerStatic.d.cts +1 -1
  171. package/dist/managers/NarrationManagerStatic.d.ts +1 -1
  172. package/dist/managers/NarrationManagerStatic.js +5 -5
  173. package/dist/managers/SoundManager.cjs +70 -41
  174. package/dist/managers/SoundManager.js +5 -5
  175. package/dist/managers/StorageManager.cjs +70 -41
  176. package/dist/managers/StorageManager.js +5 -5
  177. package/dist/managers/index.cjs +70 -41
  178. package/dist/managers/index.d.cts +1 -1
  179. package/dist/managers/index.d.ts +1 -1
  180. package/dist/managers/index.js +5 -5
  181. package/dist/types/ContainerChild.d.cts +1 -1
  182. package/dist/types/ContainerChild.d.ts +1 -1
  183. package/dist/types/StepLabelType.d.cts +6 -1
  184. package/dist/types/StepLabelType.d.ts +6 -1
  185. package/dist/types/index.d.cts +1 -1
  186. package/dist/types/index.d.ts +1 -1
  187. package/package.json +1 -1
@@ -72,6 +72,11 @@ interface ImageContainerOptions<C extends ContainerChild = ContainerChild> exten
72
72
  }
73
73
  interface ImageSpriteOptions extends SpriteOptions, AdditionalPositionsExtensionProps {
74
74
  }
75
+ interface VideoSpriteOptions extends ImageSpriteOptions {
76
+ loop?: boolean;
77
+ paused?: boolean;
78
+ currentTime?: number;
79
+ }
75
80
 
76
81
  /**
77
82
  * This class is used to create a canvas element to add into a Pixi Application.
@@ -271,4 +276,4 @@ declare function setMemoryImageSprite(element: ImageSprite, memory: ImageSpriteM
271
276
 
272
277
  type ContainerChild = Container & CanvasBaseItem<any>;
273
278
 
274
- export { CanvasBaseItem as C, ImageSprite as I, Sprite as S, type TextMemory as T, type VideoSpriteMemory as V, type CanvasBaseItemMemory as a, type ContainerMemory as b, type ImageSpriteMemory as c, type SpriteBaseMemory as d, type SpriteMemory as e, type ImageContainerMemory as f, type ImageContainerOptions as g, type ImageSpriteOptions as h, type ContainerChild as i, getMemorySprite as j, setMemoryImageSprite as k, setMemorySprite as s };
279
+ export { CanvasBaseItem as C, ImageSprite as I, Sprite as S, type TextMemory as T, type VideoSpriteMemory as V, type CanvasBaseItemMemory as a, type ContainerMemory as b, type ImageSpriteMemory as c, type SpriteBaseMemory as d, type SpriteMemory as e, type ImageContainerMemory as f, type ImageContainerOptions as g, type ImageSpriteOptions as h, type VideoSpriteOptions as i, type ContainerChild as j, getMemorySprite as k, setMemoryImageSprite as l, setMemorySprite as s };
@@ -72,6 +72,11 @@ interface ImageContainerOptions<C extends ContainerChild = ContainerChild> exten
72
72
  }
73
73
  interface ImageSpriteOptions extends SpriteOptions, AdditionalPositionsExtensionProps {
74
74
  }
75
+ interface VideoSpriteOptions extends ImageSpriteOptions {
76
+ loop?: boolean;
77
+ paused?: boolean;
78
+ currentTime?: number;
79
+ }
75
80
 
76
81
  /**
77
82
  * This class is used to create a canvas element to add into a Pixi Application.
@@ -271,4 +276,4 @@ declare function setMemoryImageSprite(element: ImageSprite, memory: ImageSpriteM
271
276
 
272
277
  type ContainerChild = Container & CanvasBaseItem<any>;
273
278
 
274
- export { CanvasBaseItem as C, ImageSprite as I, Sprite as S, type TextMemory as T, type VideoSpriteMemory as V, type CanvasBaseItemMemory as a, type ContainerMemory as b, type ImageSpriteMemory as c, type SpriteBaseMemory as d, type SpriteMemory as e, type ImageContainerMemory as f, type ImageContainerOptions as g, type ImageSpriteOptions as h, type ContainerChild as i, getMemorySprite as j, setMemoryImageSprite as k, setMemorySprite as s };
279
+ export { CanvasBaseItem as C, ImageSprite as I, Sprite as S, type TextMemory as T, type VideoSpriteMemory as V, type CanvasBaseItemMemory as a, type ContainerMemory as b, type ImageSpriteMemory as c, type SpriteBaseMemory as d, type SpriteMemory as e, type ImageContainerMemory as f, type ImageContainerOptions as g, type ImageSpriteOptions as h, type VideoSpriteOptions as i, type ContainerChild as j, getMemorySprite as k, setMemoryImageSprite as l, setMemorySprite as s };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  aliasToRemoveAfter
3
3
  } from "./chunk-OMPJ74CO.js";
4
+ import {
5
+ Close
6
+ } from "./chunk-I6TNJEE3.js";
4
7
  import {
5
8
  StorageManagerStatic
6
9
  } from "./chunk-DPUSONJ3.js";
@@ -10,9 +13,6 @@ import {
10
13
  import {
11
14
  SoundManagerStatic
12
15
  } from "./chunk-6FAGAUDR.js";
13
- import {
14
- Close
15
- } from "./chunk-I6TNJEE3.js";
16
16
  import {
17
17
  bunnyImage,
18
18
  bunnyName,
@@ -69,7 +69,7 @@ import {
69
69
  filters,
70
70
  version,
71
71
  videoFormats
72
- } from "./chunk-V7WJOX65.js";
72
+ } from "./chunk-HCINNHUZ.js";
73
73
  import {
74
74
  Sound,
75
75
  SoundLibrary,
@@ -774,6 +774,22 @@ async function setMemoryContainer(element, memory, opstions) {
774
774
  // src/classes/canvas/ImageContainer.ts
775
775
  var ImageContainer = class extends Container2 {
776
776
  constructor(options, textureAliases = []) {
777
+ options = analizePositionsExtensionProps(options);
778
+ let align = void 0;
779
+ let percentagePosition = void 0;
780
+ let anchor = void 0;
781
+ if (options && "anchor" in options && options?.anchor !== void 0) {
782
+ anchor = options.anchor;
783
+ delete options.anchor;
784
+ }
785
+ if (options && "align" in options && options?.align !== void 0) {
786
+ align = options.align;
787
+ delete options.align;
788
+ }
789
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
790
+ percentagePosition = options.percentagePosition;
791
+ delete options.percentagePosition;
792
+ }
777
793
  super(options);
778
794
  options = analizePositionsExtensionProps(options);
779
795
  if (textureAliases) {
@@ -781,14 +797,14 @@ var ImageContainer = class extends Container2 {
781
797
  this.addChild(new ImageSprite(void 0, textureAlias));
782
798
  });
783
799
  }
784
- if (options?.anchor !== void 0) {
785
- this.anchor = options.anchor;
800
+ if (anchor) {
801
+ this.anchor = anchor;
786
802
  }
787
- if (options && "align" in options && options?.align !== void 0) {
788
- this.align = options.align;
803
+ if (align) {
804
+ this.align = align;
789
805
  }
790
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
791
- this.percentagePosition = options.percentagePosition;
806
+ if (percentagePosition) {
807
+ this.percentagePosition = percentagePosition;
792
808
  }
793
809
  }
794
810
  get memory() {
@@ -3694,7 +3710,7 @@ var NarrationManager = class {
3694
3710
  canvas.forceCompletionOfReportedTickers();
3695
3711
  }
3696
3712
  NarrationManagerStatic.stepsRunning++;
3697
- let result = await step(props);
3713
+ let result = await step(props, { labelId: currentLabel.id });
3698
3714
  if (this.choiceMenuOptions?.length === 1 && this.choiceMenuOptions[0].autoSelect) {
3699
3715
  let choice = this.choiceMenuOptions[0];
3700
3716
  result = await this.selectChoice(choice, props);
@@ -3729,14 +3745,14 @@ var NarrationManager = class {
3729
3745
  } else if (this.openedLabels.length === 1) {
3730
3746
  NarrationManagerStatic.restoreLastLabelList();
3731
3747
  if (this.onGameEnd) {
3732
- return await this.onGameEnd(props);
3748
+ return await this.onGameEnd(props, { labelId: "end" });
3733
3749
  }
3734
3750
  return;
3735
3751
  }
3736
3752
  } else if (this.openedLabels.length === 0) {
3737
3753
  NarrationManagerStatic.restoreLastLabelList();
3738
3754
  if (this.onGameEnd) {
3739
- return await this.onGameEnd(props);
3755
+ return await this.onGameEnd(props, { labelId: "end" });
3740
3756
  }
3741
3757
  console.error("[Pixi\u2019VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");
3742
3758
  return;
@@ -5365,13 +5381,8 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
5365
5381
  flowerTop.x = 300;
5366
5382
  flowerTop.y = 100;
5367
5383
  flowerTop.load();
5368
- let helmlok = addImage("helmlok", helmlokImage);
5369
- helmlok.x = 100;
5370
- helmlok.y = 300;
5371
- let skully = addImage("skully", skullyImage);
5372
- skully.x = 300;
5373
- skully.y = 300;
5374
- await loadImage([helmlok, skully]);
5384
+ showImage("helmlok", helmlokImage, { x: 100, y: 300 });
5385
+ showImage("skully", skullyImage, { xAlign: 0.5, yAlign: 0.5 });
5375
5386
  },
5376
5387
  async () => {
5377
5388
  narration.dialogue = { character: juliette, text: "Here's what they can do." };
@@ -6295,16 +6306,26 @@ function calculatePercentagePosition(type, percentage) {
6295
6306
  var ImageSprite = class _ImageSprite extends Sprite2 {
6296
6307
  pixivnId = CANVAS_IMAGE_ID;
6297
6308
  constructor(options, textureAlias) {
6298
- super(options);
6299
6309
  options = analizePositionsExtensionProps(options);
6310
+ let align = void 0;
6311
+ let percentagePosition = void 0;
6312
+ if (options && "align" in options && options?.align !== void 0) {
6313
+ align = options.align;
6314
+ delete options.align;
6315
+ }
6316
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
6317
+ percentagePosition = options.percentagePosition;
6318
+ delete options.percentagePosition;
6319
+ }
6320
+ super(options);
6300
6321
  if (textureAlias) {
6301
6322
  this.textureAlias = textureAlias;
6302
6323
  }
6303
- if (options && "align" in options && options?.align !== void 0) {
6304
- this.align = options.align;
6324
+ if (align) {
6325
+ this.align = align;
6305
6326
  }
6306
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
6307
- this.percentagePosition = options.percentagePosition;
6327
+ if (percentagePosition) {
6328
+ this.percentagePosition = percentagePosition;
6308
6329
  }
6309
6330
  }
6310
6331
  get memory() {
@@ -6476,6 +6497,33 @@ async function setMemoryImageSprite(element, memory, options) {
6476
6497
 
6477
6498
  // src/classes/canvas/VideoSprite.ts
6478
6499
  var VideoSprite = class _VideoSprite extends ImageSprite {
6500
+ constructor(options, textureAlias) {
6501
+ let loop = void 0;
6502
+ let paused = void 0;
6503
+ let currentTime = void 0;
6504
+ if (options && "loop" in options && options?.loop !== void 0) {
6505
+ loop = options.loop;
6506
+ delete options.loop;
6507
+ }
6508
+ if (options && "paused" in options && options?.paused !== void 0) {
6509
+ paused = options.paused;
6510
+ delete options.paused;
6511
+ }
6512
+ if (options && "currentTime" in options && options?.currentTime !== void 0) {
6513
+ currentTime = options.currentTime;
6514
+ delete options.currentTime;
6515
+ }
6516
+ super(options, textureAlias);
6517
+ if (loop) {
6518
+ this.loop = loop;
6519
+ }
6520
+ if (paused) {
6521
+ this.paused = paused;
6522
+ }
6523
+ if (currentTime) {
6524
+ this.currentTime = currentTime;
6525
+ }
6526
+ }
6479
6527
  pixivnId = CANVAS_VIDEO_ID;
6480
6528
  get memory() {
6481
6529
  return {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-X55ALTH7.js";
4
4
 
5
5
  // package.json
6
- var version = "0.9.9";
6
+ var version = "0.9.10";
7
7
 
8
8
  // src/constants.ts
9
9
  var Repeat = "repeat";
@@ -57822,7 +57822,7 @@ extensions.add(soundAsset);
57822
57822
  var sound = setInstance(new SoundLibrary());
57823
57823
 
57824
57824
  // package.json
57825
- var version = "0.9.9";
57825
+ var version = "0.9.10";
57826
57826
 
57827
57827
  // src/constants.ts
57828
57828
  var Repeat = "repeat";
@@ -58863,6 +58863,22 @@ async function setMemoryContainer(element, memory, opstions) {
58863
58863
  // src/classes/canvas/ImageContainer.ts
58864
58864
  var ImageContainer = class extends Container3 {
58865
58865
  constructor(options, textureAliases = []) {
58866
+ options = analizePositionsExtensionProps(options);
58867
+ let align = void 0;
58868
+ let percentagePosition = void 0;
58869
+ let anchor = void 0;
58870
+ if (options && "anchor" in options && options?.anchor !== void 0) {
58871
+ anchor = options.anchor;
58872
+ delete options.anchor;
58873
+ }
58874
+ if (options && "align" in options && options?.align !== void 0) {
58875
+ align = options.align;
58876
+ delete options.align;
58877
+ }
58878
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58879
+ percentagePosition = options.percentagePosition;
58880
+ delete options.percentagePosition;
58881
+ }
58866
58882
  super(options);
58867
58883
  options = analizePositionsExtensionProps(options);
58868
58884
  if (textureAliases) {
@@ -58870,14 +58886,14 @@ var ImageContainer = class extends Container3 {
58870
58886
  this.addChild(new ImageSprite(void 0, textureAlias));
58871
58887
  });
58872
58888
  }
58873
- if (options?.anchor !== void 0) {
58874
- this.anchor = options.anchor;
58889
+ if (anchor) {
58890
+ this.anchor = anchor;
58875
58891
  }
58876
- if (options && "align" in options && options?.align !== void 0) {
58877
- this.align = options.align;
58892
+ if (align) {
58893
+ this.align = align;
58878
58894
  }
58879
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58880
- this.percentagePosition = options.percentagePosition;
58895
+ if (percentagePosition) {
58896
+ this.percentagePosition = percentagePosition;
58881
58897
  }
58882
58898
  }
58883
58899
  get memory() {
@@ -59114,25 +59130,6 @@ function addImage(alias, imageUrl, options) {
59114
59130
  canvas.add(alias, image);
59115
59131
  return image;
59116
59132
  }
59117
- async function loadImage(canvasImages) {
59118
- if (!Array.isArray(canvasImages)) {
59119
- return [canvasImages];
59120
- }
59121
- let promises = Array(canvasImages.length);
59122
- for (let i3 = 0; i3 < canvasImages.length; i3++) {
59123
- promises[i3] = getTexture(canvasImages[i3].textureAlias);
59124
- }
59125
- return Promise.all(promises).then((textures) => {
59126
- return textures.map((texture, index) => {
59127
- if (texture) {
59128
- canvasImages[index].texture = texture;
59129
- return canvasImages[index];
59130
- }
59131
- canvasImages[index].load();
59132
- return canvasImages[index];
59133
- });
59134
- });
59135
- }
59136
59133
  async function showImage(alias, imageUrl, options) {
59137
59134
  if (!imageUrl) {
59138
59135
  if (Assets.resolver.hasKey(alias)) {
@@ -59963,13 +59960,8 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
59963
59960
  flowerTop.x = 300;
59964
59961
  flowerTop.y = 100;
59965
59962
  flowerTop.load();
59966
- let helmlok = addImage("helmlok", helmlokImage);
59967
- helmlok.x = 100;
59968
- helmlok.y = 300;
59969
- let skully = addImage("skully", skullyImage);
59970
- skully.x = 300;
59971
- skully.y = 300;
59972
- await loadImage([helmlok, skully]);
59963
+ showImage("helmlok", helmlokImage, { x: 100, y: 300 });
59964
+ showImage("skully", skullyImage, { xAlign: 0.5, yAlign: 0.5 });
59973
59965
  },
59974
59966
  async () => {
59975
59967
  narration.dialogue = { character: juliette, text: "Here's what they can do." };
@@ -60971,16 +60963,26 @@ async function setMemorySprite(element, memory, options) {
60971
60963
  var ImageSprite = class _ImageSprite extends Sprite2 {
60972
60964
  pixivnId = CANVAS_IMAGE_ID;
60973
60965
  constructor(options, textureAlias) {
60974
- super(options);
60975
60966
  options = analizePositionsExtensionProps(options);
60967
+ let align = void 0;
60968
+ let percentagePosition = void 0;
60969
+ if (options && "align" in options && options?.align !== void 0) {
60970
+ align = options.align;
60971
+ delete options.align;
60972
+ }
60973
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
60974
+ percentagePosition = options.percentagePosition;
60975
+ delete options.percentagePosition;
60976
+ }
60977
+ super(options);
60976
60978
  if (textureAlias) {
60977
60979
  this.textureAlias = textureAlias;
60978
60980
  }
60979
- if (options && "align" in options && options?.align !== void 0) {
60980
- this.align = options.align;
60981
+ if (align) {
60982
+ this.align = align;
60981
60983
  }
60982
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
60983
- this.percentagePosition = options.percentagePosition;
60984
+ if (percentagePosition) {
60985
+ this.percentagePosition = percentagePosition;
60984
60986
  }
60985
60987
  }
60986
60988
  get memory() {
@@ -61152,6 +61154,33 @@ async function setMemoryImageSprite(element, memory, options) {
61152
61154
 
61153
61155
  // src/classes/canvas/VideoSprite.ts
61154
61156
  var VideoSprite = class _VideoSprite extends ImageSprite {
61157
+ constructor(options, textureAlias) {
61158
+ let loop = void 0;
61159
+ let paused = void 0;
61160
+ let currentTime = void 0;
61161
+ if (options && "loop" in options && options?.loop !== void 0) {
61162
+ loop = options.loop;
61163
+ delete options.loop;
61164
+ }
61165
+ if (options && "paused" in options && options?.paused !== void 0) {
61166
+ paused = options.paused;
61167
+ delete options.paused;
61168
+ }
61169
+ if (options && "currentTime" in options && options?.currentTime !== void 0) {
61170
+ currentTime = options.currentTime;
61171
+ delete options.currentTime;
61172
+ }
61173
+ super(options, textureAlias);
61174
+ if (loop) {
61175
+ this.loop = loop;
61176
+ }
61177
+ if (paused) {
61178
+ this.paused = paused;
61179
+ }
61180
+ if (currentTime) {
61181
+ this.currentTime = currentTime;
61182
+ }
61183
+ }
61155
61184
  pixivnId = CANVAS_VIDEO_ID;
61156
61185
  get memory() {
61157
61186
  return {
@@ -63739,7 +63768,7 @@ var NarrationManager = class {
63739
63768
  canvas.forceCompletionOfReportedTickers();
63740
63769
  }
63741
63770
  NarrationManagerStatic.stepsRunning++;
63742
- let result = await step(props);
63771
+ let result = await step(props, { labelId: currentLabel.id });
63743
63772
  if (this.choiceMenuOptions?.length === 1 && this.choiceMenuOptions[0].autoSelect) {
63744
63773
  let choice = this.choiceMenuOptions[0];
63745
63774
  result = await this.selectChoice(choice, props);
@@ -63774,14 +63803,14 @@ var NarrationManager = class {
63774
63803
  } else if (this.openedLabels.length === 1) {
63775
63804
  NarrationManagerStatic.restoreLastLabelList();
63776
63805
  if (this.onGameEnd) {
63777
- return await this.onGameEnd(props);
63806
+ return await this.onGameEnd(props, { labelId: "end" });
63778
63807
  }
63779
63808
  return;
63780
63809
  }
63781
63810
  } else if (this.openedLabels.length === 0) {
63782
63811
  NarrationManagerStatic.restoreLastLabelList();
63783
63812
  if (this.onGameEnd) {
63784
- return await this.onGameEnd(props);
63813
+ return await this.onGameEnd(props, { labelId: "end" });
63785
63814
  }
63786
63815
  console.error("[Pixi\u2019VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");
63787
63816
  return;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  CharacterBaseModel
3
- } from "../chunk-RGKEAZTY.js";
3
+ } from "../chunk-7MKMIPPX.js";
4
4
  import "../chunk-OMPJ74CO.js";
5
5
  import "../chunk-2JGQWY5I.js";
6
- import "../chunk-DPUSONJ3.js";
7
- import "../chunk-GEY6RTYO.js";
8
6
  import "../chunk-2BUPSB7O.js";
7
+ import "../chunk-GEY6RTYO.js";
8
+ import "../chunk-I6TNJEE3.js";
9
+ import "../chunk-DPUSONJ3.js";
9
10
  import "../chunk-LZNY6NEZ.js";
10
11
  import "../chunk-6FAGAUDR.js";
11
- import "../chunk-I6TNJEE3.js";
12
12
  import "../chunk-RI37WOHP.js";
13
13
  import "../chunk-ETZISN54.js";
14
14
  import "../chunk-VXCA724Z.js";
@@ -20,7 +20,7 @@ import "../chunk-ZBUW3MBH.js";
20
20
  import "../chunk-PIYIZHZL.js";
21
21
  import "../chunk-B7XQM2BB.js";
22
22
  import "../chunk-LEMOIFSV.js";
23
- import "../chunk-V7WJOX65.js";
23
+ import "../chunk-HCINNHUZ.js";
24
24
  import "../chunk-X55ALTH7.js";
25
25
  import "../chunk-MQPMJVDR.js";
26
26
  import "../chunk-D753T42C.js";
@@ -57822,7 +57822,7 @@ extensions.add(soundAsset);
57822
57822
  var sound = setInstance(new SoundLibrary());
57823
57823
 
57824
57824
  // package.json
57825
- var version = "0.9.9";
57825
+ var version = "0.9.10";
57826
57826
 
57827
57827
  // src/constants.ts
57828
57828
  var Repeat = "repeat";
@@ -58863,6 +58863,22 @@ async function setMemoryContainer(element, memory, opstions) {
58863
58863
  // src/classes/canvas/ImageContainer.ts
58864
58864
  var ImageContainer = class extends Container3 {
58865
58865
  constructor(options, textureAliases = []) {
58866
+ options = analizePositionsExtensionProps(options);
58867
+ let align = void 0;
58868
+ let percentagePosition = void 0;
58869
+ let anchor = void 0;
58870
+ if (options && "anchor" in options && options?.anchor !== void 0) {
58871
+ anchor = options.anchor;
58872
+ delete options.anchor;
58873
+ }
58874
+ if (options && "align" in options && options?.align !== void 0) {
58875
+ align = options.align;
58876
+ delete options.align;
58877
+ }
58878
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58879
+ percentagePosition = options.percentagePosition;
58880
+ delete options.percentagePosition;
58881
+ }
58866
58882
  super(options);
58867
58883
  options = analizePositionsExtensionProps(options);
58868
58884
  if (textureAliases) {
@@ -58870,14 +58886,14 @@ var ImageContainer = class extends Container3 {
58870
58886
  this.addChild(new ImageSprite(void 0, textureAlias));
58871
58887
  });
58872
58888
  }
58873
- if (options?.anchor !== void 0) {
58874
- this.anchor = options.anchor;
58889
+ if (anchor) {
58890
+ this.anchor = anchor;
58875
58891
  }
58876
- if (options && "align" in options && options?.align !== void 0) {
58877
- this.align = options.align;
58892
+ if (align) {
58893
+ this.align = align;
58878
58894
  }
58879
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58880
- this.percentagePosition = options.percentagePosition;
58895
+ if (percentagePosition) {
58896
+ this.percentagePosition = percentagePosition;
58881
58897
  }
58882
58898
  }
58883
58899
  get memory() {
@@ -59114,25 +59130,6 @@ function addImage(alias, imageUrl, options) {
59114
59130
  canvas.add(alias, image);
59115
59131
  return image;
59116
59132
  }
59117
- async function loadImage(canvasImages) {
59118
- if (!Array.isArray(canvasImages)) {
59119
- return [canvasImages];
59120
- }
59121
- let promises = Array(canvasImages.length);
59122
- for (let i3 = 0; i3 < canvasImages.length; i3++) {
59123
- promises[i3] = getTexture(canvasImages[i3].textureAlias);
59124
- }
59125
- return Promise.all(promises).then((textures) => {
59126
- return textures.map((texture, index) => {
59127
- if (texture) {
59128
- canvasImages[index].texture = texture;
59129
- return canvasImages[index];
59130
- }
59131
- canvasImages[index].load();
59132
- return canvasImages[index];
59133
- });
59134
- });
59135
- }
59136
59133
  async function showImage(alias, imageUrl, options) {
59137
59134
  if (!imageUrl) {
59138
59135
  if (Assets.resolver.hasKey(alias)) {
@@ -59963,13 +59960,8 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
59963
59960
  flowerTop.x = 300;
59964
59961
  flowerTop.y = 100;
59965
59962
  flowerTop.load();
59966
- let helmlok = addImage("helmlok", helmlokImage);
59967
- helmlok.x = 100;
59968
- helmlok.y = 300;
59969
- let skully = addImage("skully", skullyImage);
59970
- skully.x = 300;
59971
- skully.y = 300;
59972
- await loadImage([helmlok, skully]);
59963
+ showImage("helmlok", helmlokImage, { x: 100, y: 300 });
59964
+ showImage("skully", skullyImage, { xAlign: 0.5, yAlign: 0.5 });
59973
59965
  },
59974
59966
  async () => {
59975
59967
  narration.dialogue = { character: juliette, text: "Here's what they can do." };
@@ -60971,16 +60963,26 @@ async function setMemorySprite(element, memory, options) {
60971
60963
  var ImageSprite = class _ImageSprite extends Sprite2 {
60972
60964
  pixivnId = CANVAS_IMAGE_ID;
60973
60965
  constructor(options, textureAlias) {
60974
- super(options);
60975
60966
  options = analizePositionsExtensionProps(options);
60967
+ let align = void 0;
60968
+ let percentagePosition = void 0;
60969
+ if (options && "align" in options && options?.align !== void 0) {
60970
+ align = options.align;
60971
+ delete options.align;
60972
+ }
60973
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
60974
+ percentagePosition = options.percentagePosition;
60975
+ delete options.percentagePosition;
60976
+ }
60977
+ super(options);
60976
60978
  if (textureAlias) {
60977
60979
  this.textureAlias = textureAlias;
60978
60980
  }
60979
- if (options && "align" in options && options?.align !== void 0) {
60980
- this.align = options.align;
60981
+ if (align) {
60982
+ this.align = align;
60981
60983
  }
60982
- if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
60983
- this.percentagePosition = options.percentagePosition;
60984
+ if (percentagePosition) {
60985
+ this.percentagePosition = percentagePosition;
60984
60986
  }
60985
60987
  }
60986
60988
  get memory() {
@@ -61152,6 +61154,33 @@ async function setMemoryImageSprite(element, memory, options) {
61152
61154
 
61153
61155
  // src/classes/canvas/VideoSprite.ts
61154
61156
  var VideoSprite = class _VideoSprite extends ImageSprite {
61157
+ constructor(options, textureAlias) {
61158
+ let loop = void 0;
61159
+ let paused = void 0;
61160
+ let currentTime = void 0;
61161
+ if (options && "loop" in options && options?.loop !== void 0) {
61162
+ loop = options.loop;
61163
+ delete options.loop;
61164
+ }
61165
+ if (options && "paused" in options && options?.paused !== void 0) {
61166
+ paused = options.paused;
61167
+ delete options.paused;
61168
+ }
61169
+ if (options && "currentTime" in options && options?.currentTime !== void 0) {
61170
+ currentTime = options.currentTime;
61171
+ delete options.currentTime;
61172
+ }
61173
+ super(options, textureAlias);
61174
+ if (loop) {
61175
+ this.loop = loop;
61176
+ }
61177
+ if (paused) {
61178
+ this.paused = paused;
61179
+ }
61180
+ if (currentTime) {
61181
+ this.currentTime = currentTime;
61182
+ }
61183
+ }
61155
61184
  pixivnId = CANVAS_VIDEO_ID;
61156
61185
  get memory() {
61157
61186
  return {
@@ -63739,7 +63768,7 @@ var NarrationManager = class {
63739
63768
  canvas.forceCompletionOfReportedTickers();
63740
63769
  }
63741
63770
  NarrationManagerStatic.stepsRunning++;
63742
- let result = await step(props);
63771
+ let result = await step(props, { labelId: currentLabel.id });
63743
63772
  if (this.choiceMenuOptions?.length === 1 && this.choiceMenuOptions[0].autoSelect) {
63744
63773
  let choice = this.choiceMenuOptions[0];
63745
63774
  result = await this.selectChoice(choice, props);
@@ -63774,14 +63803,14 @@ var NarrationManager = class {
63774
63803
  } else if (this.openedLabels.length === 1) {
63775
63804
  NarrationManagerStatic.restoreLastLabelList();
63776
63805
  if (this.onGameEnd) {
63777
- return await this.onGameEnd(props);
63806
+ return await this.onGameEnd(props, { labelId: "end" });
63778
63807
  }
63779
63808
  return;
63780
63809
  }
63781
63810
  } else if (this.openedLabels.length === 0) {
63782
63811
  NarrationManagerStatic.restoreLastLabelList();
63783
63812
  if (this.onGameEnd) {
63784
- return await this.onGameEnd(props);
63813
+ return await this.onGameEnd(props, { labelId: "end" });
63785
63814
  }
63786
63815
  console.error("[Pixi\u2019VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");
63787
63816
  return;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  CharacterStoredClass
3
- } from "../chunk-RGKEAZTY.js";
3
+ } from "../chunk-7MKMIPPX.js";
4
4
  import "../chunk-OMPJ74CO.js";
5
5
  import "../chunk-2JGQWY5I.js";
6
- import "../chunk-DPUSONJ3.js";
7
- import "../chunk-GEY6RTYO.js";
8
6
  import "../chunk-2BUPSB7O.js";
7
+ import "../chunk-GEY6RTYO.js";
8
+ import "../chunk-I6TNJEE3.js";
9
+ import "../chunk-DPUSONJ3.js";
9
10
  import "../chunk-LZNY6NEZ.js";
10
11
  import "../chunk-6FAGAUDR.js";
11
- import "../chunk-I6TNJEE3.js";
12
12
  import "../chunk-RI37WOHP.js";
13
13
  import "../chunk-ETZISN54.js";
14
14
  import "../chunk-VXCA724Z.js";
@@ -20,7 +20,7 @@ import "../chunk-ZBUW3MBH.js";
20
20
  import "../chunk-PIYIZHZL.js";
21
21
  import "../chunk-B7XQM2BB.js";
22
22
  import "../chunk-LEMOIFSV.js";
23
- import "../chunk-V7WJOX65.js";
23
+ import "../chunk-HCINNHUZ.js";
24
24
  import "../chunk-X55ALTH7.js";
25
25
  import "../chunk-MQPMJVDR.js";
26
26
  import "../chunk-D753T42C.js";