@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
@@ -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";
@@ -58571,29 +58571,43 @@ function analizePositionsExtensionProps(props) {
58571
58571
  if (!props) {
58572
58572
  return props;
58573
58573
  }
58574
- if (props.align != void 0) {
58575
- if (typeof props.align === "number") {
58576
- props.xAlign = props.align;
58577
- props.yAlign = props.align;
58578
- } else {
58579
- if (props.align.x != void 0) {
58580
- props.xAlign = props.align.x;
58574
+ if (typeof props.align !== "number") {
58575
+ if (props.xAlign != void 0) {
58576
+ if (props.align === void 0) {
58577
+ props.align = { x: props.xAlign };
58578
+ delete props.xAlign;
58579
+ } else {
58580
+ props.align.x = props.xAlign;
58581
+ delete props.xAlign;
58581
58582
  }
58582
- if (props.align.y != void 0) {
58583
- props.yAlign = props.align.y;
58583
+ }
58584
+ if (props.yAlign != void 0) {
58585
+ if (props.align === void 0) {
58586
+ props.align = { y: props.yAlign };
58587
+ delete props.yAlign;
58588
+ } else {
58589
+ props.align.y = props.yAlign;
58590
+ delete props.yAlign;
58584
58591
  }
58585
58592
  }
58586
58593
  }
58587
- if (props.percentagePosition != void 0) {
58588
- if (typeof props.percentagePosition === "number") {
58589
- props.xPercentagePosition = props.percentagePosition;
58590
- props.yPercentagePosition = props.percentagePosition;
58591
- } else {
58592
- if (props.percentagePosition.x != void 0) {
58593
- props.xPercentagePosition = props.percentagePosition.x;
58594
+ if (typeof props.percentagePosition !== "number") {
58595
+ if (props.xPercentagePosition != void 0) {
58596
+ if (props.percentagePosition === void 0) {
58597
+ props.percentagePosition = { x: props.xPercentagePosition };
58598
+ delete props.xPercentagePosition;
58599
+ } else {
58600
+ props.percentagePosition.x = props.xPercentagePosition;
58601
+ delete props.xPercentagePosition;
58594
58602
  }
58595
- if (props.percentagePosition.y != void 0) {
58596
- props.yPercentagePosition = props.percentagePosition.y;
58603
+ }
58604
+ if (props.yPercentagePosition != void 0) {
58605
+ if (props.percentagePosition === void 0) {
58606
+ props.percentagePosition = { y: props.yPercentagePosition };
58607
+ delete props.yPercentagePosition;
58608
+ } else {
58609
+ props.percentagePosition.y = props.yPercentagePosition;
58610
+ delete props.yPercentagePosition;
58597
58611
  }
58598
58612
  }
58599
58613
  }
@@ -58635,12 +58649,15 @@ var Container2 = class extends Container {
58635
58649
  this.setMemory(value);
58636
58650
  }
58637
58651
  async setMemory(value) {
58652
+ await this.importChildren(value);
58653
+ return await setMemoryContainer(this, value);
58654
+ }
58655
+ async importChildren(value) {
58638
58656
  for (let i3 = 0; i3 < value.elements.length; i3++) {
58639
58657
  let child = value.elements[i3];
58640
58658
  let element = await importCanvasElement(child);
58641
58659
  this.addChild(element);
58642
58660
  }
58643
- return await setMemoryContainer(this, value);
58644
58661
  }
58645
58662
  };
58646
58663
  function getMemoryContainer(element) {
@@ -58732,10 +58749,10 @@ var ImageContainer = class extends Container2 {
58732
58749
  if (options?.anchor !== void 0) {
58733
58750
  this.anchor = options.anchor;
58734
58751
  }
58735
- if (options?.align !== void 0) {
58752
+ if (options && "align" in options && options?.align !== void 0) {
58736
58753
  this.align = options.align;
58737
58754
  }
58738
- if (options?.percentagePosition !== void 0) {
58755
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58739
58756
  this.percentagePosition = options.percentagePosition;
58740
58757
  }
58741
58758
  }
@@ -58753,7 +58770,8 @@ var ImageContainer = class extends Container2 {
58753
58770
  this.setMemory(value);
58754
58771
  }
58755
58772
  async setMemory(value) {
58756
- await super.setMemory(value);
58773
+ await this.importChildren(value);
58774
+ await setMemoryImageContainer(this, value);
58757
58775
  this.reloadAnchor();
58758
58776
  this.reloadPosition();
58759
58777
  }
@@ -58927,11 +58945,13 @@ var ImageContainer = class extends Container2 {
58927
58945
  }
58928
58946
  };
58929
58947
  async function setMemoryImageContainer(element, memory, opstions) {
58948
+ memory = analizePositionsExtensionProps(memory);
58930
58949
  setMemoryContainer(element, memory, {
58931
58950
  ...opstions,
58932
58951
  end: async () => {
58933
58952
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58934
58953
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58954
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58935
58955
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58936
58956
  await element.load();
58937
58957
  }
@@ -60296,9 +60316,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
60296
60316
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
60297
60317
  };
60298
60318
  canvas.removeAll();
60299
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
60300
- container.anchor = 0.5;
60301
- container.align = 0.5;
60319
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
60320
+ canvas.add("container", container);
60302
60321
  let helmlok = addImage("helmlok", helmlokImage);
60303
60322
  helmlok.anchor = 0.5;
60304
60323
  helmlok.xAlign = 1;
@@ -60758,6 +60777,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60758
60777
  pixivnId = CANVAS_IMAGE_ID;
60759
60778
  constructor(options, textureAlias) {
60760
60779
  super(options);
60780
+ options = analizePositionsExtensionProps(options);
60761
60781
  if (textureAlias) {
60762
60782
  this.textureAlias = textureAlias;
60763
60783
  }
@@ -60781,7 +60801,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60781
60801
  this.setMemory(value);
60782
60802
  }
60783
60803
  async setMemory(value) {
60784
- await super.setMemory(value);
60804
+ await setMemoryImageSprite(this, value);
60785
60805
  this.reloadPosition();
60786
60806
  }
60787
60807
  static from(source7, skipCache) {
@@ -60918,9 +60938,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
60918
60938
  }
60919
60939
  };
60920
60940
  async function setMemoryImageSprite(element, memory) {
60941
+ memory = analizePositionsExtensionProps(memory);
60921
60942
  return await setMemorySprite(element, memory, {
60922
60943
  half: async () => {
60923
60944
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
60945
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
60924
60946
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
60925
60947
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
60926
60948
  await element.load();
@@ -62595,7 +62617,6 @@ var CanvasManager = class {
62595
62617
  * @param data The object.
62596
62618
  */
62597
62619
  async import(data) {
62598
- this.clear();
62599
62620
  try {
62600
62621
  let tickersOnPause = data["tickersOnPause"] || {};
62601
62622
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -62603,6 +62624,7 @@ var CanvasManager = class {
62603
62624
  let elementAliasesOrder = data["elementAliasesOrder"];
62604
62625
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
62605
62626
  let list = await Promise.all(promises);
62627
+ this.clear();
62606
62628
  list.forEach((element, i3) => {
62607
62629
  let alias = elementAliasesOrder[i3];
62608
62630
  this.add(alias, element);
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  TickerBase
3
- } from "../../chunk-JMXJKUTS.js";
3
+ } from "../../chunk-NB4Q3GFK.js";
4
4
  import "../../chunk-OMPJ74CO.js";
5
5
  import "../../chunk-2JGQWY5I.js";
6
6
  import "../../chunk-2BUPSB7O.js";
7
- import "../../chunk-SCOZ46ME.js";
7
+ import "../../chunk-IRUKNG2Y.js";
8
8
  import "../../chunk-6GJXIPNB.js";
9
9
  import "../../chunk-I6TNJEE3.js";
10
10
  import "../../chunk-DPUSONJ3.js";
@@ -21,7 +21,7 @@ import "../../chunk-ZBUW3MBH.js";
21
21
  import "../../chunk-PIYIZHZL.js";
22
22
  import "../../chunk-B7XQM2BB.js";
23
23
  import "../../chunk-LEMOIFSV.js";
24
- import "../../chunk-AQPVWC55.js";
24
+ import "../../chunk-TOG67Z7Q.js";
25
25
  import "../../chunk-WS3FY4Q6.js";
26
26
  import "../../chunk-Z3NBKYVU.js";
27
27
  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";
@@ -57967,12 +57967,15 @@ var Container3 = class extends Container {
57967
57967
  this.setMemory(value);
57968
57968
  }
57969
57969
  async setMemory(value) {
57970
+ await this.importChildren(value);
57971
+ return await setMemoryContainer(this, value);
57972
+ }
57973
+ async importChildren(value) {
57970
57974
  for (let i3 = 0; i3 < value.elements.length; i3++) {
57971
57975
  let child = value.elements[i3];
57972
57976
  let element = await importCanvasElement(child);
57973
57977
  this.addChild(element);
57974
57978
  }
57975
- return await setMemoryContainer(this, value);
57976
57979
  }
57977
57980
  };
57978
57981
  function getMemoryContainer(element) {
@@ -58060,29 +58063,43 @@ function analizePositionsExtensionProps(props) {
58060
58063
  if (!props) {
58061
58064
  return props;
58062
58065
  }
58063
- if (props.align != void 0) {
58064
- if (typeof props.align === "number") {
58065
- props.xAlign = props.align;
58066
- props.yAlign = props.align;
58067
- } else {
58068
- if (props.align.x != void 0) {
58069
- props.xAlign = props.align.x;
58066
+ if (typeof props.align !== "number") {
58067
+ if (props.xAlign != void 0) {
58068
+ if (props.align === void 0) {
58069
+ props.align = { x: props.xAlign };
58070
+ delete props.xAlign;
58071
+ } else {
58072
+ props.align.x = props.xAlign;
58073
+ delete props.xAlign;
58070
58074
  }
58071
- if (props.align.y != void 0) {
58072
- props.yAlign = props.align.y;
58075
+ }
58076
+ if (props.yAlign != void 0) {
58077
+ if (props.align === void 0) {
58078
+ props.align = { y: props.yAlign };
58079
+ delete props.yAlign;
58080
+ } else {
58081
+ props.align.y = props.yAlign;
58082
+ delete props.yAlign;
58073
58083
  }
58074
58084
  }
58075
58085
  }
58076
- if (props.percentagePosition != void 0) {
58077
- if (typeof props.percentagePosition === "number") {
58078
- props.xPercentagePosition = props.percentagePosition;
58079
- props.yPercentagePosition = props.percentagePosition;
58080
- } else {
58081
- if (props.percentagePosition.x != void 0) {
58082
- props.xPercentagePosition = props.percentagePosition.x;
58086
+ if (typeof props.percentagePosition !== "number") {
58087
+ if (props.xPercentagePosition != void 0) {
58088
+ if (props.percentagePosition === void 0) {
58089
+ props.percentagePosition = { x: props.xPercentagePosition };
58090
+ delete props.xPercentagePosition;
58091
+ } else {
58092
+ props.percentagePosition.x = props.xPercentagePosition;
58093
+ delete props.xPercentagePosition;
58083
58094
  }
58084
- if (props.percentagePosition.y != void 0) {
58085
- props.yPercentagePosition = props.percentagePosition.y;
58095
+ }
58096
+ if (props.yPercentagePosition != void 0) {
58097
+ if (props.percentagePosition === void 0) {
58098
+ props.percentagePosition = { y: props.yPercentagePosition };
58099
+ delete props.yPercentagePosition;
58100
+ } else {
58101
+ props.percentagePosition.y = props.yPercentagePosition;
58102
+ delete props.yPercentagePosition;
58086
58103
  }
58087
58104
  }
58088
58105
  }
@@ -58102,10 +58119,10 @@ var ImageContainer = class extends Container3 {
58102
58119
  if (options?.anchor !== void 0) {
58103
58120
  this.anchor = options.anchor;
58104
58121
  }
58105
- if (options?.align !== void 0) {
58122
+ if (options && "align" in options && options?.align !== void 0) {
58106
58123
  this.align = options.align;
58107
58124
  }
58108
- if (options?.percentagePosition !== void 0) {
58125
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58109
58126
  this.percentagePosition = options.percentagePosition;
58110
58127
  }
58111
58128
  }
@@ -58123,7 +58140,8 @@ var ImageContainer = class extends Container3 {
58123
58140
  this.setMemory(value);
58124
58141
  }
58125
58142
  async setMemory(value) {
58126
- await super.setMemory(value);
58143
+ await this.importChildren(value);
58144
+ await setMemoryImageContainer(this, value);
58127
58145
  this.reloadAnchor();
58128
58146
  this.reloadPosition();
58129
58147
  }
@@ -58297,11 +58315,13 @@ var ImageContainer = class extends Container3 {
58297
58315
  }
58298
58316
  };
58299
58317
  async function setMemoryImageContainer(element, memory, opstions) {
58318
+ memory = analizePositionsExtensionProps(memory);
58300
58319
  setMemoryContainer(element, memory, {
58301
58320
  ...opstions,
58302
58321
  end: async () => {
58303
58322
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58304
58323
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58324
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58305
58325
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58306
58326
  await element.load();
58307
58327
  }
@@ -60358,7 +60378,6 @@ var CanvasManager = class {
60358
60378
  * @param data The object.
60359
60379
  */
60360
60380
  async import(data) {
60361
- this.clear();
60362
60381
  try {
60363
60382
  let tickersOnPause = data["tickersOnPause"] || {};
60364
60383
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -60366,6 +60385,7 @@ var CanvasManager = class {
60366
60385
  let elementAliasesOrder = data["elementAliasesOrder"];
60367
60386
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
60368
60387
  let list = await Promise.all(promises);
60388
+ this.clear();
60369
60389
  list.forEach((element, i3) => {
60370
60390
  let alias = elementAliasesOrder[i3];
60371
60391
  this.add(alias, element);
@@ -63646,9 +63666,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
63646
63666
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
63647
63667
  };
63648
63668
  canvas.removeAll();
63649
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
63650
- container.anchor = 0.5;
63651
- container.align = 0.5;
63669
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
63670
+ canvas.add("container", container);
63652
63671
  let helmlok = addImage("helmlok", helmlokImage);
63653
63672
  helmlok.anchor = 0.5;
63654
63673
  helmlok.xAlign = 1;
@@ -63959,6 +63978,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
63959
63978
  pixivnId = CANVAS_IMAGE_ID;
63960
63979
  constructor(options, textureAlias) {
63961
63980
  super(options);
63981
+ options = analizePositionsExtensionProps(options);
63962
63982
  if (textureAlias) {
63963
63983
  this.textureAlias = textureAlias;
63964
63984
  }
@@ -63982,7 +64002,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
63982
64002
  this.setMemory(value);
63983
64003
  }
63984
64004
  async setMemory(value) {
63985
- await super.setMemory(value);
64005
+ await setMemoryImageSprite(this, value);
63986
64006
  this.reloadPosition();
63987
64007
  }
63988
64008
  static from(source7, skipCache) {
@@ -64119,9 +64139,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64119
64139
  }
64120
64140
  };
64121
64141
  async function setMemoryImageSprite(element, memory) {
64142
+ memory = analizePositionsExtensionProps(memory);
64122
64143
  return await setMemorySprite(element, memory, {
64123
64144
  half: async () => {
64124
64145
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
64146
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
64125
64147
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
64126
64148
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
64127
64149
  await element.load();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ZoomTicker
3
- } from "../../chunk-JMXJKUTS.js";
3
+ } from "../../chunk-NB4Q3GFK.js";
4
4
  import "../../chunk-OMPJ74CO.js";
5
5
  import "../../chunk-2JGQWY5I.js";
6
6
  import "../../chunk-2BUPSB7O.js";
7
- import "../../chunk-SCOZ46ME.js";
7
+ import "../../chunk-IRUKNG2Y.js";
8
8
  import "../../chunk-6GJXIPNB.js";
9
9
  import "../../chunk-I6TNJEE3.js";
10
10
  import "../../chunk-DPUSONJ3.js";
@@ -21,7 +21,7 @@ import "../../chunk-ZBUW3MBH.js";
21
21
  import "../../chunk-PIYIZHZL.js";
22
22
  import "../../chunk-B7XQM2BB.js";
23
23
  import "../../chunk-LEMOIFSV.js";
24
- import "../../chunk-AQPVWC55.js";
24
+ import "../../chunk-TOG67Z7Q.js";
25
25
  import "../../chunk-WS3FY4Q6.js";
26
26
  import "../../chunk-Z3NBKYVU.js";
27
27
  import "../../chunk-SAUNZQHZ.js";
@@ -57727,7 +57727,7 @@ extensions.add(soundAsset);
57727
57727
  var sound = setInstance(new SoundLibrary());
57728
57728
 
57729
57729
  // package.json
57730
- var version = "0.9.6";
57730
+ var version = "0.9.7";
57731
57731
 
57732
57732
  // src/constants.ts
57733
57733
  var Repeat = "repeat";
@@ -57900,12 +57900,15 @@ var Container2 = class extends Container {
57900
57900
  this.setMemory(value);
57901
57901
  }
57902
57902
  async setMemory(value) {
57903
+ await this.importChildren(value);
57904
+ return await setMemoryContainer(this, value);
57905
+ }
57906
+ async importChildren(value) {
57903
57907
  for (let i3 = 0; i3 < value.elements.length; i3++) {
57904
57908
  let child = value.elements[i3];
57905
57909
  let element = await importCanvasElement(child);
57906
57910
  this.addChild(element);
57907
57911
  }
57908
- return await setMemoryContainer(this, value);
57909
57912
  }
57910
57913
  };
57911
57914
  function getMemoryContainer(element) {
@@ -57993,29 +57996,43 @@ function analizePositionsExtensionProps(props) {
57993
57996
  if (!props) {
57994
57997
  return props;
57995
57998
  }
57996
- if (props.align != void 0) {
57997
- if (typeof props.align === "number") {
57998
- props.xAlign = props.align;
57999
- props.yAlign = props.align;
58000
- } else {
58001
- if (props.align.x != void 0) {
58002
- props.xAlign = props.align.x;
57999
+ if (typeof props.align !== "number") {
58000
+ if (props.xAlign != void 0) {
58001
+ if (props.align === void 0) {
58002
+ props.align = { x: props.xAlign };
58003
+ delete props.xAlign;
58004
+ } else {
58005
+ props.align.x = props.xAlign;
58006
+ delete props.xAlign;
58003
58007
  }
58004
- if (props.align.y != void 0) {
58005
- props.yAlign = props.align.y;
58008
+ }
58009
+ if (props.yAlign != void 0) {
58010
+ if (props.align === void 0) {
58011
+ props.align = { y: props.yAlign };
58012
+ delete props.yAlign;
58013
+ } else {
58014
+ props.align.y = props.yAlign;
58015
+ delete props.yAlign;
58006
58016
  }
58007
58017
  }
58008
58018
  }
58009
- if (props.percentagePosition != void 0) {
58010
- if (typeof props.percentagePosition === "number") {
58011
- props.xPercentagePosition = props.percentagePosition;
58012
- props.yPercentagePosition = props.percentagePosition;
58013
- } else {
58014
- if (props.percentagePosition.x != void 0) {
58015
- props.xPercentagePosition = props.percentagePosition.x;
58019
+ if (typeof props.percentagePosition !== "number") {
58020
+ if (props.xPercentagePosition != void 0) {
58021
+ if (props.percentagePosition === void 0) {
58022
+ props.percentagePosition = { x: props.xPercentagePosition };
58023
+ delete props.xPercentagePosition;
58024
+ } else {
58025
+ props.percentagePosition.x = props.xPercentagePosition;
58026
+ delete props.xPercentagePosition;
58016
58027
  }
58017
- if (props.percentagePosition.y != void 0) {
58018
- props.yPercentagePosition = props.percentagePosition.y;
58028
+ }
58029
+ if (props.yPercentagePosition != void 0) {
58030
+ if (props.percentagePosition === void 0) {
58031
+ props.percentagePosition = { y: props.yPercentagePosition };
58032
+ delete props.yPercentagePosition;
58033
+ } else {
58034
+ props.percentagePosition.y = props.yPercentagePosition;
58035
+ delete props.yPercentagePosition;
58019
58036
  }
58020
58037
  }
58021
58038
  }
@@ -58035,10 +58052,10 @@ var ImageContainer = class extends Container2 {
58035
58052
  if (options?.anchor !== void 0) {
58036
58053
  this.anchor = options.anchor;
58037
58054
  }
58038
- if (options?.align !== void 0) {
58055
+ if (options && "align" in options && options?.align !== void 0) {
58039
58056
  this.align = options.align;
58040
58057
  }
58041
- if (options?.percentagePosition !== void 0) {
58058
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58042
58059
  this.percentagePosition = options.percentagePosition;
58043
58060
  }
58044
58061
  }
@@ -58056,7 +58073,8 @@ var ImageContainer = class extends Container2 {
58056
58073
  this.setMemory(value);
58057
58074
  }
58058
58075
  async setMemory(value) {
58059
- await super.setMemory(value);
58076
+ await this.importChildren(value);
58077
+ await setMemoryImageContainer(this, value);
58060
58078
  this.reloadAnchor();
58061
58079
  this.reloadPosition();
58062
58080
  }
@@ -58230,11 +58248,13 @@ var ImageContainer = class extends Container2 {
58230
58248
  }
58231
58249
  };
58232
58250
  async function setMemoryImageContainer(element, memory, opstions) {
58251
+ memory = analizePositionsExtensionProps(memory);
58233
58252
  setMemoryContainer(element, memory, {
58234
58253
  ...opstions,
58235
58254
  end: async () => {
58236
58255
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58237
58256
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58257
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58238
58258
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58239
58259
  await element.load();
58240
58260
  }
@@ -59773,7 +59793,6 @@ var CanvasManager = class {
59773
59793
  * @param data The object.
59774
59794
  */
59775
59795
  async import(data) {
59776
- this.clear();
59777
59796
  try {
59778
59797
  let tickersOnPause = data["tickersOnPause"] || {};
59779
59798
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -59781,6 +59800,7 @@ var CanvasManager = class {
59781
59800
  let elementAliasesOrder = data["elementAliasesOrder"];
59782
59801
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
59783
59802
  let list = await Promise.all(promises);
59803
+ this.clear();
59784
59804
  list.forEach((element, i3) => {
59785
59805
  let alias = elementAliasesOrder[i3];
59786
59806
  this.add(alias, element);
@@ -63396,9 +63416,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
63396
63416
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
63397
63417
  };
63398
63418
  canvas.removeAll();
63399
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
63400
- container.anchor = 0.5;
63401
- container.align = 0.5;
63419
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
63420
+ canvas.add("container", container);
63402
63421
  let helmlok = addImage("helmlok", helmlokImage);
63403
63422
  helmlok.anchor = 0.5;
63404
63423
  helmlok.xAlign = 1;
@@ -63709,6 +63728,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
63709
63728
  pixivnId = CANVAS_IMAGE_ID;
63710
63729
  constructor(options, textureAlias) {
63711
63730
  super(options);
63731
+ options = analizePositionsExtensionProps(options);
63712
63732
  if (textureAlias) {
63713
63733
  this.textureAlias = textureAlias;
63714
63734
  }
@@ -63732,7 +63752,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
63732
63752
  this.setMemory(value);
63733
63753
  }
63734
63754
  async setMemory(value) {
63735
- await super.setMemory(value);
63755
+ await setMemoryImageSprite(this, value);
63736
63756
  this.reloadPosition();
63737
63757
  }
63738
63758
  static from(source7, skipCache) {
@@ -63869,9 +63889,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
63869
63889
  }
63870
63890
  };
63871
63891
  async function setMemoryImageSprite(element, memory) {
63892
+ memory = analizePositionsExtensionProps(memory);
63872
63893
  return await setMemorySprite(element, memory, {
63873
63894
  half: async () => {
63874
63895
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
63896
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
63875
63897
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
63876
63898
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
63877
63899
  await element.load();
@@ -4,11 +4,11 @@ import {
4
4
  RotateTicker,
5
5
  TickerBase,
6
6
  ZoomTicker
7
- } from "../../chunk-JMXJKUTS.js";
7
+ } from "../../chunk-NB4Q3GFK.js";
8
8
  import "../../chunk-OMPJ74CO.js";
9
9
  import "../../chunk-2JGQWY5I.js";
10
10
  import "../../chunk-2BUPSB7O.js";
11
- import "../../chunk-SCOZ46ME.js";
11
+ import "../../chunk-IRUKNG2Y.js";
12
12
  import "../../chunk-6GJXIPNB.js";
13
13
  import "../../chunk-I6TNJEE3.js";
14
14
  import "../../chunk-DPUSONJ3.js";
@@ -25,7 +25,7 @@ import "../../chunk-ZBUW3MBH.js";
25
25
  import "../../chunk-PIYIZHZL.js";
26
26
  import "../../chunk-B7XQM2BB.js";
27
27
  import "../../chunk-LEMOIFSV.js";
28
- import "../../chunk-AQPVWC55.js";
28
+ import "../../chunk-TOG67Z7Q.js";
29
29
  import "../../chunk-WS3FY4Q6.js";
30
30
  import "../../chunk-Z3NBKYVU.js";
31
31
  import "../../chunk-SAUNZQHZ.js";
@@ -28944,7 +28944,7 @@ extensions.add(soundAsset);
28944
28944
  var sound = setInstance(new SoundLibrary());
28945
28945
 
28946
28946
  // package.json
28947
- var version = "0.9.6";
28947
+ var version = "0.9.7";
28948
28948
 
28949
28949
  // src/constants.ts
28950
28950
  var Repeat = "repeat";
@@ -2,7 +2,7 @@ import { filters as filters$1 } from '@pixi/sound';
2
2
  import { PauseType } from './types/PauseType.cjs';
3
3
  import { RepeatType } from './types/RepeatType.cjs';
4
4
 
5
- var version = "0.9.6";
5
+ var version = "0.9.7";
6
6
 
7
7
  declare const Repeat: RepeatType;
8
8
  /**
@@ -2,7 +2,7 @@ import { filters as filters$1 } from '@pixi/sound';
2
2
  import { PauseType } from './types/PauseType.js';
3
3
  import { RepeatType } from './types/RepeatType.js';
4
4
 
5
- var version = "0.9.6";
5
+ var version = "0.9.7";
6
6
 
7
7
  declare const Repeat: RepeatType;
8
8
  /**
package/dist/constants.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  filters,
12
12
  version,
13
13
  videoFormats
14
- } from "./chunk-AQPVWC55.js";
14
+ } from "./chunk-TOG67Z7Q.js";
15
15
  import "./chunk-WS3FY4Q6.js";
16
16
  import "./chunk-Z3NBKYVU.js";
17
17
  import "./chunk-SAUNZQHZ.js";