@drincs/pixi-vn 0.9.6 → 0.9.7

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 (186) hide show
  1. package/dist/{ContainerChild-HBivknFV.d.ts → ContainerChild-B5yD0BI8.d.ts} +3 -7
  2. package/dist/{ContainerChild-CEuXVx00.d.cts → ContainerChild-WzyxEjAc.d.cts} +3 -7
  3. package/dist/{chunk-SCOZ46ME.js → chunk-IRUKNG2Y.js} +32 -18
  4. package/dist/{chunk-JMXJKUTS.js → chunk-NB4Q3GFK.js} +19 -11
  5. package/dist/{chunk-AQPVWC55.js → chunk-TOG67Z7Q.js} +1 -1
  6. package/dist/classes/CharacterBaseModel.cjs +50 -28
  7. package/dist/classes/CharacterBaseModel.js +3 -3
  8. package/dist/classes/CharacterStoredClass.cjs +50 -28
  9. package/dist/classes/CharacterStoredClass.js +3 -3
  10. package/dist/classes/ChoiceMenuOption.cjs +50 -28
  11. package/dist/classes/ChoiceMenuOption.js +3 -3
  12. package/dist/classes/Sound.cjs +50 -28
  13. package/dist/classes/Sound.js +3 -3
  14. package/dist/classes/StoredClassModel.cjs +50 -28
  15. package/dist/classes/StoredClassModel.js +3 -3
  16. package/dist/classes/canvas/AdditionalPositions.cjs +32 -18
  17. package/dist/classes/canvas/AdditionalPositions.js +1 -1
  18. package/dist/classes/canvas/CanvasBaseItem.d.cts +2 -2
  19. package/dist/classes/canvas/CanvasBaseItem.d.ts +2 -2
  20. package/dist/classes/canvas/Container.cjs +50 -28
  21. package/dist/classes/canvas/Container.d.cts +3 -2
  22. package/dist/classes/canvas/Container.d.ts +3 -2
  23. package/dist/classes/canvas/Container.js +3 -3
  24. package/dist/classes/canvas/ImageContainer.cjs +67 -45
  25. package/dist/classes/canvas/ImageContainer.d.cts +1 -1
  26. package/dist/classes/canvas/ImageContainer.d.ts +1 -1
  27. package/dist/classes/canvas/ImageContainer.js +3 -3
  28. package/dist/classes/canvas/ImageSprite.cjs +50 -28
  29. package/dist/classes/canvas/ImageSprite.d.cts +1 -1
  30. package/dist/classes/canvas/ImageSprite.d.ts +1 -1
  31. package/dist/classes/canvas/ImageSprite.js +3 -3
  32. package/dist/classes/canvas/Sprite.cjs +50 -28
  33. package/dist/classes/canvas/Sprite.d.cts +2 -2
  34. package/dist/classes/canvas/Sprite.d.ts +2 -2
  35. package/dist/classes/canvas/Sprite.js +3 -3
  36. package/dist/classes/canvas/Text.cjs +50 -28
  37. package/dist/classes/canvas/Text.d.cts +2 -2
  38. package/dist/classes/canvas/Text.d.ts +2 -2
  39. package/dist/classes/canvas/Text.js +3 -3
  40. package/dist/classes/canvas/VideoSprite.cjs +50 -28
  41. package/dist/classes/canvas/VideoSprite.d.cts +2 -2
  42. package/dist/classes/canvas/VideoSprite.d.ts +2 -2
  43. package/dist/classes/canvas/VideoSprite.js +3 -3
  44. package/dist/classes/index.cjs +50 -28
  45. package/dist/classes/index.d.cts +2 -2
  46. package/dist/classes/index.d.ts +2 -2
  47. package/dist/classes/index.js +3 -3
  48. package/dist/classes/ticker/FadeAlphaTicker.cjs +50 -28
  49. package/dist/classes/ticker/FadeAlphaTicker.js +3 -3
  50. package/dist/classes/ticker/MoveTicker.cjs +50 -28
  51. package/dist/classes/ticker/MoveTicker.js +3 -3
  52. package/dist/classes/ticker/RotateTicker.cjs +50 -28
  53. package/dist/classes/ticker/RotateTicker.js +3 -3
  54. package/dist/classes/ticker/TickerBase.cjs +50 -28
  55. package/dist/classes/ticker/TickerBase.js +3 -3
  56. package/dist/classes/ticker/ZoomTicker.cjs +50 -28
  57. package/dist/classes/ticker/ZoomTicker.js +3 -3
  58. package/dist/classes/ticker/index.cjs +50 -28
  59. package/dist/classes/ticker/index.js +3 -3
  60. package/dist/constants.cjs +1 -1
  61. package/dist/constants.d.cts +1 -1
  62. package/dist/constants.d.ts +1 -1
  63. package/dist/constants.js +1 -1
  64. package/dist/decorators/canvas-element-decorator.cjs +50 -28
  65. package/dist/decorators/canvas-element-decorator.d.cts +2 -2
  66. package/dist/decorators/canvas-element-decorator.d.ts +2 -2
  67. package/dist/decorators/canvas-element-decorator.js +3 -3
  68. package/dist/decorators/event-decorator.d.cts +2 -2
  69. package/dist/decorators/event-decorator.d.ts +2 -2
  70. package/dist/decorators/index.cjs +50 -28
  71. package/dist/decorators/index.d.cts +2 -2
  72. package/dist/decorators/index.d.ts +2 -2
  73. package/dist/decorators/index.js +3 -3
  74. package/dist/decorators/label-decorator.cjs +50 -28
  75. package/dist/decorators/label-decorator.js +3 -3
  76. package/dist/functions/canvas/canvas-effect.cjs +50 -28
  77. package/dist/functions/canvas/canvas-effect.js +3 -3
  78. package/dist/functions/canvas/canvas-memory-utility.cjs +50 -28
  79. package/dist/functions/canvas/canvas-memory-utility.d.cts +2 -2
  80. package/dist/functions/canvas/canvas-memory-utility.d.ts +2 -2
  81. package/dist/functions/canvas/canvas-memory-utility.js +3 -3
  82. package/dist/functions/canvas/canvas-transition.cjs +50 -28
  83. package/dist/functions/canvas/canvas-transition.d.cts +2 -2
  84. package/dist/functions/canvas/canvas-transition.d.ts +2 -2
  85. package/dist/functions/canvas/canvas-transition.js +3 -3
  86. package/dist/functions/canvas/canvas-utility.cjs +50 -28
  87. package/dist/functions/canvas/canvas-utility.js +3 -3
  88. package/dist/functions/canvas/image-container-utility.cjs +50 -28
  89. package/dist/functions/canvas/image-container-utility.d.cts +2 -2
  90. package/dist/functions/canvas/image-container-utility.d.ts +2 -2
  91. package/dist/functions/canvas/image-container-utility.js +3 -3
  92. package/dist/functions/canvas/image-utility.cjs +50 -28
  93. package/dist/functions/canvas/image-utility.d.cts +2 -2
  94. package/dist/functions/canvas/image-utility.d.ts +2 -2
  95. package/dist/functions/canvas/image-utility.js +3 -3
  96. package/dist/functions/canvas/video-utility.cjs +50 -28
  97. package/dist/functions/canvas/video-utility.d.cts +2 -2
  98. package/dist/functions/canvas/video-utility.d.ts +2 -2
  99. package/dist/functions/canvas/video-utility.js +3 -3
  100. package/dist/functions/dialogue-utility.cjs +50 -28
  101. package/dist/functions/dialogue-utility.js +3 -3
  102. package/dist/functions/flags-utility.cjs +50 -28
  103. package/dist/functions/flags-utility.js +3 -3
  104. package/dist/functions/game-utility.cjs +50 -28
  105. package/dist/functions/game-utility.js +3 -3
  106. package/dist/functions/index.cjs +50 -28
  107. package/dist/functions/index.d.cts +2 -2
  108. package/dist/functions/index.d.ts +2 -2
  109. package/dist/functions/index.js +3 -3
  110. package/dist/functions/saves-utility.cjs +50 -28
  111. package/dist/functions/saves-utility.d.cts +2 -2
  112. package/dist/functions/saves-utility.d.ts +2 -2
  113. package/dist/functions/saves-utility.js +3 -3
  114. package/dist/functions/texture-utility.cjs +50 -28
  115. package/dist/functions/texture-utility.d.cts +2 -2
  116. package/dist/functions/texture-utility.d.ts +2 -2
  117. package/dist/functions/texture-utility.js +3 -3
  118. package/dist/index.cjs +67 -47
  119. package/dist/index.d.cts +1 -1
  120. package/dist/index.d.ts +1 -1
  121. package/dist/index.js +3 -3
  122. package/dist/interface/HistoryStep.d.cts +2 -2
  123. package/dist/interface/HistoryStep.d.ts +2 -2
  124. package/dist/interface/SaveData.d.cts +2 -2
  125. package/dist/interface/SaveData.d.ts +2 -2
  126. package/dist/interface/canvas/canvas-memory.d.cts +2 -2
  127. package/dist/interface/canvas/canvas-memory.d.ts +2 -2
  128. package/dist/interface/canvas/canvas-options.d.cts +1 -1
  129. package/dist/interface/canvas/canvas-options.d.ts +1 -1
  130. package/dist/interface/export/ExportedCanvas.d.cts +2 -2
  131. package/dist/interface/export/ExportedCanvas.d.ts +2 -2
  132. package/dist/interface/export/ExportedStep.d.cts +2 -2
  133. package/dist/interface/export/ExportedStep.d.ts +2 -2
  134. package/dist/interface/index.d.cts +1 -1
  135. package/dist/interface/index.d.ts +1 -1
  136. package/dist/labels/BaseCanvasElementTestLabel.cjs +50 -28
  137. package/dist/labels/BaseCanvasElementTestLabel.js +3 -3
  138. package/dist/labels/CanvasEventsTestLabel.cjs +50 -28
  139. package/dist/labels/CanvasEventsTestLabel.d.cts +2 -2
  140. package/dist/labels/CanvasEventsTestLabel.d.ts +2 -2
  141. package/dist/labels/CanvasEventsTestLabel.js +3 -3
  142. package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +67 -47
  143. package/dist/labels/CustomTickerCanvasElementTestLabel.js +3 -3
  144. package/dist/labels/ImagesAnimationsTestLabel.cjs +50 -28
  145. package/dist/labels/ImagesAnimationsTestLabel.js +3 -3
  146. package/dist/labels/InputTestLabel.cjs +50 -28
  147. package/dist/labels/InputTestLabel.js +3 -3
  148. package/dist/labels/MarkdownTest.cjs +50 -28
  149. package/dist/labels/MarkdownTest.js +3 -3
  150. package/dist/labels/SoundTestLabel.cjs +50 -28
  151. package/dist/labels/SoundTestLabel.js +3 -3
  152. package/dist/labels/StartLabel.cjs +50 -28
  153. package/dist/labels/StartLabel.js +3 -3
  154. package/dist/labels/StepLabelTest.cjs +50 -28
  155. package/dist/labels/StepLabelTest.js +3 -3
  156. package/dist/labels/VideoTestLabel.cjs +50 -28
  157. package/dist/labels/VideoTestLabel.js +3 -3
  158. package/dist/labels/index.cjs +50 -28
  159. package/dist/labels/index.js +3 -3
  160. package/dist/managers/CanvasManager.cjs +50 -28
  161. package/dist/managers/CanvasManager.d.cts +2 -2
  162. package/dist/managers/CanvasManager.d.ts +2 -2
  163. package/dist/managers/CanvasManager.js +3 -3
  164. package/dist/managers/CanvasManagerStatic.d.cts +2 -2
  165. package/dist/managers/CanvasManagerStatic.d.ts +2 -2
  166. package/dist/managers/NarrationManager.cjs +50 -28
  167. package/dist/managers/NarrationManager.d.cts +2 -2
  168. package/dist/managers/NarrationManager.d.ts +2 -2
  169. package/dist/managers/NarrationManager.js +3 -3
  170. package/dist/managers/NarrationManagerStatic.cjs +50 -28
  171. package/dist/managers/NarrationManagerStatic.d.cts +2 -2
  172. package/dist/managers/NarrationManagerStatic.d.ts +2 -2
  173. package/dist/managers/NarrationManagerStatic.js +3 -3
  174. package/dist/managers/SoundManager.cjs +50 -28
  175. package/dist/managers/SoundManager.js +3 -3
  176. package/dist/managers/StorageManager.cjs +50 -28
  177. package/dist/managers/StorageManager.js +3 -3
  178. package/dist/managers/index.cjs +50 -28
  179. package/dist/managers/index.d.cts +2 -2
  180. package/dist/managers/index.d.ts +2 -2
  181. package/dist/managers/index.js +3 -3
  182. package/dist/types/ContainerChild.d.cts +2 -2
  183. package/dist/types/ContainerChild.d.ts +2 -2
  184. package/dist/types/index.d.cts +2 -2
  185. package/dist/types/index.d.ts +2 -2
  186. package/package.json +1 -1
