@drincs/pixi-vn 0.9.7 → 0.9.9

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 (219) hide show
  1. package/dist/{ContainerChild-B5yD0BI8.d.ts → ContainerChild-AjuVp3wW.d.ts} +4 -1
  2. package/dist/{ContainerChild-WzyxEjAc.d.cts → ContainerChild-BUFxM6Ya.d.cts} +4 -1
  3. package/dist/WebGLRenderer-CWVLYTYY.js +9 -0
  4. package/dist/WebGPURenderer-46NKQGBG.js +10 -0
  5. package/dist/{browserAll-2HD5EH7K.js → browserAll-S4EPEXZD.js} +5 -5
  6. package/dist/{chunk-PP5T5HEO.js → chunk-52ZSR3AN.js} +1 -1
  7. package/dist/{chunk-5VX2VTDZ.js → chunk-BJGKFUMU.js} +81 -27
  8. package/dist/{chunk-SAUNZQHZ.js → chunk-D753T42C.js} +1 -1
  9. package/dist/{chunk-ODIEVSQX.js → chunk-F74VVSHO.js} +3 -3
  10. package/dist/{chunk-6GJXIPNB.js → chunk-GEY6RTYO.js} +1 -1
  11. package/dist/{chunk-CAWOWL3P.js → chunk-IG7HSAEJ.js} +75 -34
  12. package/dist/{chunk-PP3SBC3C.js → chunk-KAHX5SKO.js} +18 -15
  13. package/dist/{chunk-WNOARCWH.js → chunk-LZNY6NEZ.js} +2 -2
  14. package/dist/{chunk-Z3NBKYVU.js → chunk-MQPMJVDR.js} +10 -9
  15. package/dist/{chunk-Y3WNBACN.js → chunk-R4J2U4HN.js} +2 -2
  16. package/dist/{chunk-NB4Q3GFK.js → chunk-RGKEAZTY.js} +256 -70
  17. package/dist/{chunk-73ID6GAW.js → chunk-UWBWDBB3.js} +2 -2
  18. package/dist/{chunk-TOG67Z7Q.js → chunk-V7WJOX65.js} +2 -2
  19. package/dist/{chunk-WS3FY4Q6.js → chunk-X55ALTH7.js} +2 -2
  20. package/dist/{chunk-5JREOVCG.js → chunk-XGGTEP7V.js} +1 -1
  21. package/dist/classes/CharacterBaseModel.cjs +413 -258
  22. package/dist/classes/CharacterBaseModel.js +16 -17
  23. package/dist/classes/CharacterStoredClass.cjs +413 -258
  24. package/dist/classes/CharacterStoredClass.js +16 -17
  25. package/dist/classes/ChoiceMenuOption.cjs +341 -188
  26. package/dist/classes/ChoiceMenuOption.js +16 -17
  27. package/dist/classes/Sound.cjs +413 -258
  28. package/dist/classes/Sound.js +16 -17
  29. package/dist/classes/StoredClassModel.cjs +413 -258
  30. package/dist/classes/StoredClassModel.js +16 -17
  31. package/dist/classes/canvas/AdditionalPositions.cjs +39329 -963
  32. package/dist/classes/canvas/AdditionalPositions.d.cts +3 -1
  33. package/dist/classes/canvas/AdditionalPositions.d.ts +3 -1
  34. package/dist/classes/canvas/AdditionalPositions.js +41 -10
  35. package/dist/classes/canvas/AnchorExtension.cjs +92 -48
  36. package/dist/classes/canvas/AnchorExtension.js +8 -8
  37. package/dist/classes/canvas/CanvasBaseItem.cjs +92 -48
  38. package/dist/classes/canvas/CanvasBaseItem.d.cts +1 -1
  39. package/dist/classes/canvas/CanvasBaseItem.d.ts +1 -1
  40. package/dist/classes/canvas/CanvasBaseItem.js +9 -9
  41. package/dist/classes/canvas/Container.cjs +405 -252
  42. package/dist/classes/canvas/Container.d.cts +1 -1
  43. package/dist/classes/canvas/Container.d.ts +1 -1
  44. package/dist/classes/canvas/Container.js +16 -17
  45. package/dist/classes/canvas/ImageContainer.cjs +341 -186
  46. package/dist/classes/canvas/ImageContainer.d.cts +1 -1
  47. package/dist/classes/canvas/ImageContainer.d.ts +1 -1
  48. package/dist/classes/canvas/ImageContainer.js +16 -17
  49. package/dist/classes/canvas/ImageSprite.cjs +3049 -2894
  50. package/dist/classes/canvas/ImageSprite.d.cts +1 -1
  51. package/dist/classes/canvas/ImageSprite.d.ts +1 -1
  52. package/dist/classes/canvas/ImageSprite.js +16 -17
  53. package/dist/classes/canvas/Sprite.cjs +413 -262
  54. package/dist/classes/canvas/Sprite.d.cts +1 -1
  55. package/dist/classes/canvas/Sprite.d.ts +1 -1
  56. package/dist/classes/canvas/Sprite.js +16 -17
  57. package/dist/classes/canvas/Text.cjs +335 -182
  58. package/dist/classes/canvas/Text.d.cts +1 -1
  59. package/dist/classes/canvas/Text.d.ts +1 -1
  60. package/dist/classes/canvas/Text.js +16 -17
  61. package/dist/classes/canvas/VideoSprite.cjs +3046 -2889
  62. package/dist/classes/canvas/VideoSprite.d.cts +4 -2
  63. package/dist/classes/canvas/VideoSprite.d.ts +4 -2
  64. package/dist/classes/canvas/VideoSprite.js +16 -17
  65. package/dist/classes/index.cjs +415 -262
  66. package/dist/classes/index.d.cts +1 -1
  67. package/dist/classes/index.d.ts +1 -1
  68. package/dist/classes/index.js +17 -18
  69. package/dist/classes/ticker/FadeAlphaTicker.cjs +341 -188
  70. package/dist/classes/ticker/FadeAlphaTicker.js +16 -17
  71. package/dist/classes/ticker/MoveTicker.cjs +3572 -3421
  72. package/dist/classes/ticker/MoveTicker.js +16 -17
  73. package/dist/classes/ticker/RotateTicker.cjs +341 -188
  74. package/dist/classes/ticker/RotateTicker.js +16 -17
  75. package/dist/classes/ticker/TickerBase.cjs +413 -258
  76. package/dist/classes/ticker/TickerBase.js +16 -17
  77. package/dist/classes/ticker/ZoomTicker.cjs +341 -188
  78. package/dist/classes/ticker/ZoomTicker.js +16 -17
  79. package/dist/classes/ticker/index.cjs +413 -262
  80. package/dist/classes/ticker/index.js +16 -17
  81. package/dist/constants.cjs +93 -49
  82. package/dist/constants.d.cts +1 -1
  83. package/dist/constants.d.ts +1 -1
  84. package/dist/constants.js +10 -10
  85. package/dist/decorators/canvas-element-decorator.cjs +405 -252
  86. package/dist/decorators/canvas-element-decorator.d.cts +1 -1
  87. package/dist/decorators/canvas-element-decorator.d.ts +1 -1
  88. package/dist/decorators/canvas-element-decorator.js +16 -17
  89. package/dist/decorators/event-decorator.d.cts +1 -1
  90. package/dist/decorators/event-decorator.d.ts +1 -1
  91. package/dist/decorators/index.cjs +341 -188
  92. package/dist/decorators/index.d.cts +1 -1
  93. package/dist/decorators/index.d.ts +1 -1
  94. package/dist/decorators/index.js +16 -17
  95. package/dist/decorators/label-decorator.cjs +413 -260
  96. package/dist/decorators/label-decorator.js +16 -17
  97. package/dist/functions/canvas/canvas-effect.cjs +410 -257
  98. package/dist/functions/canvas/canvas-effect.js +16 -17
  99. package/dist/functions/canvas/canvas-memory-utility.cjs +405 -252
  100. package/dist/functions/canvas/canvas-memory-utility.d.cts +1 -1
  101. package/dist/functions/canvas/canvas-memory-utility.d.ts +1 -1
  102. package/dist/functions/canvas/canvas-memory-utility.js +16 -17
  103. package/dist/functions/canvas/canvas-transition.cjs +413 -260
  104. package/dist/functions/canvas/canvas-transition.d.cts +1 -1
  105. package/dist/functions/canvas/canvas-transition.d.ts +1 -1
  106. package/dist/functions/canvas/canvas-transition.js +16 -17
  107. package/dist/functions/canvas/canvas-utility.cjs +413 -258
  108. package/dist/functions/canvas/canvas-utility.js +16 -17
  109. package/dist/functions/canvas/image-container-utility.cjs +416 -262
  110. package/dist/functions/canvas/image-container-utility.d.cts +5 -3
  111. package/dist/functions/canvas/image-container-utility.d.ts +5 -3
  112. package/dist/functions/canvas/image-container-utility.js +16 -17
  113. package/dist/functions/canvas/image-utility.cjs +413 -260
  114. package/dist/functions/canvas/image-utility.d.cts +5 -3
  115. package/dist/functions/canvas/image-utility.d.ts +5 -3
  116. package/dist/functions/canvas/image-utility.js +16 -17
  117. package/dist/functions/canvas/video-utility.cjs +4701 -4536
  118. package/dist/functions/canvas/video-utility.d.cts +5 -3
  119. package/dist/functions/canvas/video-utility.d.ts +5 -3
  120. package/dist/functions/canvas/video-utility.js +16 -17
  121. package/dist/functions/dialogue-utility.cjs +413 -258
  122. package/dist/functions/dialogue-utility.js +16 -17
  123. package/dist/functions/flags-utility.cjs +413 -258
  124. package/dist/functions/flags-utility.js +16 -17
  125. package/dist/functions/game-utility.cjs +413 -258
  126. package/dist/functions/game-utility.js +16 -17
  127. package/dist/functions/index.cjs +426 -266
  128. package/dist/functions/index.d.cts +1 -1
  129. package/dist/functions/index.d.ts +1 -1
  130. package/dist/functions/index.js +16 -17
  131. package/dist/functions/saves-utility.cjs +413 -258
  132. package/dist/functions/saves-utility.d.cts +1 -1
  133. package/dist/functions/saves-utility.d.ts +1 -1
  134. package/dist/functions/saves-utility.js +16 -17
  135. package/dist/functions/sound-utility.cjs +92 -48
  136. package/dist/functions/sound-utility.js +10 -10
  137. package/dist/functions/texture-utility.cjs +335 -182
  138. package/dist/functions/texture-utility.d.cts +1 -1
  139. package/dist/functions/texture-utility.d.ts +1 -1
  140. package/dist/functions/texture-utility.js +16 -17
  141. package/dist/index.cjs +300 -138
  142. package/dist/index.d.cts +1 -1
  143. package/dist/index.d.ts +1 -1
  144. package/dist/index.js +20 -21
  145. package/dist/interface/HistoryStep.d.cts +1 -1
  146. package/dist/interface/HistoryStep.d.ts +1 -1
  147. package/dist/interface/SaveData.d.cts +1 -1
  148. package/dist/interface/SaveData.d.ts +1 -1
  149. package/dist/interface/canvas/canvas-memory.d.cts +1 -1
  150. package/dist/interface/canvas/canvas-memory.d.ts +1 -1
  151. package/dist/interface/canvas/canvas-options.d.cts +1 -1
  152. package/dist/interface/canvas/canvas-options.d.ts +1 -1
  153. package/dist/interface/export/ExportedCanvas.d.cts +1 -1
  154. package/dist/interface/export/ExportedCanvas.d.ts +1 -1
  155. package/dist/interface/export/ExportedStep.d.cts +1 -1
  156. package/dist/interface/export/ExportedStep.d.ts +1 -1
  157. package/dist/interface/index.d.cts +1 -1
  158. package/dist/interface/index.d.ts +1 -1
  159. package/dist/labels/BaseCanvasElementTestLabel.cjs +413 -260
  160. package/dist/labels/BaseCanvasElementTestLabel.js +16 -17
  161. package/dist/labels/CanvasEventsTestLabel.cjs +413 -260
  162. package/dist/labels/CanvasEventsTestLabel.d.cts +1 -1
  163. package/dist/labels/CanvasEventsTestLabel.d.ts +1 -1
  164. package/dist/labels/CanvasEventsTestLabel.js +16 -17
  165. package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +284 -131
  166. package/dist/labels/CustomTickerCanvasElementTestLabel.js +16 -17
  167. package/dist/labels/ImagesAnimationsTestLabel.cjs +413 -260
  168. package/dist/labels/ImagesAnimationsTestLabel.js +16 -17
  169. package/dist/labels/InputTestLabel.cjs +341 -188
  170. package/dist/labels/InputTestLabel.js +16 -17
  171. package/dist/labels/MarkdownTest.cjs +341 -188
  172. package/dist/labels/MarkdownTest.js +16 -17
  173. package/dist/labels/SoundTestLabel.cjs +341 -188
  174. package/dist/labels/SoundTestLabel.js +16 -17
  175. package/dist/labels/StartLabel.cjs +413 -260
  176. package/dist/labels/StartLabel.js +16 -17
  177. package/dist/labels/StepLabelTest.cjs +341 -188
  178. package/dist/labels/StepLabelTest.js +16 -17
  179. package/dist/labels/VideoTestLabel.cjs +341 -188
  180. package/dist/labels/VideoTestLabel.js +16 -17
  181. package/dist/labels/index.cjs +413 -260
  182. package/dist/labels/index.js +16 -17
  183. package/dist/{lib-6FCVILMQ.js → lib-EBGYUC35.js} +8 -8
  184. package/dist/managers/CanvasManager.cjs +413 -258
  185. package/dist/managers/CanvasManager.d.cts +1 -1
  186. package/dist/managers/CanvasManager.d.ts +1 -1
  187. package/dist/managers/CanvasManager.js +16 -17
  188. package/dist/managers/CanvasManagerStatic.cjs +176 -77
  189. package/dist/managers/CanvasManagerStatic.d.cts +1 -1
  190. package/dist/managers/CanvasManagerStatic.d.ts +1 -1
  191. package/dist/managers/CanvasManagerStatic.js +9 -9
  192. package/dist/managers/NarrationManager.cjs +413 -258
  193. package/dist/managers/NarrationManager.d.cts +2 -1
  194. package/dist/managers/NarrationManager.d.ts +2 -1
  195. package/dist/managers/NarrationManager.js +16 -17
  196. package/dist/managers/NarrationManagerStatic.cjs +413 -258
  197. package/dist/managers/NarrationManagerStatic.d.cts +1 -1
  198. package/dist/managers/NarrationManagerStatic.d.ts +1 -1
  199. package/dist/managers/NarrationManagerStatic.js +16 -17
  200. package/dist/managers/SoundManager.cjs +413 -258
  201. package/dist/managers/SoundManager.js +16 -17
  202. package/dist/managers/StorageManager.cjs +413 -258
  203. package/dist/managers/StorageManager.js +16 -17
  204. package/dist/managers/index.cjs +413 -258
  205. package/dist/managers/index.d.cts +1 -1
  206. package/dist/managers/index.d.ts +1 -1
  207. package/dist/managers/index.js +16 -17
  208. package/dist/types/ContainerChild.d.cts +1 -1
  209. package/dist/types/ContainerChild.d.ts +1 -1
  210. package/dist/types/index.d.cts +1 -1
  211. package/dist/types/index.d.ts +1 -1
  212. package/dist/types/ticker/MoveTickerProps.d.cts +8 -0
  213. package/dist/types/ticker/MoveTickerProps.d.ts +8 -0
  214. package/dist/webworkerAll-XFBJBJMM.js +5 -0
  215. package/package.json +1 -1
  216. package/dist/WebGLRenderer-U57ZOBH6.js +0 -9
  217. package/dist/WebGPURenderer-EYIZ7IXV.js +0 -10
  218. package/dist/chunk-IRUKNG2Y.js +0 -130
  219. package/dist/webworkerAll-GSRT3S6X.js +0 -5
