@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
@@ -26425,29 +26425,43 @@ function analizePositionsExtensionProps(props) {
26425
26425
  if (!props) {
26426
26426
  return props;
26427
26427
  }
26428
- if (props.align != void 0) {
26429
- if (typeof props.align === "number") {
26430
- props.xAlign = props.align;
26431
- props.yAlign = props.align;
26432
- } else {
26433
- if (props.align.x != void 0) {
26434
- props.xAlign = props.align.x;
26428
+ if (typeof props.align !== "number") {
26429
+ if (props.xAlign != void 0) {
26430
+ if (props.align === void 0) {
26431
+ props.align = { x: props.xAlign };
26432
+ delete props.xAlign;
26433
+ } else {
26434
+ props.align.x = props.xAlign;
26435
+ delete props.xAlign;
26435
26436
  }
26436
- if (props.align.y != void 0) {
26437
- props.yAlign = props.align.y;
26437
+ }
26438
+ if (props.yAlign != void 0) {
26439
+ if (props.align === void 0) {
26440
+ props.align = { y: props.yAlign };
26441
+ delete props.yAlign;
26442
+ } else {
26443
+ props.align.y = props.yAlign;
26444
+ delete props.yAlign;
26438
26445
  }
26439
26446
  }
26440
26447
  }
26441
- if (props.percentagePosition != void 0) {
26442
- if (typeof props.percentagePosition === "number") {
26443
- props.xPercentagePosition = props.percentagePosition;
26444
- props.yPercentagePosition = props.percentagePosition;
26445
- } else {
26446
- if (props.percentagePosition.x != void 0) {
26447
- props.xPercentagePosition = props.percentagePosition.x;
26448
+ if (typeof props.percentagePosition !== "number") {
26449
+ if (props.xPercentagePosition != void 0) {
26450
+ if (props.percentagePosition === void 0) {
26451
+ props.percentagePosition = { x: props.xPercentagePosition };
26452
+ delete props.xPercentagePosition;
26453
+ } else {
26454
+ props.percentagePosition.x = props.xPercentagePosition;
26455
+ delete props.xPercentagePosition;
26448
26456
  }
26449
- if (props.percentagePosition.y != void 0) {
26450
- props.yPercentagePosition = props.percentagePosition.y;
26457
+ }
26458
+ if (props.yPercentagePosition != void 0) {
26459
+ if (props.percentagePosition === void 0) {
26460
+ props.percentagePosition = { y: props.yPercentagePosition };
26461
+ delete props.yPercentagePosition;
26462
+ } else {
26463
+ props.percentagePosition.y = props.yPercentagePosition;
26464
+ delete props.yPercentagePosition;
26451
26465
  }
26452
26466
  }
26453
26467
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AdditionalPositionsExtension,
3
3
  analizePositionsExtensionProps
4
- } from "../../chunk-SCOZ46ME.js";
4
+ } from "../../chunk-IRUKNG2Y.js";
5
5
  import "../../chunk-Z3NBKYVU.js";
6
6
  import "../../chunk-SAUNZQHZ.js";
7
7
  import "../../chunk-CAWOWL3P.js";
@@ -1,7 +1,7 @@
1
1
  import 'pixi.js';
2
- export { C as default } from '../../ContainerChild-CEuXVx00.cjs';
3
- import '../../interface/canvas/TextureMemory.cjs';
2
+ export { C as default } from '../../ContainerChild-WzyxEjAc.cjs';
4
3
  import './AdditionalPositions.cjs';
4
+ import '../../interface/canvas/TextureMemory.cjs';
5
5
  import './AnchorExtension.cjs';
6
6
  import '../../types/CanvasEventNamesType.cjs';
7
7
  import '../CanvasEvent.cjs';
@@ -1,7 +1,7 @@
1
1
  import 'pixi.js';
2
- export { C as default } from '../../ContainerChild-HBivknFV.js';
3
- import '../../interface/canvas/TextureMemory.js';
2
+ export { C as default } from '../../ContainerChild-B5yD0BI8.js';
4
3
  import './AdditionalPositions.js';
4
+ import '../../interface/canvas/TextureMemory.js';
5
5
  import './AnchorExtension.js';
6
6
  import '../../types/CanvasEventNamesType.js';
7
7
  import '../CanvasEvent.js';
@@ -57720,7 +57720,7 @@ extensions.add(soundAsset);
57720
57720
  var sound = setInstance(new SoundLibrary());
57721
57721
 
57722
57722
  // package.json
57723
- var version = "0.9.6";
57723
+ var version = "0.9.7";
57724
57724
 
57725
57725
  // src/constants.ts
57726
57726
  var Repeat = "repeat";
@@ -58057,29 +58057,43 @@ function analizePositionsExtensionProps(props) {
58057
58057
  if (!props) {
58058
58058
  return props;
58059
58059
  }
58060
- if (props.align != void 0) {
58061
- if (typeof props.align === "number") {
58062
- props.xAlign = props.align;
58063
- props.yAlign = props.align;
58064
- } else {
58065
- if (props.align.x != void 0) {
58066
- props.xAlign = props.align.x;
58060
+ if (typeof props.align !== "number") {
58061
+ if (props.xAlign != void 0) {
58062
+ if (props.align === void 0) {
58063
+ props.align = { x: props.xAlign };
58064
+ delete props.xAlign;
58065
+ } else {
58066
+ props.align.x = props.xAlign;
58067
+ delete props.xAlign;
58067
58068
  }
58068
- if (props.align.y != void 0) {
58069
- props.yAlign = props.align.y;
58069
+ }
58070
+ if (props.yAlign != void 0) {
58071
+ if (props.align === void 0) {
58072
+ props.align = { y: props.yAlign };
58073
+ delete props.yAlign;
58074
+ } else {
58075
+ props.align.y = props.yAlign;
58076
+ delete props.yAlign;
58070
58077
  }
58071
58078
  }
58072
58079
  }
58073
- if (props.percentagePosition != void 0) {
58074
- if (typeof props.percentagePosition === "number") {
58075
- props.xPercentagePosition = props.percentagePosition;
58076
- props.yPercentagePosition = props.percentagePosition;
58077
- } else {
58078
- if (props.percentagePosition.x != void 0) {
58079
- props.xPercentagePosition = props.percentagePosition.x;
58080
+ if (typeof props.percentagePosition !== "number") {
58081
+ if (props.xPercentagePosition != void 0) {
58082
+ if (props.percentagePosition === void 0) {
58083
+ props.percentagePosition = { x: props.xPercentagePosition };
58084
+ delete props.xPercentagePosition;
58085
+ } else {
58086
+ props.percentagePosition.x = props.xPercentagePosition;
58087
+ delete props.xPercentagePosition;
58080
58088
  }
58081
- if (props.percentagePosition.y != void 0) {
58082
- props.yPercentagePosition = props.percentagePosition.y;
58089
+ }
58090
+ if (props.yPercentagePosition != void 0) {
58091
+ if (props.percentagePosition === void 0) {
58092
+ props.percentagePosition = { y: props.yPercentagePosition };
58093
+ delete props.yPercentagePosition;
58094
+ } else {
58095
+ props.percentagePosition.y = props.yPercentagePosition;
58096
+ delete props.yPercentagePosition;
58083
58097
  }
58084
58098
  }
58085
58099
  }
@@ -58099,10 +58113,10 @@ var ImageContainer = class extends Container3 {
58099
58113
  if (options?.anchor !== void 0) {
58100
58114
  this.anchor = options.anchor;
58101
58115
  }
58102
- if (options?.align !== void 0) {
58116
+ if (options && "align" in options && options?.align !== void 0) {
58103
58117
  this.align = options.align;
58104
58118
  }
58105
- if (options?.percentagePosition !== void 0) {
58119
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
58106
58120
  this.percentagePosition = options.percentagePosition;
58107
58121
  }
58108
58122
  }
@@ -58120,7 +58134,8 @@ var ImageContainer = class extends Container3 {
58120
58134
  this.setMemory(value);
58121
58135
  }
58122
58136
  async setMemory(value) {
58123
- await super.setMemory(value);
58137
+ await this.importChildren(value);
58138
+ await setMemoryImageContainer(this, value);
58124
58139
  this.reloadAnchor();
58125
58140
  this.reloadPosition();
58126
58141
  }
@@ -58294,11 +58309,13 @@ var ImageContainer = class extends Container3 {
58294
58309
  }
58295
58310
  };
58296
58311
  async function setMemoryImageContainer(element, memory, opstions) {
58312
+ memory = analizePositionsExtensionProps(memory);
58297
58313
  setMemoryContainer(element, memory, {
58298
58314
  ...opstions,
58299
58315
  end: async () => {
58300
58316
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
58301
58317
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
58318
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
58302
58319
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
58303
58320
  await element.load();
58304
58321
  }
@@ -60284,7 +60301,6 @@ var CanvasManager = class {
60284
60301
  * @param data The object.
60285
60302
  */
60286
60303
  async import(data) {
60287
- this.clear();
60288
60304
  try {
60289
60305
  let tickersOnPause = data["tickersOnPause"] || {};
60290
60306
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -60292,6 +60308,7 @@ var CanvasManager = class {
60292
60308
  let elementAliasesOrder = data["elementAliasesOrder"];
60293
60309
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
60294
60310
  let list = await Promise.all(promises);
60311
+ this.clear();
60295
60312
  list.forEach((element, i3) => {
60296
60313
  let alias = elementAliasesOrder[i3];
60297
60314
  this.add(alias, element);
@@ -63689,9 +63706,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
63689
63706
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
63690
63707
  };
63691
63708
  canvas.removeAll();
63692
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
63693
- container.anchor = 0.5;
63694
- container.align = 0.5;
63709
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
63710
+ canvas.add("container", container);
63695
63711
  let helmlok = addImage("helmlok", helmlokImage);
63696
63712
  helmlok.anchor = 0.5;
63697
63713
  helmlok.xAlign = 1;
@@ -64002,6 +64018,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64002
64018
  pixivnId = CANVAS_IMAGE_ID;
64003
64019
  constructor(options, textureAlias) {
64004
64020
  super(options);
64021
+ options = analizePositionsExtensionProps(options);
64005
64022
  if (textureAlias) {
64006
64023
  this.textureAlias = textureAlias;
64007
64024
  }
@@ -64025,7 +64042,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64025
64042
  this.setMemory(value);
64026
64043
  }
64027
64044
  async setMemory(value) {
64028
- await super.setMemory(value);
64045
+ await setMemoryImageSprite(this, value);
64029
64046
  this.reloadPosition();
64030
64047
  }
64031
64048
  static from(source7, skipCache) {
@@ -64162,9 +64179,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
64162
64179
  }
64163
64180
  };
64164
64181
  async function setMemoryImageSprite(element, memory) {
64182
+ memory = analizePositionsExtensionProps(memory);
64165
64183
  return await setMemorySprite(element, memory, {
64166
64184
  half: async () => {
64167
64185
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
64186
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
64168
64187
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
64169
64188
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
64170
64189
  await element.load();
@@ -64498,12 +64517,15 @@ var Container3 = class extends Container {
64498
64517
  this.setMemory(value);
64499
64518
  }
64500
64519
  async setMemory(value) {
64520
+ await this.importChildren(value);
64521
+ return await setMemoryContainer(this, value);
64522
+ }
64523
+ async importChildren(value) {
64501
64524
  for (let i3 = 0; i3 < value.elements.length; i3++) {
64502
64525
  let child = value.elements[i3];
64503
64526
  let element = await importCanvasElement(child);
64504
64527
  this.addChild(element);
64505
64528
  }
64506
- return await setMemoryContainer(this, value);
64507
64529
  }
64508
64530
  };
64509
64531
  function getMemoryContainer(element) {
@@ -1,7 +1,7 @@
1
1
  import { Container as Container$1, ContainerOptions } from 'pixi.js';
2
- import { i as ContainerChild, b as ContainerMemory, C as CanvasBaseItem } from '../../ContainerChild-CEuXVx00.cjs';
3
- import '../../interface/canvas/TextureMemory.cjs';
2
+ import { i as ContainerChild, b as ContainerMemory, C as CanvasBaseItem } from '../../ContainerChild-WzyxEjAc.cjs';
4
3
  import './AdditionalPositions.cjs';
4
+ import '../../interface/canvas/TextureMemory.cjs';
5
5
  import './AnchorExtension.cjs';
6
6
  import '../../types/CanvasEventNamesType.cjs';
7
7
  import '../CanvasEvent.cjs';
@@ -30,6 +30,7 @@ declare class Container<C extends ContainerChild = ContainerChild, Memory extend
30
30
  get memory(): Memory;
31
31
  set memory(value: Memory);
32
32
  setMemory(value: Memory): Promise<void>;
33
+ protected importChildren(value: Memory): Promise<void>;
33
34
  }
34
35
  declare function getMemoryContainer<T extends Container$1>(element: T): ContainerMemory;
35
36
  declare function setMemoryContainer<T extends Container$1>(element: T | Container$1, memory: ContainerOptions | {}, opstions?: {
@@ -1,7 +1,7 @@
1
1
  import { Container as Container$1, ContainerOptions } from 'pixi.js';
2
- import { i as ContainerChild, b as ContainerMemory, C as CanvasBaseItem } from '../../ContainerChild-HBivknFV.js';
3
- import '../../interface/canvas/TextureMemory.js';
2
+ import { i as ContainerChild, b as ContainerMemory, C as CanvasBaseItem } from '../../ContainerChild-B5yD0BI8.js';
4
3
  import './AdditionalPositions.js';
4
+ import '../../interface/canvas/TextureMemory.js';
5
5
  import './AnchorExtension.js';
6
6
  import '../../types/CanvasEventNamesType.js';
7
7
  import '../CanvasEvent.js';
@@ -30,6 +30,7 @@ declare class Container<C extends ContainerChild = ContainerChild, Memory extend
30
30
  get memory(): Memory;
31
31
  set memory(value: Memory);
32
32
  setMemory(value: Memory): Promise<void>;
33
+ protected importChildren(value: Memory): Promise<void>;
33
34
  }
34
35
  declare function getMemoryContainer<T extends Container$1>(element: T): ContainerMemory;
35
36
  declare function setMemoryContainer<T extends Container$1>(element: T | Container$1, memory: ContainerOptions | {}, opstions?: {
@@ -2,11 +2,11 @@ import {
2
2
  Container,
3
3
  getMemoryContainer,
4
4
  setMemoryContainer
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";
@@ -57725,7 +57725,7 @@ extensions.add(soundAsset);
57725
57725
  var sound = setInstance(new SoundLibrary());
57726
57726
 
57727
57727
  // package.json
57728
- var version = "0.9.6";
57728
+ var version = "0.9.7";
57729
57729
 
57730
57730
  // src/constants.ts
57731
57731
  var Repeat = "repeat";
@@ -57927,6 +57927,55 @@ function checkIfTextureNotIsEmpty(element) {
57927
57927
  return true;
57928
57928
  }
57929
57929
 
57930
+ // src/classes/canvas/AdditionalPositions.ts
57931
+ init_lib();
57932
+ function analizePositionsExtensionProps(props) {
57933
+ if (!props) {
57934
+ return props;
57935
+ }
57936
+ if (typeof props.align !== "number") {
57937
+ if (props.xAlign != void 0) {
57938
+ if (props.align === void 0) {
57939
+ props.align = { x: props.xAlign };
57940
+ delete props.xAlign;
57941
+ } else {
57942
+ props.align.x = props.xAlign;
57943
+ delete props.xAlign;
57944
+ }
57945
+ }
57946
+ if (props.yAlign != void 0) {
57947
+ if (props.align === void 0) {
57948
+ props.align = { y: props.yAlign };
57949
+ delete props.yAlign;
57950
+ } else {
57951
+ props.align.y = props.yAlign;
57952
+ delete props.yAlign;
57953
+ }
57954
+ }
57955
+ }
57956
+ if (typeof props.percentagePosition !== "number") {
57957
+ if (props.xPercentagePosition != void 0) {
57958
+ if (props.percentagePosition === void 0) {
57959
+ props.percentagePosition = { x: props.xPercentagePosition };
57960
+ delete props.xPercentagePosition;
57961
+ } else {
57962
+ props.percentagePosition.x = props.xPercentagePosition;
57963
+ delete props.xPercentagePosition;
57964
+ }
57965
+ }
57966
+ if (props.yPercentagePosition != void 0) {
57967
+ if (props.percentagePosition === void 0) {
57968
+ props.percentagePosition = { y: props.yPercentagePosition };
57969
+ delete props.yPercentagePosition;
57970
+ } else {
57971
+ props.percentagePosition.y = props.yPercentagePosition;
57972
+ delete props.yPercentagePosition;
57973
+ }
57974
+ }
57975
+ }
57976
+ return props;
57977
+ }
57978
+
57930
57979
  // src/classes/canvas/Sprite.ts
57931
57980
  init_lib();
57932
57981
 
@@ -58129,12 +58178,15 @@ var Container3 = class extends Container {
58129
58178
  this.setMemory(value);
58130
58179
  }
58131
58180
  async setMemory(value) {
58181
+ await this.importChildren(value);
58182
+ return await setMemoryContainer(this, value);
58183
+ }
58184
+ async importChildren(value) {
58132
58185
  for (let i3 = 0; i3 < value.elements.length; i3++) {
58133
58186
  let child = value.elements[i3];
58134
58187
  let element = await importCanvasElement(child);
58135
58188
  this.addChild(element);
58136
58189
  }
58137
- return await setMemoryContainer(this, value);
58138
58190
  }
58139
58191
  };
58140
58192
  function getMemoryContainer(element) {
@@ -59436,7 +59488,6 @@ var CanvasManager = class {
59436
59488
  * @param data The object.
59437
59489
  */
59438
59490
  async import(data) {
59439
- this.clear();
59440
59491
  try {
59441
59492
  let tickersOnPause = data["tickersOnPause"] || {};
59442
59493
  if (data.hasOwnProperty("elementAliasesOrder") && data.hasOwnProperty("elements")) {
@@ -59444,6 +59495,7 @@ var CanvasManager = class {
59444
59495
  let elementAliasesOrder = data["elementAliasesOrder"];
59445
59496
  let promises = elementAliasesOrder.filter((alias) => currentElements[alias]).map((alias) => importCanvasElement(currentElements[alias]));
59446
59497
  let list = await Promise.all(promises);
59498
+ this.clear();
59447
59499
  list.forEach((element, i3) => {
59448
59500
  let alias = elementAliasesOrder[i3];
59449
59501
  this.add(alias, element);
@@ -62780,6 +62832,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
62780
62832
  pixivnId = CANVAS_IMAGE_ID;
62781
62833
  constructor(options, textureAlias) {
62782
62834
  super(options);
62835
+ options = analizePositionsExtensionProps(options);
62783
62836
  if (textureAlias) {
62784
62837
  this.textureAlias = textureAlias;
62785
62838
  }
@@ -62803,7 +62856,7 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
62803
62856
  this.setMemory(value);
62804
62857
  }
62805
62858
  async setMemory(value) {
62806
- await super.setMemory(value);
62859
+ await setMemoryImageSprite(this, value);
62807
62860
  this.reloadPosition();
62808
62861
  }
62809
62862
  static from(source7, skipCache) {
@@ -62940,9 +62993,11 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
62940
62993
  }
62941
62994
  };
62942
62995
  async function setMemoryImageSprite(element, memory) {
62996
+ memory = analizePositionsExtensionProps(memory);
62943
62997
  return await setMemorySprite(element, memory, {
62944
62998
  half: async () => {
62945
62999
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
63000
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
62946
63001
  "imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
62947
63002
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
62948
63003
  await element.load();
@@ -64018,9 +64073,8 @@ var customPositionTest = newLabel("___pixi_vn_images_custom_position_test___", [
64018
64073
  - ${skullyName} will be added with the anchor set to 0.5 and align set to 0.25.`
64019
64074
  };
64020
64075
  canvas.removeAll();
64021
- let container = addImageCointainer("container", [eggHeadImage, flowerTopImage]);
64022
- container.anchor = 0.5;
64023
- container.align = 0.5;
64076
+ let container = new ImageContainer({ anchor: 0.5, align: 0.5 }, [eggHeadImage, flowerTopImage]);
64077
+ canvas.add("container", container);
64024
64078
  let helmlok = addImage("helmlok", helmlokImage);
64025
64079
  helmlok.anchor = 0.5;
64026
64080
  helmlok.xAlign = 1;
@@ -64326,41 +64380,6 @@ var pixivnTestStartLabel2 = newLabel(
64326
64380
  ]
64327
64381
  );
64328
64382
 
64329
- // src/classes/canvas/AdditionalPositions.ts
64330
- init_lib();
64331
- function analizePositionsExtensionProps(props) {
64332
- if (!props) {
64333
- return props;
64334
- }
64335
- if (props.align != void 0) {
64336
- if (typeof props.align === "number") {
64337
- props.xAlign = props.align;
64338
- props.yAlign = props.align;
64339
- } else {
64340
- if (props.align.x != void 0) {
64341
- props.xAlign = props.align.x;
64342
- }
64343
- if (props.align.y != void 0) {
64344
- props.yAlign = props.align.y;
64345
- }
64346
- }
64347
- }
64348
- if (props.percentagePosition != void 0) {
64349
- if (typeof props.percentagePosition === "number") {
64350
- props.xPercentagePosition = props.percentagePosition;
64351
- props.yPercentagePosition = props.percentagePosition;
64352
- } else {
64353
- if (props.percentagePosition.x != void 0) {
64354
- props.xPercentagePosition = props.percentagePosition.x;
64355
- }
64356
- if (props.percentagePosition.y != void 0) {
64357
- props.yPercentagePosition = props.percentagePosition.y;
64358
- }
64359
- }
64360
- }
64361
- return props;
64362
- }
64363
-
64364
64383
  // src/classes/canvas/ImageContainer.ts
64365
64384
  var ImageContainer = class extends Container3 {
64366
64385
  constructor(options, textureAliases = []) {
@@ -64374,10 +64393,10 @@ var ImageContainer = class extends Container3 {
64374
64393
  if (options?.anchor !== void 0) {
64375
64394
  this.anchor = options.anchor;
64376
64395
  }
64377
- if (options?.align !== void 0) {
64396
+ if (options && "align" in options && options?.align !== void 0) {
64378
64397
  this.align = options.align;
64379
64398
  }
64380
- if (options?.percentagePosition !== void 0) {
64399
+ if (options && "percentagePosition" in options && options?.percentagePosition !== void 0) {
64381
64400
  this.percentagePosition = options.percentagePosition;
64382
64401
  }
64383
64402
  }
@@ -64395,7 +64414,8 @@ var ImageContainer = class extends Container3 {
64395
64414
  this.setMemory(value);
64396
64415
  }
64397
64416
  async setMemory(value) {
64398
- await super.setMemory(value);
64417
+ await this.importChildren(value);
64418
+ await setMemoryImageContainer(this, value);
64399
64419
  this.reloadAnchor();
64400
64420
  this.reloadPosition();
64401
64421
  }
@@ -64569,11 +64589,13 @@ var ImageContainer = class extends Container3 {
64569
64589
  }
64570
64590
  };
64571
64591
  async function setMemoryImageContainer(element, memory, opstions) {
64592
+ memory = analizePositionsExtensionProps(memory);
64572
64593
  setMemoryContainer(element, memory, {
64573
64594
  ...opstions,
64574
64595
  end: async () => {
64575
64596
  "anchor" in memory && memory.anchor !== void 0 && (element.anchor = memory.anchor);
64576
64597
  "align" in memory && memory.align !== void 0 && (element.align = memory.align);
64598
+ "percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
64577
64599
  if ("loadIsStarted" in memory && memory.loadIsStarted) {
64578
64600
  await element.load();
64579
64601
  }
@@ -1,6 +1,6 @@
1
1
  import * as pixi_js from 'pixi.js';
2
2
  import { Texture, PointData, ObservablePoint } from 'pixi.js';
3
- import { I as ImageSprite, f as ImageContainerMemory, g as ImageContainerOptions } from '../../ContainerChild-CEuXVx00.cjs';
3
+ import { I as ImageSprite, f as ImageContainerMemory, g as ImageContainerOptions } from '../../ContainerChild-WzyxEjAc.cjs';
4
4
  import Container from './Container.cjs';
5
5
  import AdditionalPositionsExtension from './AdditionalPositions.cjs';
6
6
  import AnchorExtension from './AnchorExtension.cjs';
@@ -1,6 +1,6 @@
1
1
  import * as pixi_js from 'pixi.js';
2
2
  import { Texture, PointData, ObservablePoint } from 'pixi.js';
3
- import { I as ImageSprite, f as ImageContainerMemory, g as ImageContainerOptions } from '../../ContainerChild-HBivknFV.js';
3
+ import { I as ImageSprite, f as ImageContainerMemory, g as ImageContainerOptions } from '../../ContainerChild-B5yD0BI8.js';
4
4
  import Container from './Container.js';
5
5
  import AdditionalPositionsExtension from './AdditionalPositions.js';
6
6
  import AnchorExtension from './AnchorExtension.js';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ImageContainer,
3
3
  setMemoryImageContainer
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";