@@ -9,11 +9,11 @@ import {
9
9
  showWithFadeTransition,
10
10
  zoomIn,
11
11
  zoomOut
12
- } from "../../chunk-JMXJKUTS.js";
12
+ } from "../../chunk-NB4Q3GFK.js";
13
13
  import "../../chunk-OMPJ74CO.js";
14
14
  import "../../chunk-2JGQWY5I.js";
15
15
  import "../../chunk-2BUPSB7O.js";
16
- import "../../chunk-SCOZ46ME.js";
16
+ import "../../chunk-IRUKNG2Y.js";
17
17
  import "../../chunk-6GJXIPNB.js";
18
18
  import "../../chunk-I6TNJEE3.js";
19
19
  import "../../chunk-DPUSONJ3.js";
@@ -30,7 +30,7 @@ import "../../chunk-ZBUW3MBH.js";
30
30
  import "../../chunk-PIYIZHZL.js";
31
31
  import "../../chunk-B7XQM2BB.js";
32
32
  import "../../chunk-LEMOIFSV.js";
33
- import "../../chunk-AQPVWC55.js";
33
+ import "../../chunk-TOG67Z7Q.js";
34
34
  import "../../chunk-WS3FY4Q6.js";
35
35
  import "../../chunk-Z3NBKYVU.js";