@@ -4,20 +4,19 @@ import {
4
4
  RotateTicker,
5
5
  TickerBase,
6
6
  ZoomTicker
7
- } from "../../chunk-NB4Q3GFK.js";
7
+ } from "../../chunk-RGKEAZTY.js";
8
8
  import "../../chunk-OMPJ74CO.js";
9
9
  import "../../chunk-2JGQWY5I.js";
10
- import "../../chunk-2BUPSB7O.js";
11
- import "../../chunk-IRUKNG2Y.js";
12
- import "../../chunk-6GJXIPNB.js";
13
- import "../../chunk-I6TNJEE3.js";
14
10
  import "../../chunk-DPUSONJ3.js";
15
- import "../../chunk-WNOARCWH.js";
11
+ import "../../chunk-GEY6RTYO.js";
12
+ import "../../chunk-2BUPSB7O.js";
13
+ import "../../chunk-LZNY6NEZ.js";
16
14
  import "../../chunk-6FAGAUDR.js";
15
+ import "../../chunk-I6TNJEE3.js";
17
16
  import "../../chunk-RI37WOHP.js";
18
17
  import "../../chunk-ETZISN54.js";
19
18
  import "../../chunk-VXCA724Z.js";
20
- import "../../chunk-PP5T5HEO.js";
19
+ import "../../chunk-52ZSR3AN.js";
21
20
  import "../../chunk-ZZLQ3ILH.js";