36
36
  import "../../chunk-SAUNZQHZ.js";
@@ -57719,7 +57719,7 @@ extensions.add(soundAsset);
57719
57719
  var sound = setInstance(new SoundLibrary());
57720
57720
 
57721
57721
  // package.json
57722
- var version = "0.9.6";
57722
+ var version = "0.9.7";
57723
57723
 
57724
57724
  // src/constants.ts
57725
57725
  var Repeat = "repeat";
@@ -58626,29 +58626,43 @@ function analizePositionsExtensionProps(props) {
58626
58626
  if (!props) {
58627
58627
  return props;
58628
58628
  }
58629
- if (props.align != void 0) {
58630
- if (typeof props.align === "number") {
58631
- props.xAlign = props.align;
58632
- props.yAlign = props.align;
58633
- } else {
58634
- if (props.align.x != void 0) {
58635
- props.xAlign = props.align.x;
58629
+ if (typeof props.align !== "number") {
58630
+ if (props.xAlign != void 0) {
58631
+ if (props.align === void 0) {
58632
+ props.align = { x: props.xAlign };
58633
+ delete props.xAlign;
58634
+ } else {
58635
+ props.align.x = props.xAlign;
58636
+ delete props.xAlign;
58636
58637
  }
58637
- if (props.align.y != void 0) {
58638
- props.yAlign = props.align.y;
58638
+ }
58639
+ if (props.yAlign != void 0) {
58640
+ if (props.align === void 0) {
58641
+ props.align = { y: props.yAlign };
58642
+ delete props.yAlign;
58643
+ } else {
58644
+ props.align.y = props.yAlign;
58645
+ delete props.yAlign;
58639
58646
  }
58640
58647
  }
58641
58648
  }
58642
- if (props.percentagePosition != void 0) {
58643
- if (typeof props.percentagePosition === "number") {
58644
- props.xPercentagePosition = props.percentagePosition;
58645
- props.yPercentagePosition = props.percentagePosition;
58646
- } else {
58647
- if (props.percentagePosition.x != void 0) {
58648
- props.xPercentagePosition = props.percentagePosition.x;
58649
+ if (typeof props.percentagePosition !== "number") {
58650
+ if (props.xPercentagePosition != void 0) {
58651
+ if (props.percentagePosition === void 0) {
58652
+ props.percentagePosition = { x: props.xPercentagePosition };
58653
+ delete props.xPercentagePosition;
58654
+ } else {
58655
+ props.percentagePosition.x = props.xPercentagePosition;
58656
+ delete props.xPercentagePosition;
58649
58657
  }
58650
- if (props.percentagePosition.y != void 0) {
58651
- props.yPercentagePosition = props.percentagePosition.y;
58658
+ }
58659
+ if (props.yPercentagePosition != void 0) {
58660
+ if (props.percentagePosition === void 0) {
58661
+ props.percentagePosition = { y: props.yPercentagePosition };
58662
+ delete props.yPercentagePosition;
58663
+ } else {
58664
+ props.percentagePosition.y = props.yPercentagePosition;
58665
+ delete props.yPercentagePosition;
58652
58666
  }
58653
58667
  }
58654
58668
  }
@@ -58690,12 +58704,15 @@ var Container2 = class extends Container {
58690
58704
  this.setMemory(value);
58691
58705
  }
58692
58706
  async setMemory(value) {
58707
+ await this.importChildren(value);
58708
+ return await setMemoryContainer(this, value);
58709
+ }
58710
+ async importChildren(value) {
58693
58711
  for (let i3 = 0; i3 < value.elements.length; i3++) {
58694
58712
  let child = value.elements[i3];
58695
58713
  let element = await importCanvasElement(child);
58696
58714
  this.addChild(element);
58697
58715
  }
58698
- return await setMemoryContainer(this, value);
58699
58716
  }
58700
58717
  };
58701
58718
  function getMemoryContainer(element) {
@@ -58787,10 +58804,10 @@ var ImageContainer = class extends Container2 {
58787
58804
  if (options?.anchor !== void 0) {
58788
58805
  this.anchor = options.anchor;
58789
58806
  }
58790
- if (options?.align !== void 0) {
58807
+ if (options && "align" in options && options?.align !== void 0) {
58791
58808
  this.align = options.align;
58792
58809
  }
58793
- if (options?.percentagePosition !== void 0) {
58810
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58794
58811
  this.percentagePosition = options.percentagePosition;
58795
58812
  }
58796
58813
  }
@@ -58808,7 +58825,8 @@ var ImageContainer = class extends Container2 {
58808
58825
  this.setMemory(value);
58809
58826
  }
58810
58827
  async setMemory(value) {
58811
- await super.setMemory(value);
58828
+ await this.importChildren(value);
58829
+ await setMemoryImageContainer(this, value);
58812
58830
  this.reloadAnchor();
58813
58831
  this.reloadPosition();
58814
58832
  }
@@ -58982,11 +59000,13 @@ var ImageContainer = class extends Container2 {
58982
59000
  }
58983
59001
  };
58984
59002
  async function setMemoryImageContainer(element, memory, opstions) {
59003
+ memory = analizePositionsExtensionProps(memory);
58985
59004
  setMemoryContainer(element, memory, {
58986
59005
  ...opstions,
58987
59006
  end: async () => {
58988
59007
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58989
59008
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
59009
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58990
59010
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58991
59011
  await element.load();
58992
59012
  }
@@ -60334,9 +60354,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
60334
60354
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
60335
60355
  };
60336
60356
  canvas.removeAll();
60337
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
60338
- container.anchor = 0.5;
60339
- container.align = 0.5;
60357
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
60358
+ canvas.add("container", container);
60340
60359
  let helmlok = addImage("helmlok", helmlokImage);
60341
60360
  helmlok.anchor = 0.5;
60342
60361
  helmlok.xAlign = 1;
@@ -60796,6 +60815,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60796
60815
  pixivnId = CANVAS_IMAGE_ID;
60797
60816
  constructor(options, textureAlias) {
60798
60817
  super(options);
60818
+ options = analizePositionsExtensionProps(options);
60799
60819
  if (textureAlias) {
60800
60820
  this.textureAlias = textureAlias;
60801
60821
  }
@@ -60819,7 +60839,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60819
60839
  this.setMemory(value);
60820
60840
  }
60821
60841
  async setMemory(value) {
60822
- await super.setMemory(value);
60842
+ await setMemoryImageSprite(this, value);
60823
60843
  this.reloadPosition();
60824
60844
  }
60825
60845
  static from(source7, skipCache) {
@@ -60956,9 +60976,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60956
60976
  }
60957
60977
  };
60958
60978
  async function setMemoryImageSprite(element, memory) {
60979
+ memory = analizePositionsExtensionProps(memory);
60959
60980
  return await setMemorySprite(element, memory, {
60960
60981
  half: async () => {
60961
60982
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
60983
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
60962
60984
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
60963
60985
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
60964
60986
  await element.load();
@@ -62633,7 +62655,6 @@ var CanvasManager = class {
62633
62655
  * @param data The object.
62634
62656
  */
62635
62657
  async import(data) {
62636
- this.clear();
62637
62658
  try {
62638
62659
  let tickersOnPause = data["tickersOnPause"] || {};
62639
62660
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -62641,6 +62662,7 @@ var CanvasManager = class {
62641
62662
  let elementAliasesOrder = data["elementAliasesOrder"];
62642
62663
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
62643
62664
  let list = await Promise.all(promises);
62665
+ this.clear();
62644
62666
  list.forEach((element, i3) => {
62645
62667
  let alias = elementAliasesOrder[i3];
62646
62668
  this.add(alias, element);
@@ -2,11 +2,11 @@ import {
2
2
  checkIfVideo,
3
3
  getTextureMemory,
4
4
  removeCanvasElement
5
- } from "../../chunk-JMXJKUTS.js";
5
+ } from "../../chunk-NB4Q3GFK.js";
6
6
  import "../../chunk-OMPJ74CO.js";
7
7
  import "../../chunk-2JGQWY5I.js";
8
8
  import "../../chunk-2BUPSB7O.js";
9
- import "../../chunk-SCOZ46ME.js";
9
+ import "../../chunk-IRUKNG2Y.js";
10
10
  import "../../chunk-6GJXIPNB.js";
11
11
  import "../../chunk-I6TNJEE3.js";
12
12
  import "../../chunk-DPUSONJ3.js";
@@ -23,7 +23,7 @@ import "../../chunk-ZBUW3MBH.js";
23
23
  import "../../chunk-PIYIZHZL.js";
24
24
  import "../../chunk-B7XQM2BB.js";
25
25
  import "../../chunk-LEMOIFSV.js";
26
- import "../../chunk-AQPVWC55.js";
26
+ import "../../chunk-TOG67Z7Q.js";
27
27
  import "../../chunk-WS3FY4Q6.js";
28
28
  import "../../chunk-Z3NBKYVU.js";
29
29
  import "../../chunk-SAUNZQHZ.js";
@@ -57721,7 +57721,7 @@ extensions.add(soundAsset);
57721
57721
  var sound = setInstance(new SoundLibrary());
57722
57722
 
57723
57723
  // package.json
57724
- var version = "0.9.6";
57724
+ var version = "0.9.7";
57725
57725
 
57726
57726
  // src/constants.ts
57727
57727
  var Repeat = "repeat";
@@ -58125,12 +58125,15 @@ var Container2 = class extends Container {
58125
58125
  this.setMemory(value);
58126
58126
  }
58127
58127
  async setMemory(value) {
58128
+ await this.importChildren(value);
58129
+ return await setMemoryContainer(this, value);
58130
+ }
58131
+ async importChildren(value) {
58128
58132
  for (let i3 = 0; i3 < value.elements.length; i3++) {
58129
58133
  let child = value.elements[i3];
58130
58134
  let element = await importCanvasElement(child);
58131
58135
  this.addChild(element);
58132
58136
  }
58133
- return await setMemoryContainer(this, value);
58134
58137
  }
58135
58138
  };
58136
58139
  function getMemoryContainer(element) {
@@ -58218,29 +58221,43 @@ function analizePositionsExtensionProps(props) {
58218
58221
  if (!props) {
58219
58222
  return props;
58220
58223
  }
58221
- if (props.align != void 0) {
58222
- if (typeof props.align === "number") {
58223
- props.xAlign = props.align;
58224
- props.yAlign = props.align;
58225
- } else {
58226
- if (props.align.x != void 0) {
58227
- props.xAlign = props.align.x;
58224
+ if (typeof props.align !== "number") {
58225
+ if (props.xAlign != void 0) {
58226
+ if (props.align === void 0) {
58227
+ props.align = { x: props.xAlign };
58228
+ delete props.xAlign;
58229
+ } else {
58230
+ props.align.x = props.xAlign;
58231
+ delete props.xAlign;
58228
58232
  }
58229
- if (props.align.y != void 0) {
58230
- props.yAlign = props.align.y;
58233
+ }
58234
+ if (props.yAlign != void 0) {
58235
+ if (props.align === void 0) {
58236
+ props.align = { y: props.yAlign };
58237
+ delete props.yAlign;
58238
+ } else {
58239
+ props.align.y = props.yAlign;
58240
+ delete props.yAlign;
58231
58241
  }
58232
58242
  }
58233
58243
  }
58234
- if (props.percentagePosition != void 0) {
58235
- if (typeof props.percentagePosition === "number") {
58236
- props.xPercentagePosition = props.percentagePosition;
58237
- props.yPercentagePosition = props.percentagePosition;
58238
- } else {
58239
- if (props.percentagePosition.x != void 0) {
58240
- props.xPercentagePosition = props.percentagePosition.x;
58244
+ if (typeof props.percentagePosition !== "number") {
58245
+ if (props.xPercentagePosition != void 0) {
58246
+ if (props.percentagePosition === void 0) {
58247
+ props.percentagePosition = { x: props.xPercentagePosition };
58248
+ delete props.xPercentagePosition;
58249
+ } else {
58250
+ props.percentagePosition.x = props.xPercentagePosition;
58251
+ delete props.xPercentagePosition;
58241
58252
  }
58242
- if (props.percentagePosition.y != void 0) {
58243
- props.yPercentagePosition = props.percentagePosition.y;
58253
+ }
58254
+ if (props.yPercentagePosition != void 0) {
58255
+ if (props.percentagePosition === void 0) {
58256
+ props.percentagePosition = { y: props.yPercentagePosition };
58257
+ delete props.yPercentagePosition;
58258
+ } else {
58259
+ props.percentagePosition.y = props.yPercentagePosition;
58260
+ delete props.yPercentagePosition;
58244
58261
  }
58245
58262
  }
58246
58263
  }
@@ -58260,10 +58277,10 @@ var ImageContainer = class extends Container2 {
58260
58277
  if (options?.anchor !== void 0) {
58261
58278
  this.anchor = options.anchor;
58262
58279
  }
58263
- if (options?.align !== void 0) {
58280
+ if (options && "align" in options && options?.align !== void 0) {
58264
58281
  this.align = options.align;
58265
58282
  }
58266
- if (options?.percentagePosition !== void 0) {
58283
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58267
58284
  this.percentagePosition = options.percentagePosition;
58268
58285
  }
58269
58286
  }
@@ -58281,7 +58298,8 @@ var ImageContainer = class extends Container2 {
58281
58298
  this.setMemory(value);
58282
58299
  }
58283
58300
  async setMemory(value) {
58284
- await super.setMemory(value);
58301
+ await this.importChildren(value);
58302
+ await setMemoryImageContainer(this, value);
58285
58303
  this.reloadAnchor();
58286
58304
  this.reloadPosition();
58287
58305
  }
@@ -58455,11 +58473,13 @@ var ImageContainer = class extends Container2 {
58455
58473
  }
58456
58474
  };
58457
58475
  async function setMemoryImageContainer(element, memory, opstions) {
58476
+ memory = analizePositionsExtensionProps(memory);
58458
58477
  setMemoryContainer(element, memory, {
58459
58478
  ...opstions,
58460
58479
  end: async () => {
58461
58480
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58462
58481
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58482
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58463
58483
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58464
58484
  await element.load();
58465
58485
  }
@@ -60438,7 +60458,6 @@ var CanvasManager = class {
60438
60458
  * @param data The object.
60439
60459
  */
60440
60460
  async import(data) {
60441
- this.clear();
60442
60461
  try {
60443
60462
  let tickersOnPause = data["tickersOnPause"] || {};
60444
60463
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -60446,6 +60465,7 @@ var CanvasManager = class {
60446
60465
  let elementAliasesOrder = data["elementAliasesOrder"];
60447
60466
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
60448
60467
  let list = await Promise.all(promises);
60468
+ this.clear();
60449
60469
  list.forEach((element, i3) => {
60450
60470
  let alias = elementAliasesOrder[i3];
60451
60471
  this.add(alias, element);
@@ -63843,9 +63863,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
63843
63863
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
63844
63864
  };
63845
63865
  canvas.removeAll();
63846
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
63847
- container.anchor = 0.5;
63848
- container.align = 0.5;
63866
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
63867
+ canvas.add("container", container);
63849
63868
  let helmlok = addImage("helmlok", helmlokImage);
63850
63869
  helmlok.anchor = 0.5;
63851
63870
  helmlok.xAlign = 1;
@@ -64156,6 +64175,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64156
64175
  pixivnId = CANVAS_IMAGE_ID;
64157
64176
  constructor(options, textureAlias) {
64158
64177
  super(options);
64178
+ options = analizePositionsExtensionProps(options);
64159
64179
  if (textureAlias) {
64160
64180
  this.textureAlias = textureAlias;
64161
64181
  }
@@ -64179,7 +64199,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64179
64199
  this.setMemory(value);
64180
64200
  }
64181
64201
  async setMemory(value) {
64182
- await super.setMemory(value);
64202
+ await setMemoryImageSprite(this, value);
64183
64203
  this.reloadPosition();
64184
64204
  }
64185
64205
  static from(source7, skipCache) {
@@ -64316,9 +64336,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64316
64336
  }
64317
64337
  };
64318
64338
  async function setMemoryImageSprite(element, memory) {
64339
+ memory = analizePositionsExtensionProps(memory);
64319
64340
  return await setMemorySprite(element, memory, {
64320
64341
  half: async () => {
64321
64342
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
64343
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
64322
64344
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
64323
64345
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
64324
64346
  await element.load();
@@ -1,8 +1,8 @@
1
1
  import ImageContainer from '../../classes/canvas/ImageContainer.cjs';
2
2
  import 'pixi.js';
3
- import '../../ContainerChild-CEuXVx00.cjs';
4
- import '../../interface/canvas/TextureMemory.cjs';
3
+ import '../../ContainerChild-WzyxEjAc.cjs';
5
4
  import '../../classes/canvas/AdditionalPositions.cjs';
5
+ import '../../interface/canvas/TextureMemory.cjs';
6
6
  import '../../classes/canvas/AnchorExtension.cjs';
7
7
  import '../../types/CanvasEventNamesType.cjs';
8
8
  import '../../classes/CanvasEvent.cjs';
@@ -1,8 +1,8 @@
1
1
  import ImageContainer from '../../classes/canvas/ImageContainer.js';
2
2
  import 'pixi.js';
3
- import '../../ContainerChild-HBivknFV.js';
4
- import '../../interface/canvas/TextureMemory.js';
3
+ import '../../ContainerChild-B5yD0BI8.js';
5
4
  import '../../classes/canvas/AdditionalPositions.js';
5
+ import '../../interface/canvas/TextureMemory.js';
6
6
  import '../../classes/canvas/AnchorExtension.js';
7
7
  import '../../types/CanvasEventNamesType.js';
8
8
  import '../../classes/CanvasEvent.js';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addImageCointainer,
3
3
  showImageContainer
4
- } from "../../chunk-JMXJKUTS.js";
4
+ } from "../../chunk-NB4Q3GFK.js";
5
5
  import "../../chunk-OMPJ74CO.js";
6
6
  import "../../chunk-2JGQWY5I.js";
7
7
  import "../../chunk-2BUPSB7O.js";
8
- import "../../chunk-SCOZ46ME.js";
8
+ import "../../chunk-IRUKNG2Y.js";
9
9
  import "../../chunk-6GJXIPNB.js";
10
10
  import "../../chunk-I6TNJEE3.js";
11
11
  import "../../chunk-DPUSONJ3.js";
@@ -22,7 +22,7 @@ import "../../chunk-ZBUW3MBH.js";
22
22
  import "../../chunk-PIYIZHZL.js";
23
23
  import "../../chunk-B7XQM2BB.js";
24
24
  import "../../chunk-LEMOIFSV.js";
25
- import "../../chunk-AQPVWC55.js";
25
+ import "../../chunk-TOG67Z7Q.js";
26
26
  import "../../chunk-WS3FY4Q6.js";
27
27
  import "../../chunk-Z3NBKYVU.js";
28
28
  import "../../chunk-SAUNZQHZ.js";
@@ -57723,7 +57723,7 @@ extensions.add(soundAsset);
57723
57723
  var sound = setInstance(new SoundLibrary());
57724
57724
 
57725
57725
  // package.json
57726
- var version = "0.9.6";
57726
+ var version = "0.9.7";
57727
57727
 
57728
57728
  // src/constants.ts
57729
57729
  var Repeat = "repeat";
@@ -58127,12 +58127,15 @@ var Container2 = class extends Container {
58127
58127
  this.setMemory(value);
58128
58128
  }
58129
58129
  async setMemory(value) {
58130
+ await this.importChildren(value);
58131
+ return await setMemoryContainer(this, value);
58132
+ }
58133
+ async importChildren(value) {
58130
58134
  for (let i3 = 0; i3 < value.elements.length; i3++) {
58131
58135
  let child = value.elements[i3];
58132
58136
  let element = await importCanvasElement(child);
58133
58137
  this.addChild(element);
58134
58138
  }
58135
- return await setMemoryContainer(this, value);
58136
58139
  }
58137
58140
  };
58138
58141
  function getMemoryContainer(element) {
@@ -58220,29 +58223,43 @@ function analizePositionsExtensionProps(props) {
58220
58223
  if (!props) {
58221
58224
  return props;
58222
58225
  }
58223
- if (props.align != void 0) {
58224
- if (typeof props.align === "number") {
58225
- props.xAlign = props.align;
58226
- props.yAlign = props.align;
58227
- } else {
58228
- if (props.align.x != void 0) {
58229
- props.xAlign = props.align.x;
58226
+ if (typeof props.align !== "number") {
58227
+ if (props.xAlign != void 0) {
58228
+ if (props.align === void 0) {
58229
+ props.align = { x: props.xAlign };
58230
+ delete props.xAlign;
58231
+ } else {
58232
+ props.align.x = props.xAlign;
58233
+ delete props.xAlign;
58230
58234
  }
58231
- if (props.align.y != void 0) {
58232
- props.yAlign = props.align.y;
58235
+ }
58236
+ if (props.yAlign != void 0) {
58237
+ if (props.align === void 0) {
58238
+ props.align = { y: props.yAlign };
58239
+ delete props.yAlign;
58240
+ } else {
58241
+ props.align.y = props.yAlign;
58242
+ delete props.yAlign;
58233
58243
  }
58234
58244
  }
58235
58245
  }
58236
- if (props.percentagePosition != void 0) {
58237
- if (typeof props.percentagePosition === "number") {
58238
- props.xPercentagePosition = props.percentagePosition;
58239
- props.yPercentagePosition = props.percentagePosition;
58240
- } else {
58241
- if (props.percentagePosition.x != void 0) {
58242
- props.xPercentagePosition = props.percentagePosition.x;
58246
+ if (typeof props.percentagePosition !== "number") {
58247
+ if (props.xPercentagePosition != void 0) {
58248
+ if (props.percentagePosition === void 0) {
58249
+ props.percentagePosition = { x: props.xPercentagePosition };
58250
+ delete props.xPercentagePosition;
58251
+ } else {
58252
+ props.percentagePosition.x = props.xPercentagePosition;
58253
+ delete props.xPercentagePosition;
58243
58254
  }
58244
- if (props.percentagePosition.y != void 0) {
58245
- props.yPercentagePosition = props.percentagePosition.y;
58255
+ }
58256
+ if (props.yPercentagePosition != void 0) {
58257
+ if (props.percentagePosition === void 0) {
58258
+ props.percentagePosition = { y: props.yPercentagePosition };
58259
+ delete props.yPercentagePosition;
58260
+ } else {
58261
+ props.percentagePosition.y = props.yPercentagePosition;
58262
+ delete props.yPercentagePosition;
58246
58263
  }
58247
58264
  }
58248
58265
  }
@@ -58262,10 +58279,10 @@ var ImageContainer = class extends Container2 {
58262
58279
  if (options?.anchor !== void 0) {
58263
58280
  this.anchor = options.anchor;
58264
58281
  }
58265
- if (options?.align !== void 0) {
58282
+ if (options && "align" in options && options?.align !== void 0) {
58266
58283
  this.align = options.align;
58267
58284
  }
58268
- if (options?.percentagePosition !== void 0) {
58285
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58269
58286
  this.percentagePosition = options.percentagePosition;
58270
58287
  }
58271
58288
  }
@@ -58283,7 +58300,8 @@ var ImageContainer = class extends Container2 {
58283
58300
  this.setMemory(value);
58284
58301
  }
58285
58302
  async setMemory(value) {
58286
- await super.setMemory(value);
58303
+ await this.importChildren(value);
58304
+ await setMemoryImageContainer(this, value);
58287
58305
  this.reloadAnchor();
58288
58306
  this.reloadPosition();
58289
58307
  }
@@ -58457,11 +58475,13 @@ var ImageContainer = class extends Container2 {
58457
58475
  }
58458
58476
  };
58459
58477
  async function setMemoryImageContainer(element, memory, opstions) {
58478
+ memory = analizePositionsExtensionProps(memory);
58460
58479
  setMemoryContainer(element, memory, {
58461
58480
  ...opstions,
58462
58481
  end: async () => {
58463
58482
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58464
58483
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58484
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58465
58485
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58466
58486
  await element.load();
58467
58487
  }
@@ -60407,7 +60427,6 @@ var CanvasManager = class {
60407
60427
  * @param data The object.
60408
60428
  */
60409
60429
  async import(data) {
60410
- this.clear();
60411
60430
  try {
60412
60431
  let tickersOnPause = data["tickersOnPause"] || {};
60413
60432
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -60415,6 +60434,7 @@ var CanvasManager = class {
60415
60434
  let elementAliasesOrder = data["elementAliasesOrder"];
60416
60435
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
60417
60436
  let list = await Promise.all(promises);
60437
+ this.clear();
60418
60438
  list.forEach((element, i3) => {
60419
60439
  let alias = elementAliasesOrder[i3];
60420
60440
  this.add(alias, element);
@@ -63812,9 +63832,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
63812
63832
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
63813
63833
  };
63814
63834
  canvas.removeAll();
63815
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
63816
- container.anchor = 0.5;
63817
- container.align = 0.5;
63835
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
63836
+ canvas.add("container", container);
63818
63837
  let helmlok = addImage("helmlok", helmlokImage);
63819
63838
  helmlok.anchor = 0.5;
63820
63839
  helmlok.xAlign = 1;
@@ -64125,6 +64144,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64125
64144
  pixivnId = CANVAS_IMAGE_ID;
64126
64145
  constructor(options, textureAlias) {
64127
64146
  super(options);
64147
+ options = analizePositionsExtensionProps(options);
64128
64148
  if (textureAlias) {
64129
64149
  this.textureAlias = textureAlias;
64130
64150
  }
@@ -64148,7 +64168,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64148
64168
  this.setMemory(value);
64149
64169
  }
64150
64170
  async setMemory(value) {
64151
- await super.setMemory(value);
64171
+ await setMemoryImageSprite(this, value);
64152
64172
  this.reloadPosition();
64153
64173
  }
64154
64174
  static from(source7, skipCache) {
@@ -64285,9 +64305,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64285
64305
  }
64286
64306
  };
64287
64307
  async function setMemoryImageSprite(element, memory) {
64308
+ memory = analizePositionsExtensionProps(memory);
64288
64309
  return await setMemorySprite(element, memory, {
64289
64310
  half: async () => {
64290
64311
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
64312
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
64291
64313
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
64292
64314
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
64293
64315
  await element.load();
@@ -1,7 +1,7 @@
1
- import { I as ImageSprite } from '../../ContainerChild-CEuXVx00.cjs';
1
+ import { I as ImageSprite } from '../../ContainerChild-WzyxEjAc.cjs';
2
2
  import 'pixi.js';
3
- import '../../interface/canvas/TextureMemory.cjs';
4
3
  import '../../classes/canvas/AdditionalPositions.cjs';
4
+ import '../../interface/canvas/TextureMemory.cjs';
5
5
  import '../../classes/canvas/AnchorExtension.cjs';
6
6
  import '../../types/CanvasEventNamesType.cjs';
7
7
  import '../../classes/CanvasEvent.cjs';
@@ -1,7 +1,7 @@
1
- import { I as ImageSprite } from '../../ContainerChild-HBivknFV.js';
1
+ import { I as ImageSprite } from '../../ContainerChild-B5yD0BI8.js';
2
2
  import 'pixi.js';
3
- import '../../interface/canvas/TextureMemory.js';
4
3
  import '../../classes/canvas/AdditionalPositions.js';
4
+ import '../../interface/canvas/TextureMemory.js';
5
5
  import '../../classes/canvas/AnchorExtension.js';
6
6
  import '../../types/CanvasEventNamesType.js';
7
7
  import '../../classes/CanvasEvent.js';