22
21
  import "../../chunk-JTQGULTR.js";
23
22
  import "../../chunk-FHNQBWIZ.js";
@@ -25,16 +24,16 @@ import "../../chunk-ZBUW3MBH.js";
25
24
  import "../../chunk-PIYIZHZL.js";
26
25
  import "../../chunk-B7XQM2BB.js";
27
26
  import "../../chunk-LEMOIFSV.js";
28
- import "../../chunk-TOG67Z7Q.js";
29
- import "../../chunk-WS3FY4Q6.js";
30
- import "../../chunk-Z3NBKYVU.js";
31
- import "../../chunk-SAUNZQHZ.js";
32
- import "../../chunk-CAWOWL3P.js";
33
- import "../../chunk-ODIEVSQX.js";
34
- import "../../chunk-5JREOVCG.js";
35
- import "../../chunk-73ID6GAW.js";
36
- import "../../chunk-5VX2VTDZ.js";
37
- import "../../chunk-PP3SBC3C.js";
27
+ import "../../chunk-V7WJOX65.js";
28
+ import "../../chunk-X55ALTH7.js";
29
+ import "../../chunk-MQPMJVDR.js";
30
+ import "../../chunk-D753T42C.js";
31
+ import "../../chunk-IG7HSAEJ.js";
32
+ import "../../chunk-F74VVSHO.js";
33
+ import "../../chunk-XGGTEP7V.js";
34
+ import "../../chunk-UWBWDBB3.js";
35
+ import "../../chunk-BJGKFUMU.js";
36
+ import "../../chunk-KAHX5SKO.js";
38
37
  import "../../chunk-HKAY3U4R.js";
39
38
  import "../../chunk-SJIEQTBV.js";
40
39
  import "../../chunk-CBG6JWY4.js";
@@ -2491,22 +2491,25 @@ var init_Rectangle = __esm({
2491
2491
  * @param x - The X coordinate of the point to test
2492
2492
  * @param y - The Y coordinate of the point to test
2493
2493
  * @param strokeWidth - The width of the line to check
2494
+ * @param alignment - The alignment of the stroke, 0.5 by default
2494
2495
  * @returns Whether the x/y coordinates are within this rectangle
2495
2496
  */
2496
- strokeContains(x2, y2, strokeWidth) {
2497
+ strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
2497
2498
  const { width, height } = this;
2498
2499
  if (width <= 0 || height <= 0)
2499
2500
  return false;
2500
2501
  const _x = this.x;
2501
2502
  const _y = this.y;
2502
- const outerLeft = _x - strokeWidth / 2;
2503
- const outerRight = _x + width + strokeWidth / 2;
2504
- const outerTop = _y - strokeWidth / 2;
2505
- const outerBottom = _y + height + strokeWidth / 2;
2506
- const innerLeft = _x + strokeWidth / 2;
2507
- const innerRight = _x + width - strokeWidth / 2;
2508
- const innerTop = _y + strokeWidth / 2;
2509
- const innerBottom = _y + height - strokeWidth / 2;
2503
+ const strokeWidthOuter = strokeWidth * (1 - alignment);
2504
+ const strokeWidthInner = strokeWidth - strokeWidthOuter;
2505
+ const outerLeft = _x - strokeWidthOuter;
2506
+ const outerRight = _x + width + strokeWidthOuter;
2507
+ const outerTop = _y - strokeWidthOuter;
2508
+ const outerBottom = _y + height + strokeWidthOuter;
2509
+ const innerLeft = _x + strokeWidthInner;
2510
+ const innerRight = _x + width - strokeWidthInner;
2511
+ const innerTop = _y + strokeWidthInner;
2512
+ const innerBottom = _y + height - strokeWidthInner;
2510
2513
  return x2 >= outerLeft && x2 <= outerRight && y2 >= outerTop && y2 <= outerBottom && !(x2 > innerLeft && x2 < innerRight && y2 > innerTop && y2 < innerBottom);
2511
2514
  }
2512
2515
  /**
@@ -3627,24 +3630,22 @@ var init_toLocalGlobalMixin = __esm({
3627
3630
  });
3628
3631
 
3629
3632
  // node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs
3630
- var _tick, InstructionSet;
3633
+ var InstructionSet;
3631
3634
  var init_InstructionSet = __esm({
3632
3635
  "node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs"() {
3633
3636
  "use strict";
3634
3637
  init_uid();
3635
- _tick = 0;
3636
3638
  InstructionSet = class {
3637
3639
  constructor() {
3638
3640
  this.uid = uid("instructionSet");
3639
3641
  this.instructions = [];
3640
3642
  this.instructionSize = 0;
3641
3643
  this.renderables = [];
3642
- this.tick = 0;
3644
+ this.gcTick = 0;
3643
3645
  }
3644
3646
  /** reset the instruction set so it can be reused set size back to 0 */
3645
3647
  reset() {
3646
3648
  this.instructionSize = 0;
3647
- this.tick = _tick++;
3648
3649
  }
3649
3650
  /**
3650
3651
  * Add an instruction to the set
@@ -4803,6 +4804,7 @@ var init_RenderGroup = __esm({
4803
4804
  this.worldAlpha = 1;
4804
4805
  this.childrenToUpdate = /* @__PURE__ */ Object.create(null);
4805
4806
  this.updateTick = 0;
4807
+ this.gcTick = 0;
4806
4808
  this.childrenRenderablesToUpdate = { list: [], index: 0 };
4807
4809
  this.structureDidChange = true;
4808
4810
  this.instructionSet = new InstructionSet();
@@ -4818,7 +4820,9 @@ var init_RenderGroup = __esm({
4818
4820
  root.didChange = true;
4819
4821
  const children = root.children;
4820
4822
  for (let i2 = 0; i2 < children.length; i2++) {
4821
- this.addChild(children[i2]);
4823
+ const child = children[i2];
4824
+ child._updateFlags = 15;
4825
+ this.addChild(child);
4822
4826
  }
4823
4827
  }
4824
4828
  enableCacheAsTexture(options = {}) {
@@ -10752,8 +10756,7 @@ var init_ViewContainer = __esm({
10752
10756
  this.canBundle = true;
10753
10757
  this.allowChildren = false;
10754
10758
  this._roundPixels = 0;
10755
- this._lastUsed = 0;
10756
- this._lastInstructionTick = -1;
10759
+ this._lastUsed = -1;
10757
10760
  this._bounds = new Bounds(0, 1, 0, 0);
10758
10761
  this._boundsDirty = true;
10759
10762
  }
@@ -18050,17 +18053,18 @@ var init_Circle = __esm({
18050
18053
  * @param x - The X coordinate of the point to test
18051
18054
  * @param y - The Y coordinate of the point to test
18052
18055
  * @param width - The width of the line to check
18056
+ * @param alignment - The alignment of the stroke, 0.5 by default
18053
18057
  * @returns Whether the x/y coordinates are within this Circle
18054
18058
  */
18055
- strokeContains(x2, y2, width) {
18059
+ strokeContains(x2, y2, width, alignment = 0.5) {
18056
18060
  if (this.radius === 0)
18057
18061
  return false;
18058
18062
  const dx = this.x - x2;
18059
18063
  const dy = this.y - y2;
18060
- const r2 = this.radius;
18061
- const w2 = width / 2;
18064
+ const radius = this.radius;
18065
+ const outerWidth = (1 - alignment) * width;
18062
18066
  const distance = Math.sqrt(dx * dx + dy * dy);
18063
- return distance < r2 + w2 && distance > r2 - w2;
18067
+ return distance <= radius + outerWidth && distance > radius - (width - outerWidth);
18064
18068
  }
18065
18069
  /**
18066
18070
  * Returns the framing rectangle of the circle as a Rectangle object
@@ -18149,23 +18153,25 @@ var init_Ellipse = __esm({
18149
18153
  * Checks whether the x and y coordinates given are contained within this ellipse including stroke
18150
18154
  * @param x - The X coordinate of the point to test
18151
18155
  * @param y - The Y coordinate of the point to test
18152
- * @param width
18156
+ * @param strokeWidth - The width of the line to check
18157
+ * @param alignment - The alignment of the stroke
18153
18158
  * @returns Whether the x/y coords are within this ellipse
18154
18159
  */
18155
- strokeContains(x2, y2, width) {
18160
+ strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
18156
18161
  const { halfWidth, halfHeight } = this;
18157
18162
  if (halfWidth <= 0 || halfHeight <= 0) {
18158
18163
  return false;
18159
18164
  }
18160
- const halfStrokeWidth = width / 2;
18161
- const innerA = halfWidth - halfStrokeWidth;
18162
- const innerB = halfHeight - halfStrokeWidth;
18163
- const outerA = halfWidth + halfStrokeWidth;
18164
- const outerB = halfHeight + halfStrokeWidth;
18165
+ const strokeOuterWidth = strokeWidth * (1 - alignment);
18166
+ const strokeInnerWidth = strokeWidth - strokeOuterWidth;
18167
+ const innerHorizontal = halfWidth - strokeInnerWidth;
18168
+ const innerVertical = halfHeight - strokeInnerWidth;
18169
+ const outerHorizontal = halfWidth + strokeOuterWidth;
18170
+ const outerVertical = halfHeight + strokeOuterWidth;
18165
18171
  const normalizedX = x2 - this.x;
18166
18172
  const normalizedY = y2 - this.y;
18167
- const innerEllipse = normalizedX * normalizedX / (innerA * innerA) + normalizedY * normalizedY / (innerB * innerB);
18168
- const outerEllipse = normalizedX * normalizedX / (outerA * outerA) + normalizedY * normalizedY / (outerB * outerB);
18173
+ const innerEllipse = normalizedX * normalizedX / (innerHorizontal * innerHorizontal) + normalizedY * normalizedY / (innerVertical * innerVertical);
18174
+ const outerEllipse = normalizedX * normalizedX / (outerHorizontal * outerHorizontal) + normalizedY * normalizedY / (outerVertical * outerVertical);
18169
18175
  return innerEllipse > 1 && outerEllipse <= 1;
18170
18176
  }
18171
18177
  /**
@@ -18307,11 +18313,13 @@ var init_Polygon = __esm({
18307
18313
  * @param x - The X coordinate of the point to test
18308
18314
  * @param y - The Y coordinate of the point to test
18309
18315
  * @param strokeWidth - The width of the line to check
18316
+ * @param alignment - The alignment of the stroke, 0.5 by default
18310
18317
  * @returns Whether the x/y coordinates are within this polygon
18311
18318
  */
18312
- strokeContains(x2, y2, strokeWidth) {
18313
- const halfStrokeWidth = strokeWidth / 2;
18314
- const halfStrokeWidthSqrd = halfStrokeWidth * halfStrokeWidth;
18319
+ strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
18320
+ const strokeWidthSquared = strokeWidth * strokeWidth;
18321
+ const rightWidthSquared = strokeWidthSquared * (1 - alignment);
18322
+ const leftWidthSquared = strokeWidthSquared - rightWidthSquared;
18315
18323
  const { points } = this;
18316
18324
  const iterationLength = points.length - (this.closePath ? 0 : 2);
18317
18325
  for (let i2 = 0; i2 < iterationLength; i2 += 2) {
@@ -18319,8 +18327,9 @@ var init_Polygon = __esm({
18319
18327
  const y1 = points[i2 + 1];
18320
18328
  const x22 = points[(i2 + 2) % points.length];
18321
18329
  const y22 = points[(i2 + 3) % points.length];
18322
- const distanceSqrd = squaredDistanceToLineSegment(x2, y2, x1, y1, x22, y22);
18323
- if (distanceSqrd <= halfStrokeWidthSqrd) {
18330
+ const distanceSquared = squaredDistanceToLineSegment(x2, y2, x1, y1, x22, y22);
18331
+ const sign = Math.sign((x22 - x1) * (y2 - y1) - (y22 - y1) * (x2 - x1));
18332
+ if (distanceSquared <= (sign < 0 ? leftWidthSquared : rightWidthSquared)) {
18324
18333
  return true;
18325
18334
  }
18326
18335
  }
@@ -18412,11 +18421,11 @@ var init_RoundedRectangle = __esm({
18412
18421
  "node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs"() {
18413
18422
  "use strict";
18414
18423
  init_Rectangle();
18415
- isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius, halfStrokeWidth) => {
18424
+ isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius, strokeWidthInner, strokeWidthOuter) => {
18416
18425
  const dx = pX - cornerX;
18417
18426
  const dy = pY - cornerY;
18418
18427
  const distance = Math.sqrt(dx * dx + dy * dy);
18419
- return distance >= radius - halfStrokeWidth && distance <= radius + halfStrokeWidth;
18428
+ return distance >= radius - strokeWidthInner && distance <= radius + strokeWidthOuter;
18420
18429
  };
18421
18430
  RoundedRectangle = class _RoundedRectangle {
18422
18431
  /**
@@ -18518,26 +18527,60 @@ var init_RoundedRectangle = __esm({
18518
18527
  * @param pX - The X coordinate of the point to test
18519
18528
  * @param pY - The Y coordinate of the point to test
18520
18529
  * @param strokeWidth - The width of the line to check
18530
+ * @param alignment - The alignment of the stroke, 0.5 by default
18521
18531
  * @returns Whether the x/y coordinates are within this rectangle
18522
18532
  */
18523
- strokeContains(pX, pY, strokeWidth) {
18533
+ strokeContains(pX, pY, strokeWidth, alignment = 0.5) {
18524
18534
  const { x: x2, y: y2, width, height, radius } = this;
18525
- const halfStrokeWidth = strokeWidth / 2;
18535
+ const strokeWidthOuter = strokeWidth * (1 - alignment);
18536
+ const strokeWidthInner = strokeWidth - strokeWidthOuter;
18526
18537
  const innerX = x2 + radius;
18527
18538
  const innerY = y2 + radius;
18528
18539
  const innerWidth = width - radius * 2;
18529
18540
  const innerHeight = height - radius * 2;
18530
18541
  const rightBound = x2 + width;
18531
18542
  const bottomBound = y2 + height;
18532
- if ((pX >= x2 - halfStrokeWidth && pX <= x2 + halfStrokeWidth || pX >= rightBound - halfStrokeWidth && pX <= rightBound + halfStrokeWidth) && pY >= innerY && pY <= innerY + innerHeight) {
18543
+ if ((pX >= x2 - strokeWidthOuter && pX <= x2 + strokeWidthInner || pX >= rightBound - strokeWidthInner && pX <= rightBound + strokeWidthOuter) && pY >= innerY && pY <= innerY + innerHeight) {
18533
18544
  return true;
18534
18545
  }
18535
- if ((pY >= y2 - halfStrokeWidth && pY <= y2 + halfStrokeWidth || pY >= bottomBound - halfStrokeWidth && pY <= bottomBound + halfStrokeWidth) && pX >= innerX && pX <= innerX + innerWidth) {
18546
+ if ((pY >= y2 - strokeWidthOuter && pY <= y2 + strokeWidthInner || pY >= bottomBound - strokeWidthInner && pY <= bottomBound + strokeWidthOuter) && pX >= innerX && pX <= innerX + innerWidth) {
18536
18547
  return true;
18537
18548
  }
18538
18549
  return (
18539
18550
  // Top-left
18540
- pX < innerX && pY < innerY && isCornerWithinStroke(pX, pY, innerX, innerY, radius, halfStrokeWidth) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(pX, pY, rightBound - radius, innerY, radius, halfStrokeWidth) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(pX, pY, rightBound - radius, bottomBound - radius, radius, halfStrokeWidth) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(pX, pY, innerX, bottomBound - radius, radius, halfStrokeWidth)
18551
+ pX < innerX && pY < innerY && isCornerWithinStroke(
18552
+ pX,
18553
+ pY,
18554
+ innerX,
18555
+ innerY,
18556
+ radius,
18557
+ strokeWidthInner,
18558
+ strokeWidthOuter
18559
+ ) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(
18560
+ pX,
18561
+ pY,
18562
+ rightBound - radius,
18563
+ innerY,
18564
+ radius,
18565
+ strokeWidthInner,
18566
+ strokeWidthOuter
18567
+ ) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(
18568
+ pX,
18569
+ pY,
18570
+ rightBound - radius,
18571
+ bottomBound - radius,
18572
+ radius,
18573
+ strokeWidthInner,
18574
+ strokeWidthOuter
18575
+ ) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(
18576
+ pX,
18577
+ pY,
18578
+ innerX,
18579
+ bottomBound - radius,
18580
+ radius,
18581
+ strokeWidthInner,
18582
+ strokeWidthOuter
18583
+ )
18541
18584
  );
18542
18585
  }
18543
18586
  toString() {
@@ -19371,7 +19414,7 @@ var init_ShapePath = __esm({
19371
19414
  const delta = Math.PI * 2 / sides;
19372
19415
  const polygon = [];
19373
19416
  for (let i2 = 0; i2 < sides; i2++) {
19374
- const angle = i2 * delta + startAngle;
19417
+ const angle = startAngle - i2 * delta;
19375
19418
  polygon.push(
19376
19419
  x2 + radius * Math.cos(angle),
19377
19420
  y2 + radius * Math.sin(angle)
@@ -21071,13 +21114,13 @@ var init_GraphicsContext = __esm({
21071
21114
  if (action === "stroke") {
21072
21115
  const data = instruction.data;
21073
21116
  const alignment = data.style.alignment;
21074
- const padding = data.style.width * (1 - alignment);
21117
+ const outerPadding = data.style.width * (1 - alignment);
21075
21118
  const _bounds = data.path.bounds;
21076
21119
  bounds.addFrame(
21077
- _bounds.minX - padding,
21078
- _bounds.minY - padding,
21079
- _bounds.maxX + padding,
21080
- _bounds.maxY + padding
21120
+ _bounds.minX - outerPadding,
21121
+ _bounds.minY - outerPadding,
21122
+ _bounds.maxX + outerPadding,
21123
+ _bounds.maxY + outerPadding
21081
21124
  );
21082
21125
  }
21083
21126
  }
@@ -21110,7 +21153,8 @@ var init_GraphicsContext = __esm({
21110
21153
  if (instruction.action === "fill") {
21111
21154
  hasHit = shape.contains(transformedPoint.x, transformedPoint.y);
21112
21155
  } else {
21113
- hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, style.width);
21156
+ const strokeStyle = style;
21157
+ hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, strokeStyle.width, strokeStyle.alignment);
21114
21158
  }
21115
21159
  const holes = data.hole;
21116
21160
  if (holes) {
@@ -28944,7 +28988,7 @@ extensions.add(soundAsset);
28944
28988
  var sound = setInstance(new SoundLibrary());
28945
28989
 
28946
28990
  // package.json
28947
- var version = "0.9.7";
28991
+ var version = "0.9.9";
28948
28992
 
28949
28993
  // src/constants.ts
28950
28994
  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.7";
5
+ var version = "0.9.9";
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.7";
5
+ var version = "0.9.9";
6
6
 
7
7
  declare const Repeat: RepeatType;
8
8
  /**
package/dist/constants.js CHANGED
@@ -11,16 +11,16 @@ import {
11
11
  filters,
12
12
  version,
13
13
  videoFormats
14
- } from "./chunk-TOG67Z7Q.js";
15
- import "./chunk-WS3FY4Q6.js";
16
- import "./chunk-Z3NBKYVU.js";
17
- import "./chunk-SAUNZQHZ.js";
18
- import "./chunk-CAWOWL3P.js";
19
- import "./chunk-ODIEVSQX.js";
20
- import "./chunk-5JREOVCG.js";
21
- import "./chunk-73ID6GAW.js";
22
- import "./chunk-5VX2VTDZ.js";
23
- import "./chunk-PP3SBC3C.js";
14
+ } from "./chunk-V7WJOX65.js";
15
+ import "./chunk-X55ALTH7.js";
16
+ import "./chunk-MQPMJVDR.js";
17
+ import "./chunk-D753T42C.js";
18
+ import "./chunk-IG7HSAEJ.js";
19
+ import "./chunk-F74VVSHO.js";
20
+ import "./chunk-XGGTEP7V.js";
21
+ import "./chunk-UWBWDBB3.js";
22
+ import "./chunk-BJGKFUMU.js";
23
+ import "./chunk-KAHX5SKO.js";
24
24
  import "./chunk-N342G4HO.js";
25
25
  export {
26
26
  CANVAS_APP_STAGE_ALIAS,