@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.
- package/dist/{ContainerChild-B5yD0BI8.d.ts → ContainerChild-AjuVp3wW.d.ts} +4 -1
- package/dist/{ContainerChild-WzyxEjAc.d.cts → ContainerChild-BUFxM6Ya.d.cts} +4 -1
- package/dist/WebGLRenderer-CWVLYTYY.js +9 -0
- package/dist/WebGPURenderer-46NKQGBG.js +10 -0
- package/dist/{browserAll-2HD5EH7K.js → browserAll-S4EPEXZD.js} +5 -5
- package/dist/{chunk-PP5T5HEO.js → chunk-52ZSR3AN.js} +1 -1
- package/dist/{chunk-5VX2VTDZ.js → chunk-BJGKFUMU.js} +81 -27
- package/dist/{chunk-SAUNZQHZ.js → chunk-D753T42C.js} +1 -1
- package/dist/{chunk-ODIEVSQX.js → chunk-F74VVSHO.js} +3 -3
- package/dist/{chunk-6GJXIPNB.js → chunk-GEY6RTYO.js} +1 -1
- package/dist/{chunk-CAWOWL3P.js → chunk-IG7HSAEJ.js} +75 -34
- package/dist/{chunk-PP3SBC3C.js → chunk-KAHX5SKO.js} +18 -15
- package/dist/{chunk-WNOARCWH.js → chunk-LZNY6NEZ.js} +2 -2
- package/dist/{chunk-Z3NBKYVU.js → chunk-MQPMJVDR.js} +10 -9
- package/dist/{chunk-Y3WNBACN.js → chunk-R4J2U4HN.js} +2 -2
- package/dist/{chunk-NB4Q3GFK.js → chunk-RGKEAZTY.js} +256 -70
- package/dist/{chunk-73ID6GAW.js → chunk-UWBWDBB3.js} +2 -2
- package/dist/{chunk-TOG67Z7Q.js → chunk-V7WJOX65.js} +2 -2
- package/dist/{chunk-WS3FY4Q6.js → chunk-X55ALTH7.js} +2 -2
- package/dist/{chunk-5JREOVCG.js → chunk-XGGTEP7V.js} +1 -1
- package/dist/classes/CharacterBaseModel.cjs +413 -258
- package/dist/classes/CharacterBaseModel.js +16 -17
- package/dist/classes/CharacterStoredClass.cjs +413 -258
- package/dist/classes/CharacterStoredClass.js +16 -17
- package/dist/classes/ChoiceMenuOption.cjs +341 -188
- package/dist/classes/ChoiceMenuOption.js +16 -17
- package/dist/classes/Sound.cjs +413 -258
- package/dist/classes/Sound.js +16 -17
- package/dist/classes/StoredClassModel.cjs +413 -258
- package/dist/classes/StoredClassModel.js +16 -17
- package/dist/classes/canvas/AdditionalPositions.cjs +39329 -963
- package/dist/classes/canvas/AdditionalPositions.d.cts +3 -1
- package/dist/classes/canvas/AdditionalPositions.d.ts +3 -1
- package/dist/classes/canvas/AdditionalPositions.js +41 -10
- package/dist/classes/canvas/AnchorExtension.cjs +92 -48
- package/dist/classes/canvas/AnchorExtension.js +8 -8
- package/dist/classes/canvas/CanvasBaseItem.cjs +92 -48
- package/dist/classes/canvas/CanvasBaseItem.d.cts +1 -1
- package/dist/classes/canvas/CanvasBaseItem.d.ts +1 -1
- package/dist/classes/canvas/CanvasBaseItem.js +9 -9
- package/dist/classes/canvas/Container.cjs +405 -252
- package/dist/classes/canvas/Container.d.cts +1 -1
- package/dist/classes/canvas/Container.d.ts +1 -1
- package/dist/classes/canvas/Container.js +16 -17
- package/dist/classes/canvas/ImageContainer.cjs +341 -186
- package/dist/classes/canvas/ImageContainer.d.cts +1 -1
- package/dist/classes/canvas/ImageContainer.d.ts +1 -1
- package/dist/classes/canvas/ImageContainer.js +16 -17
- package/dist/classes/canvas/ImageSprite.cjs +3049 -2894
- package/dist/classes/canvas/ImageSprite.d.cts +1 -1
- package/dist/classes/canvas/ImageSprite.d.ts +1 -1
- package/dist/classes/canvas/ImageSprite.js +16 -17
- package/dist/classes/canvas/Sprite.cjs +413 -262
- package/dist/classes/canvas/Sprite.d.cts +1 -1
- package/dist/classes/canvas/Sprite.d.ts +1 -1
- package/dist/classes/canvas/Sprite.js +16 -17
- package/dist/classes/canvas/Text.cjs +335 -182
- package/dist/classes/canvas/Text.d.cts +1 -1
- package/dist/classes/canvas/Text.d.ts +1 -1
- package/dist/classes/canvas/Text.js +16 -17
- package/dist/classes/canvas/VideoSprite.cjs +3046 -2889
- package/dist/classes/canvas/VideoSprite.d.cts +4 -2
- package/dist/classes/canvas/VideoSprite.d.ts +4 -2
- package/dist/classes/canvas/VideoSprite.js +16 -17
- package/dist/classes/index.cjs +415 -262
- package/dist/classes/index.d.cts +1 -1
- package/dist/classes/index.d.ts +1 -1
- package/dist/classes/index.js +17 -18
- package/dist/classes/ticker/FadeAlphaTicker.cjs +341 -188
- package/dist/classes/ticker/FadeAlphaTicker.js +16 -17
- package/dist/classes/ticker/MoveTicker.cjs +3572 -3421
- package/dist/classes/ticker/MoveTicker.js +16 -17
- package/dist/classes/ticker/RotateTicker.cjs +341 -188
- package/dist/classes/ticker/RotateTicker.js +16 -17
- package/dist/classes/ticker/TickerBase.cjs +413 -258
- package/dist/classes/ticker/TickerBase.js +16 -17
- package/dist/classes/ticker/ZoomTicker.cjs +341 -188
- package/dist/classes/ticker/ZoomTicker.js +16 -17
- package/dist/classes/ticker/index.cjs +413 -262
- package/dist/classes/ticker/index.js +16 -17
- package/dist/constants.cjs +93 -49
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +10 -10
- package/dist/decorators/canvas-element-decorator.cjs +405 -252
- package/dist/decorators/canvas-element-decorator.d.cts +1 -1
- package/dist/decorators/canvas-element-decorator.d.ts +1 -1
- package/dist/decorators/canvas-element-decorator.js +16 -17
- package/dist/decorators/event-decorator.d.cts +1 -1
- package/dist/decorators/event-decorator.d.ts +1 -1
- package/dist/decorators/index.cjs +341 -188
- package/dist/decorators/index.d.cts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +16 -17
- package/dist/decorators/label-decorator.cjs +413 -260
- package/dist/decorators/label-decorator.js +16 -17
- package/dist/functions/canvas/canvas-effect.cjs +410 -257
- package/dist/functions/canvas/canvas-effect.js +16 -17
- package/dist/functions/canvas/canvas-memory-utility.cjs +405 -252
- package/dist/functions/canvas/canvas-memory-utility.d.cts +1 -1
- package/dist/functions/canvas/canvas-memory-utility.d.ts +1 -1
- package/dist/functions/canvas/canvas-memory-utility.js +16 -17
- package/dist/functions/canvas/canvas-transition.cjs +413 -260
- package/dist/functions/canvas/canvas-transition.d.cts +1 -1
- package/dist/functions/canvas/canvas-transition.d.ts +1 -1
- package/dist/functions/canvas/canvas-transition.js +16 -17
- package/dist/functions/canvas/canvas-utility.cjs +413 -258
- package/dist/functions/canvas/canvas-utility.js +16 -17
- package/dist/functions/canvas/image-container-utility.cjs +416 -262
- package/dist/functions/canvas/image-container-utility.d.cts +5 -3
- package/dist/functions/canvas/image-container-utility.d.ts +5 -3
- package/dist/functions/canvas/image-container-utility.js +16 -17
- package/dist/functions/canvas/image-utility.cjs +413 -260
- package/dist/functions/canvas/image-utility.d.cts +5 -3
- package/dist/functions/canvas/image-utility.d.ts +5 -3
- package/dist/functions/canvas/image-utility.js +16 -17
- package/dist/functions/canvas/video-utility.cjs +4701 -4536
- package/dist/functions/canvas/video-utility.d.cts +5 -3
- package/dist/functions/canvas/video-utility.d.ts +5 -3
- package/dist/functions/canvas/video-utility.js +16 -17
- package/dist/functions/dialogue-utility.cjs +413 -258
- package/dist/functions/dialogue-utility.js +16 -17
- package/dist/functions/flags-utility.cjs +413 -258
- package/dist/functions/flags-utility.js +16 -17
- package/dist/functions/game-utility.cjs +413 -258
- package/dist/functions/game-utility.js +16 -17
- package/dist/functions/index.cjs +426 -266
- package/dist/functions/index.d.cts +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/index.js +16 -17
- package/dist/functions/saves-utility.cjs +413 -258
- package/dist/functions/saves-utility.d.cts +1 -1
- package/dist/functions/saves-utility.d.ts +1 -1
- package/dist/functions/saves-utility.js +16 -17
- package/dist/functions/sound-utility.cjs +92 -48
- package/dist/functions/sound-utility.js +10 -10
- package/dist/functions/texture-utility.cjs +335 -182
- package/dist/functions/texture-utility.d.cts +1 -1
- package/dist/functions/texture-utility.d.ts +1 -1
- package/dist/functions/texture-utility.js +16 -17
- package/dist/index.cjs +300 -138
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -21
- package/dist/interface/HistoryStep.d.cts +1 -1
- package/dist/interface/HistoryStep.d.ts +1 -1
- package/dist/interface/SaveData.d.cts +1 -1
- package/dist/interface/SaveData.d.ts +1 -1
- package/dist/interface/canvas/canvas-memory.d.cts +1 -1
- package/dist/interface/canvas/canvas-memory.d.ts +1 -1
- package/dist/interface/canvas/canvas-options.d.cts +1 -1
- package/dist/interface/canvas/canvas-options.d.ts +1 -1
- package/dist/interface/export/ExportedCanvas.d.cts +1 -1
- package/dist/interface/export/ExportedCanvas.d.ts +1 -1
- package/dist/interface/export/ExportedStep.d.cts +1 -1
- package/dist/interface/export/ExportedStep.d.ts +1 -1
- package/dist/interface/index.d.cts +1 -1
- package/dist/interface/index.d.ts +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.cjs +413 -260
- package/dist/labels/BaseCanvasElementTestLabel.js +16 -17
- package/dist/labels/CanvasEventsTestLabel.cjs +413 -260
- package/dist/labels/CanvasEventsTestLabel.d.cts +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.ts +1 -1
- package/dist/labels/CanvasEventsTestLabel.js +16 -17
- package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +284 -131
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +16 -17
- package/dist/labels/ImagesAnimationsTestLabel.cjs +413 -260
- package/dist/labels/ImagesAnimationsTestLabel.js +16 -17
- package/dist/labels/InputTestLabel.cjs +341 -188
- package/dist/labels/InputTestLabel.js +16 -17
- package/dist/labels/MarkdownTest.cjs +341 -188
- package/dist/labels/MarkdownTest.js +16 -17
- package/dist/labels/SoundTestLabel.cjs +341 -188
- package/dist/labels/SoundTestLabel.js +16 -17
- package/dist/labels/StartLabel.cjs +413 -260
- package/dist/labels/StartLabel.js +16 -17
- package/dist/labels/StepLabelTest.cjs +341 -188
- package/dist/labels/StepLabelTest.js +16 -17
- package/dist/labels/VideoTestLabel.cjs +341 -188
- package/dist/labels/VideoTestLabel.js +16 -17
- package/dist/labels/index.cjs +413 -260
- package/dist/labels/index.js +16 -17
- package/dist/{lib-6FCVILMQ.js → lib-EBGYUC35.js} +8 -8
- package/dist/managers/CanvasManager.cjs +413 -258
- package/dist/managers/CanvasManager.d.cts +1 -1
- package/dist/managers/CanvasManager.d.ts +1 -1
- package/dist/managers/CanvasManager.js +16 -17
- package/dist/managers/CanvasManagerStatic.cjs +176 -77
- package/dist/managers/CanvasManagerStatic.d.cts +1 -1
- package/dist/managers/CanvasManagerStatic.d.ts +1 -1
- package/dist/managers/CanvasManagerStatic.js +9 -9
- package/dist/managers/NarrationManager.cjs +413 -258
- package/dist/managers/NarrationManager.d.cts +2 -1
- package/dist/managers/NarrationManager.d.ts +2 -1
- package/dist/managers/NarrationManager.js +16 -17
- package/dist/managers/NarrationManagerStatic.cjs +413 -258
- package/dist/managers/NarrationManagerStatic.d.cts +1 -1
- package/dist/managers/NarrationManagerStatic.d.ts +1 -1
- package/dist/managers/NarrationManagerStatic.js +16 -17
- package/dist/managers/SoundManager.cjs +413 -258
- package/dist/managers/SoundManager.js +16 -17
- package/dist/managers/StorageManager.cjs +413 -258
- package/dist/managers/StorageManager.js +16 -17
- package/dist/managers/index.cjs +413 -258
- package/dist/managers/index.d.cts +1 -1
- package/dist/managers/index.d.ts +1 -1
- package/dist/managers/index.js +16 -17
- package/dist/types/ContainerChild.d.cts +1 -1
- package/dist/types/ContainerChild.d.ts +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/ticker/MoveTickerProps.d.cts +8 -0
- package/dist/types/ticker/MoveTickerProps.d.ts +8 -0
- package/dist/webworkerAll-XFBJBJMM.js +5 -0
- package/package.json +1 -1
- package/dist/WebGLRenderer-U57ZOBH6.js +0 -9
- package/dist/WebGPURenderer-EYIZ7IXV.js +0 -10
- package/dist/chunk-IRUKNG2Y.js +0 -130
- package/dist/webworkerAll-GSRT3S6X.js +0 -5
package/dist/classes/index.cjs
CHANGED
|
@@ -2504,22 +2504,25 @@ var init_Rectangle = __esm({
|
|
|
2504
2504
|
* @param x - The X coordinate of the point to test
|
|
2505
2505
|
* @param y - The Y coordinate of the point to test
|
|
2506
2506
|
* @param strokeWidth - The width of the line to check
|
|
2507
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
2507
2508
|
* @returns Whether the x/y coordinates are within this rectangle
|
|
2508
2509
|
*/
|
|
2509
|
-
strokeContains(x2, y2, strokeWidth) {
|
|
2510
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
2510
2511
|
const { width, height } = this;
|
|
2511
2512
|
if (width <= 0 || height <= 0)
|
|
2512
2513
|
return false;
|
|
2513
2514
|
const _x = this.x;
|
|
2514
2515
|
const _y = this.y;
|
|
2515
|
-
const
|
|
2516
|
-
const
|
|
2517
|
-
const
|
|
2518
|
-
const
|
|
2519
|
-
const
|
|
2520
|
-
const
|
|
2521
|
-
const
|
|
2522
|
-
const
|
|
2516
|
+
const strokeWidthOuter = strokeWidth * (1 - alignment);
|
|
2517
|
+
const strokeWidthInner = strokeWidth - strokeWidthOuter;
|
|
2518
|
+
const outerLeft = _x - strokeWidthOuter;
|
|
2519
|
+
const outerRight = _x + width + strokeWidthOuter;
|
|
2520
|
+
const outerTop = _y - strokeWidthOuter;
|
|
2521
|
+
const outerBottom = _y + height + strokeWidthOuter;
|
|
2522
|
+
const innerLeft = _x + strokeWidthInner;
|
|
2523
|
+
const innerRight = _x + width - strokeWidthInner;
|
|
2524
|
+
const innerTop = _y + strokeWidthInner;
|
|
2525
|
+
const innerBottom = _y + height - strokeWidthInner;
|
|
2523
2526
|
return x2 >= outerLeft && x2 <= outerRight && y2 >= outerTop && y2 <= outerBottom && !(x2 > innerLeft && x2 < innerRight && y2 > innerTop && y2 < innerBottom);
|
|
2524
2527
|
}
|
|
2525
2528
|
/**
|
|
@@ -3653,24 +3656,22 @@ var init_toLocalGlobalMixin = __esm({
|
|
|
3653
3656
|
});
|
|
3654
3657
|
|
|
3655
3658
|
// node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs
|
|
3656
|
-
var
|
|
3659
|
+
var InstructionSet;
|
|
3657
3660
|
var init_InstructionSet = __esm({
|
|
3658
3661
|
"node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs"() {
|
|
3659
3662
|
"use strict";
|
|
3660
3663
|
init_uid();
|
|
3661
|
-
_tick = 0;
|
|
3662
3664
|
InstructionSet = class {
|
|
3663
3665
|
constructor() {
|
|
3664
3666
|
this.uid = uid("instructionSet");
|
|
3665
3667
|
this.instructions = [];
|
|
3666
3668
|
this.instructionSize = 0;
|
|
3667
3669
|
this.renderables = [];
|
|
3668
|
-
this.
|
|
3670
|
+
this.gcTick = 0;
|
|
3669
3671
|
}
|
|
3670
3672
|
/** reset the instruction set so it can be reused set size back to 0 */
|
|
3671
3673
|
reset() {
|
|
3672
3674
|
this.instructionSize = 0;
|
|
3673
|
-
this.tick = _tick++;
|
|
3674
3675
|
}
|
|
3675
3676
|
/**
|
|
3676
3677
|
* Add an instruction to the set
|
|
@@ -4843,6 +4844,7 @@ var init_RenderGroup = __esm({
|
|
|
4843
4844
|
this.worldAlpha = 1;
|
|
4844
4845
|
this.childrenToUpdate = /* @__PURE__ */ Object.create(null);
|
|
4845
4846
|
this.updateTick = 0;
|
|
4847
|
+
this.gcTick = 0;
|
|
4846
4848
|
this.childrenRenderablesToUpdate = { list: [], index: 0 };
|
|
4847
4849
|
this.structureDidChange = true;
|
|
4848
4850
|
this.instructionSet = new InstructionSet();
|
|
@@ -4858,7 +4860,9 @@ var init_RenderGroup = __esm({
|
|
|
4858
4860
|
root.didChange = true;
|
|
4859
4861
|
const children = root.children;
|
|
4860
4862
|
for (let i3 = 0; i3 < children.length; i3++) {
|
|
4861
|
-
|
|
4863
|
+
const child = children[i3];
|
|
4864
|
+
child._updateFlags = 15;
|
|
4865
|
+
this.addChild(child);
|
|
4862
4866
|
}
|
|
4863
4867
|
}
|
|
4864
4868
|
enableCacheAsTexture(options = {}) {
|
|
@@ -10793,8 +10797,7 @@ var init_ViewContainer = __esm({
|
|
|
10793
10797
|
this.canBundle = true;
|
|
10794
10798
|
this.allowChildren = false;
|
|
10795
10799
|
this._roundPixels = 0;
|
|
10796
|
-
this._lastUsed =
|
|
10797
|
-
this._lastInstructionTick = -1;
|
|
10800
|
+
this._lastUsed = -1;
|
|
10798
10801
|
this._bounds = new Bounds(0, 1, 0, 0);
|
|
10799
10802
|
this._boundsDirty = true;
|
|
10800
10803
|
}
|
|
@@ -18125,17 +18128,18 @@ var init_Circle = __esm({
|
|
|
18125
18128
|
* @param x - The X coordinate of the point to test
|
|
18126
18129
|
* @param y - The Y coordinate of the point to test
|
|
18127
18130
|
* @param width - The width of the line to check
|
|
18131
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
18128
18132
|
* @returns Whether the x/y coordinates are within this Circle
|
|
18129
18133
|
*/
|
|
18130
|
-
strokeContains(x2, y2, width) {
|
|
18134
|
+
strokeContains(x2, y2, width, alignment = 0.5) {
|
|
18131
18135
|
if (this.radius === 0)
|
|
18132
18136
|
return false;
|
|
18133
18137
|
const dx = this.x - x2;
|
|
18134
18138
|
const dy = this.y - y2;
|
|
18135
|
-
const
|
|
18136
|
-
const
|
|
18139
|
+
const radius = this.radius;
|
|
18140
|
+
const outerWidth = (1 - alignment) * width;
|
|
18137
18141
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
18138
|
-
return distance
|
|
18142
|
+
return distance <= radius + outerWidth && distance > radius - (width - outerWidth);
|
|
18139
18143
|
}
|
|
18140
18144
|
/**
|
|
18141
18145
|
* Returns the framing rectangle of the circle as a Rectangle object
|
|
@@ -18224,23 +18228,25 @@ var init_Ellipse = __esm({
|
|
|
18224
18228
|
* Checks whether the x and y coordinates given are contained within this ellipse including stroke
|
|
18225
18229
|
* @param x - The X coordinate of the point to test
|
|
18226
18230
|
* @param y - The Y coordinate of the point to test
|
|
18227
|
-
* @param width
|
|
18231
|
+
* @param strokeWidth - The width of the line to check
|
|
18232
|
+
* @param alignment - The alignment of the stroke
|
|
18228
18233
|
* @returns Whether the x/y coords are within this ellipse
|
|
18229
18234
|
*/
|
|
18230
|
-
strokeContains(x2, y2,
|
|
18235
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
18231
18236
|
const { halfWidth, halfHeight } = this;
|
|
18232
18237
|
if (halfWidth <= 0 || halfHeight <= 0) {
|
|
18233
18238
|
return false;
|
|
18234
18239
|
}
|
|
18235
|
-
const
|
|
18236
|
-
const
|
|
18237
|
-
const
|
|
18238
|
-
const
|
|
18239
|
-
const
|
|
18240
|
+
const strokeOuterWidth = strokeWidth * (1 - alignment);
|
|
18241
|
+
const strokeInnerWidth = strokeWidth - strokeOuterWidth;
|
|
18242
|
+
const innerHorizontal = halfWidth - strokeInnerWidth;
|
|
18243
|
+
const innerVertical = halfHeight - strokeInnerWidth;
|
|
18244
|
+
const outerHorizontal = halfWidth + strokeOuterWidth;
|
|
18245
|
+
const outerVertical = halfHeight + strokeOuterWidth;
|
|
18240
18246
|
const normalizedX = x2 - this.x;
|
|
18241
18247
|
const normalizedY = y2 - this.y;
|
|
18242
|
-
const innerEllipse = normalizedX * normalizedX / (
|
|
18243
|
-
const outerEllipse = normalizedX * normalizedX / (
|
|
18248
|
+
const innerEllipse = normalizedX * normalizedX / (innerHorizontal * innerHorizontal) + normalizedY * normalizedY / (innerVertical * innerVertical);
|
|
18249
|
+
const outerEllipse = normalizedX * normalizedX / (outerHorizontal * outerHorizontal) + normalizedY * normalizedY / (outerVertical * outerVertical);
|
|
18244
18250
|
return innerEllipse > 1 && outerEllipse <= 1;
|
|
18245
18251
|
}
|
|
18246
18252
|
/**
|
|
@@ -18382,11 +18388,13 @@ var init_Polygon = __esm({
|
|
|
18382
18388
|
* @param x - The X coordinate of the point to test
|
|
18383
18389
|
* @param y - The Y coordinate of the point to test
|
|
18384
18390
|
* @param strokeWidth - The width of the line to check
|
|
18391
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
18385
18392
|
* @returns Whether the x/y coordinates are within this polygon
|
|
18386
18393
|
*/
|
|
18387
|
-
strokeContains(x2, y2, strokeWidth) {
|
|
18388
|
-
const
|
|
18389
|
-
const
|
|
18394
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
18395
|
+
const strokeWidthSquared = strokeWidth * strokeWidth;
|
|
18396
|
+
const rightWidthSquared = strokeWidthSquared * (1 - alignment);
|
|
18397
|
+
const leftWidthSquared = strokeWidthSquared - rightWidthSquared;
|
|
18390
18398
|
const { points } = this;
|
|
18391
18399
|
const iterationLength = points.length - (this.closePath ? 0 : 2);
|
|
18392
18400
|
for (let i3 = 0; i3 < iterationLength; i3 += 2) {
|
|
@@ -18394,8 +18402,9 @@ var init_Polygon = __esm({
|
|
|
18394
18402
|
const y1 = points[i3 + 1];
|
|
18395
18403
|
const x22 = points[(i3 + 2) % points.length];
|
|
18396
18404
|
const y22 = points[(i3 + 3) % points.length];
|
|
18397
|
-
const
|
|
18398
|
-
|
|
18405
|
+
const distanceSquared = squaredDistanceToLineSegment(x2, y2, x1, y1, x22, y22);
|
|
18406
|
+
const sign = Math.sign((x22 - x1) * (y2 - y1) - (y22 - y1) * (x2 - x1));
|
|
18407
|
+
if (distanceSquared <= (sign < 0 ? leftWidthSquared : rightWidthSquared)) {
|
|
18399
18408
|
return true;
|
|
18400
18409
|
}
|
|
18401
18410
|
}
|
|
@@ -18487,11 +18496,11 @@ var init_RoundedRectangle = __esm({
|
|
|
18487
18496
|
"node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs"() {
|
|
18488
18497
|
"use strict";
|
|
18489
18498
|
init_Rectangle();
|
|
18490
|
-
isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius,
|
|
18499
|
+
isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius, strokeWidthInner, strokeWidthOuter) => {
|
|
18491
18500
|
const dx = pX - cornerX;
|
|
18492
18501
|
const dy = pY - cornerY;
|
|
18493
18502
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
18494
|
-
return distance >= radius -
|
|
18503
|
+
return distance >= radius - strokeWidthInner && distance <= radius + strokeWidthOuter;
|
|
18495
18504
|
};
|
|
18496
18505
|
RoundedRectangle = class _RoundedRectangle {
|
|
18497
18506
|
/**
|
|
@@ -18593,26 +18602,60 @@ var init_RoundedRectangle = __esm({
|
|
|
18593
18602
|
* @param pX - The X coordinate of the point to test
|
|
18594
18603
|
* @param pY - The Y coordinate of the point to test
|
|
18595
18604
|
* @param strokeWidth - The width of the line to check
|
|
18605
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
18596
18606
|
* @returns Whether the x/y coordinates are within this rectangle
|
|
18597
18607
|
*/
|
|
18598
|
-
strokeContains(pX, pY, strokeWidth) {
|
|
18608
|
+
strokeContains(pX, pY, strokeWidth, alignment = 0.5) {
|
|
18599
18609
|
const { x: x2, y: y2, width, height, radius } = this;
|
|
18600
|
-
const
|
|
18610
|
+
const strokeWidthOuter = strokeWidth * (1 - alignment);
|
|
18611
|
+
const strokeWidthInner = strokeWidth - strokeWidthOuter;
|
|
18601
18612
|
const innerX = x2 + radius;
|
|
18602
18613
|
const innerY = y2 + radius;
|
|
18603
18614
|
const innerWidth = width - radius * 2;
|
|
18604
18615
|
const innerHeight = height - radius * 2;
|
|
18605
18616
|
const rightBound = x2 + width;
|
|
18606
18617
|
const bottomBound = y2 + height;
|
|
18607
|
-
if ((pX >= x2 -
|
|
18618
|
+
if ((pX >= x2 - strokeWidthOuter && pX <= x2 + strokeWidthInner || pX >= rightBound - strokeWidthInner && pX <= rightBound + strokeWidthOuter) && pY >= innerY && pY <= innerY + innerHeight) {
|
|
18608
18619
|
return true;
|
|
18609
18620
|
}
|
|
18610
|
-
if ((pY >= y2 -
|
|
18621
|
+
if ((pY >= y2 - strokeWidthOuter && pY <= y2 + strokeWidthInner || pY >= bottomBound - strokeWidthInner && pY <= bottomBound + strokeWidthOuter) && pX >= innerX && pX <= innerX + innerWidth) {
|
|
18611
18622
|
return true;
|
|
18612
18623
|
}
|
|
18613
18624
|
return (
|
|
18614
18625
|
// Top-left
|
|
18615
|
-
pX < innerX && pY < innerY && isCornerWithinStroke(
|
|
18626
|
+
pX < innerX && pY < innerY && isCornerWithinStroke(
|
|
18627
|
+
pX,
|
|
18628
|
+
pY,
|
|
18629
|
+
innerX,
|
|
18630
|
+
innerY,
|
|
18631
|
+
radius,
|
|
18632
|
+
strokeWidthInner,
|
|
18633
|
+
strokeWidthOuter
|
|
18634
|
+
) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(
|
|
18635
|
+
pX,
|
|
18636
|
+
pY,
|
|
18637
|
+
rightBound - radius,
|
|
18638
|
+
innerY,
|
|
18639
|
+
radius,
|
|
18640
|
+
strokeWidthInner,
|
|
18641
|
+
strokeWidthOuter
|
|
18642
|
+
) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(
|
|
18643
|
+
pX,
|
|
18644
|
+
pY,
|
|
18645
|
+
rightBound - radius,
|
|
18646
|
+
bottomBound - radius,
|
|
18647
|
+
radius,
|
|
18648
|
+
strokeWidthInner,
|
|
18649
|
+
strokeWidthOuter
|
|
18650
|
+
) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(
|
|
18651
|
+
pX,
|
|
18652
|
+
pY,
|
|
18653
|
+
innerX,
|
|
18654
|
+
bottomBound - radius,
|
|
18655
|
+
radius,
|
|
18656
|
+
strokeWidthInner,
|
|
18657
|
+
strokeWidthOuter
|
|
18658
|
+
)
|
|
18616
18659
|
);
|
|
18617
18660
|
}
|
|
18618
18661
|
toString() {
|
|
@@ -19446,7 +19489,7 @@ var init_ShapePath = __esm({
|
|
|
19446
19489
|
const delta = Math.PI * 2 / sides;
|
|
19447
19490
|
const polygon = [];
|
|
19448
19491
|
for (let i3 = 0; i3 < sides; i3++) {
|
|
19449
|
-
const angle = i3 * delta
|
|
19492
|
+
const angle = startAngle - i3 * delta;
|
|
19450
19493
|
polygon.push(
|
|
19451
19494
|
x2 + radius * Math.cos(angle),
|
|
19452
19495
|
y2 + radius * Math.sin(angle)
|
|
@@ -21146,13 +21189,13 @@ var init_GraphicsContext = __esm({
|
|
|
21146
21189
|
if (action === "stroke") {
|
|
21147
21190
|
const data = instruction.data;
|
|
21148
21191
|
const alignment = data.style.alignment;
|
|
21149
|
-
const
|
|
21192
|
+
const outerPadding = data.style.width * (1 - alignment);
|
|
21150
21193
|
const _bounds = data.path.bounds;
|
|
21151
21194
|
bounds.addFrame(
|
|
21152
|
-
_bounds.minX -
|
|
21153
|
-
_bounds.minY -
|
|
21154
|
-
_bounds.maxX +
|
|
21155
|
-
_bounds.maxY +
|
|
21195
|
+
_bounds.minX - outerPadding,
|
|
21196
|
+
_bounds.minY - outerPadding,
|
|
21197
|
+
_bounds.maxX + outerPadding,
|
|
21198
|
+
_bounds.maxY + outerPadding
|
|
21156
21199
|
);
|
|
21157
21200
|
}
|
|
21158
21201
|
}
|
|
@@ -21185,7 +21228,8 @@ var init_GraphicsContext = __esm({
|
|
|
21185
21228
|
if (instruction.action === "fill") {
|
|
21186
21229
|
hasHit = shape.contains(transformedPoint.x, transformedPoint.y);
|
|
21187
21230
|
} else {
|
|
21188
|
-
|
|
21231
|
+
const strokeStyle = style;
|
|
21232
|
+
hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, strokeStyle.width, strokeStyle.alignment);
|
|
21189
21233
|
}
|
|
21190
21234
|
const holes = data.hole;
|
|
21191
21235
|
if (holes) {
|
|
@@ -29041,7 +29085,7 @@ function collectAllRenderablesSimple(container, instructionSet, renderer) {
|
|
|
29041
29085
|
renderPipes3.blendMode.setBlendMode(renderable, container.groupBlendMode, instructionSet);
|
|
29042
29086
|
const rp = renderPipes3;
|
|
29043
29087
|
rp[renderable.renderPipeId].addRenderable(renderable, instructionSet);
|
|
29044
|
-
renderableGC.addRenderable(renderable
|
|
29088
|
+
renderableGC.addRenderable(renderable);
|
|
29045
29089
|
renderable.didViewUpdate = false;
|
|
29046
29090
|
}
|
|
29047
29091
|
if (!container.renderGroup) {
|
|
@@ -29068,7 +29112,7 @@ function collectAllRenderablesAdvanced(container, instructionSet, renderer, isRo
|
|
|
29068
29112
|
renderPipes3.blendMode.setBlendMode(renderable, renderable.groupBlendMode, instructionSet);
|
|
29069
29113
|
const pipe = renderPipes3[renderPipeId];
|
|
29070
29114
|
pipe.addRenderable(renderable, instructionSet);
|
|
29071
|
-
renderableGC.addRenderable(renderable
|
|
29115
|
+
renderableGC.addRenderable(renderable);
|
|
29072
29116
|
renderable.didViewUpdate = false;
|
|
29073
29117
|
}
|
|
29074
29118
|
const children = container.children;
|
|
@@ -29467,7 +29511,7 @@ var init_const8 = __esm({
|
|
|
29467
29511
|
"use strict";
|
|
29468
29512
|
init_eventemitter3();
|
|
29469
29513
|
DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
|
|
29470
|
-
VERSION = "8.6.
|
|
29514
|
+
VERSION = "8.6.6";
|
|
29471
29515
|
}
|
|
29472
29516
|
});
|
|
29473
29517
|
|
|
@@ -30900,29 +30944,46 @@ var init_clean = __esm({
|
|
|
30900
30944
|
});
|
|
30901
30945
|
|
|
30902
30946
|
// node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs
|
|
30903
|
-
var _RenderableGCSystem, RenderableGCSystem;
|
|
30947
|
+
var renderableGCTick, _RenderableGCSystem, RenderableGCSystem;
|
|
30904
30948
|
var init_RenderableGCSystem = __esm({
|
|
30905
30949
|
"node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs"() {
|
|
30906
30950
|
"use strict";
|
|
30907
30951
|
init_Extensions();
|
|
30908
30952
|
init_clean();
|
|
30953
|
+
renderableGCTick = 0;
|
|
30909
30954
|
_RenderableGCSystem = class _RenderableGCSystem2 {
|
|
30910
|
-
/**
|
|
30955
|
+
/**
|
|
30956
|
+
* Creates a new RenderableGCSystem instance.
|
|
30957
|
+
* @param renderer - The renderer this garbage collection system works for
|
|
30958
|
+
*/
|
|
30911
30959
|
constructor(renderer) {
|
|
30912
30960
|
this._managedRenderables = [];
|
|
30913
30961
|
this._managedHashes = [];
|
|
30914
30962
|
this._managedArrays = [];
|
|
30915
30963
|
this._renderer = renderer;
|
|
30916
30964
|
}
|
|
30965
|
+
/**
|
|
30966
|
+
* Initializes the garbage collection system with the provided options.
|
|
30967
|
+
* @param options - Configuration options for the renderer
|
|
30968
|
+
*/
|
|
30917
30969
|
init(options) {
|
|
30918
30970
|
options = { ..._RenderableGCSystem2.defaultOptions, ...options };
|
|
30919
30971
|
this.maxUnusedTime = options.renderableGCMaxUnusedTime;
|
|
30920
30972
|
this._frequency = options.renderableGCFrequency;
|
|
30921
30973
|
this.enabled = options.renderableGCActive;
|
|
30922
30974
|
}
|
|
30975
|
+
/**
|
|
30976
|
+
* Gets whether the garbage collection system is currently enabled.
|
|
30977
|
+
* @returns True if GC is enabled, false otherwise
|
|
30978
|
+
*/
|
|
30923
30979
|
get enabled() {
|
|
30924
30980
|
return !!this._handler;
|
|
30925
30981
|
}
|
|
30982
|
+
/**
|
|
30983
|
+
* Enables or disables the garbage collection system.
|
|
30984
|
+
* When enabled, schedules periodic cleanup of resources.
|
|
30985
|
+
* When disabled, cancels all scheduled cleanups.
|
|
30986
|
+
*/
|
|
30926
30987
|
set enabled(value) {
|
|
30927
30988
|
if (this.enabled === value)
|
|
30928
30989
|
return;
|
|
@@ -30954,28 +31015,53 @@ var init_RenderableGCSystem = __esm({
|
|
|
30954
31015
|
this._renderer.scheduler.cancel(this._arrayHandler);
|
|
30955
31016
|
}
|
|
30956
31017
|
}
|
|
31018
|
+
/**
|
|
31019
|
+
* Adds a hash table to be managed by the garbage collector.
|
|
31020
|
+
* @param context - The object containing the hash table
|
|
31021
|
+
* @param hash - The property name of the hash table
|
|
31022
|
+
*/
|
|
30957
31023
|
addManagedHash(context2, hash) {
|
|
30958
31024
|
this._managedHashes.push({ context: context2, hash });
|
|
30959
31025
|
}
|
|
31026
|
+
/**
|
|
31027
|
+
* Adds an array to be managed by the garbage collector.
|
|
31028
|
+
* @param context - The object containing the array
|
|
31029
|
+
* @param hash - The property name of the array
|
|
31030
|
+
*/
|
|
30960
31031
|
addManagedArray(context2, hash) {
|
|
30961
31032
|
this._managedArrays.push({ context: context2, hash });
|
|
30962
31033
|
}
|
|
30963
|
-
|
|
31034
|
+
/**
|
|
31035
|
+
* Updates the GC timestamp and tracking before rendering.
|
|
31036
|
+
* @param options - The render options
|
|
31037
|
+
* @param options.container - The container to render
|
|
31038
|
+
*/
|
|
31039
|
+
prerender({
|
|
31040
|
+
container
|
|
31041
|
+
}) {
|
|
30964
31042
|
this._now = performance.now();
|
|
31043
|
+
container.renderGroup.gcTick = renderableGCTick++;
|
|
31044
|
+
this._updateInstructionGCTick(container.renderGroup, container.renderGroup.gcTick);
|
|
30965
31045
|
}
|
|
30966
|
-
|
|
31046
|
+
/**
|
|
31047
|
+
* Starts tracking a renderable for garbage collection.
|
|
31048
|
+
* @param renderable - The renderable to track
|
|
31049
|
+
*/
|
|
31050
|
+
addRenderable(renderable) {
|
|
30967
31051
|
if (!this.enabled)
|
|
30968
31052
|
return;
|
|
30969
|
-
renderable._lastUsed
|
|
30970
|
-
if (renderable._lastInstructionTick === -1) {
|
|
31053
|
+
if (renderable._lastUsed === -1) {
|
|
30971
31054
|
this._managedRenderables.push(renderable);
|
|
30972
31055
|
renderable.once("destroyed", this._removeRenderable, this);
|
|
30973
31056
|
}
|
|
30974
|
-
renderable.
|
|
31057
|
+
renderable._lastUsed = this._now;
|
|
30975
31058
|
}
|
|
30976
|
-
/**
|
|
31059
|
+
/**
|
|
31060
|
+
* Performs garbage collection by cleaning up unused renderables.
|
|
31061
|
+
* Removes renderables that haven't been used for longer than maxUnusedTime.
|
|
31062
|
+
*/
|
|
30977
31063
|
run() {
|
|
30978
|
-
const now =
|
|
31064
|
+
const now = this._now;
|
|
30979
31065
|
const managedRenderables = this._managedRenderables;
|
|
30980
31066
|
const renderPipes3 = this._renderer.renderPipes;
|
|
30981
31067
|
let offset = 0;
|
|
@@ -30986,13 +31072,18 @@ var init_RenderableGCSystem = __esm({
|
|
|
30986
31072
|
continue;
|
|
30987
31073
|
}
|
|
30988
31074
|
const renderGroup = renderable.renderGroup ?? renderable.parentRenderGroup;
|
|
30989
|
-
const
|
|
30990
|
-
if (
|
|
31075
|
+
const currentTick = renderGroup?.instructionSet?.gcTick ?? -1;
|
|
31076
|
+
if ((renderGroup?.gcTick ?? 0) === currentTick) {
|
|
31077
|
+
renderable._lastUsed = now;
|
|
31078
|
+
}
|
|
31079
|
+
if (now - renderable._lastUsed > this.maxUnusedTime) {
|
|
30991
31080
|
if (!renderable.destroyed) {
|
|
30992
31081
|
const rp = renderPipes3;
|
|
31082
|
+
if (renderGroup)
|
|
31083
|
+
renderGroup.structureDidChange = true;
|
|
30993
31084
|
rp[renderable.renderPipeId].destroyRenderable(renderable);
|
|
30994
31085
|
}
|
|
30995
|
-
renderable.
|
|
31086
|
+
renderable._lastUsed = -1;
|
|
30996
31087
|
offset++;
|
|
30997
31088
|
renderable.off("destroyed", this._removeRenderable, this);
|
|
30998
31089
|
} else {
|
|
@@ -31001,6 +31092,7 @@ var init_RenderableGCSystem = __esm({
|
|
|
31001
31092
|
}
|
|
31002
31093
|
managedRenderables.length -= offset;
|
|
31003
31094
|
}
|
|
31095
|
+
/** Cleans up the garbage collection system. Disables GC and removes all tracked resources. */
|
|
31004
31096
|
destroy() {
|
|
31005
31097
|
this.enabled = false;
|
|
31006
31098
|
this._renderer = null;
|
|
@@ -31008,6 +31100,10 @@ var init_RenderableGCSystem = __esm({
|
|
|
31008
31100
|
this._managedHashes.length = 0;
|
|
31009
31101
|
this._managedArrays.length = 0;
|
|
31010
31102
|
}
|
|
31103
|
+
/**
|
|
31104
|
+
* Removes a renderable from being tracked when it's destroyed.
|
|
31105
|
+
* @param renderable - The renderable to stop tracking
|
|
31106
|
+
*/
|
|
31011
31107
|
_removeRenderable(renderable) {
|
|
31012
31108
|
const index = this._managedRenderables.indexOf(renderable);
|
|
31013
31109
|
if (index >= 0) {
|
|
@@ -31015,6 +31111,17 @@ var init_RenderableGCSystem = __esm({
|
|
|
31015
31111
|
this._managedRenderables[index] = null;
|
|
31016
31112
|
}
|
|
31017
31113
|
}
|
|
31114
|
+
/**
|
|
31115
|
+
* Updates the GC tick counter for a render group and its children.
|
|
31116
|
+
* @param renderGroup - The render group to update
|
|
31117
|
+
* @param gcTick - The new tick value
|
|
31118
|
+
*/
|
|
31119
|
+
_updateInstructionGCTick(renderGroup, gcTick) {
|
|
31120
|
+
renderGroup.instructionSet.gcTick = gcTick;
|
|
31121
|
+
for (const child of renderGroup.renderGroupChildren) {
|
|
31122
|
+
this._updateInstructionGCTick(child, gcTick);
|
|
31123
|
+
}
|
|
31124
|
+
}
|
|
31018
31125
|
};
|
|
31019
31126
|
_RenderableGCSystem.extension = {
|
|
31020
31127
|
type: [
|
|
@@ -31025,20 +31132,11 @@ var init_RenderableGCSystem = __esm({
|
|
|
31025
31132
|
priority: 0
|
|
31026
31133
|
};
|
|
31027
31134
|
_RenderableGCSystem.defaultOptions = {
|
|
31028
|
-
/**
|
|
31029
|
-
* If set to true, this will enable the garbage collector on the GPU.
|
|
31030
|
-
* @default true
|
|
31031
|
-
*/
|
|
31135
|
+
/** Enable/disable the garbage collector */
|
|
31032
31136
|
renderableGCActive: true,
|
|
31033
|
-
/**
|
|
31034
|
-
* The maximum idle frames before a texture is destroyed by garbage collection.
|
|
31035
|
-
* @default 60 * 60
|
|
31036
|
-
*/
|
|
31137
|
+
/** Time in ms before an unused resource is collected (default 1 minute) */
|
|
31037
31138
|
renderableGCMaxUnusedTime: 6e4,
|
|
31038
|
-
/**
|
|
31039
|
-
* Frames between two garbage collections.
|
|
31040
|
-
* @default 600
|
|
31041
|
-
*/
|
|
31139
|
+
/** How often to run garbage collection in ms (default 30 seconds) */
|
|
31042
31140
|
renderableGCFrequency: 3e4
|
|
31043
31141
|
};
|
|
31044
31142
|
RenderableGCSystem = _RenderableGCSystem;
|
|
@@ -39533,7 +39631,7 @@ var init_loadWebFont = __esm({
|
|
|
39533
39631
|
},
|
|
39534
39632
|
unload(font) {
|
|
39535
39633
|
(Array.isArray(font) ? font : [font]).forEach((t2) => {
|
|
39536
|
-
Cache.remove(t2.family);
|
|
39634
|
+
Cache.remove(`${t2.family}-and-url`);
|
|
39537
39635
|
DOMAdapter.get().getFontFaceSet().delete(t2);
|
|
39538
39636
|
});
|
|
39539
39637
|
}
|
|
@@ -49240,9 +49338,10 @@ var init_Triangle = __esm({
|
|
|
49240
49338
|
* @param pointX - The X coordinate of the point to test
|
|
49241
49339
|
* @param pointY - The Y coordinate of the point to test
|
|
49242
49340
|
* @param strokeWidth - The width of the line to check
|
|
49341
|
+
* @param _alignment - The alignment of the stroke
|
|
49243
49342
|
* @returns Whether the x/y coordinates are within this triangle
|
|
49244
49343
|
*/
|
|
49245
|
-
strokeContains(pointX, pointY, strokeWidth) {
|
|
49344
|
+
strokeContains(pointX, pointY, strokeWidth, _alignment = 0.5) {
|
|
49246
49345
|
const halfStrokeWidth = strokeWidth / 2;
|
|
49247
49346
|
const halfStrokeWidthSquared = halfStrokeWidth * halfStrokeWidth;
|
|
49248
49347
|
const { x: x2, x2: x22, x3, y: y2, y2: y22, y3 } = this;
|
|
@@ -55116,7 +55215,7 @@ var classes_exports = {};
|
|
|
55116
55215
|
__export(classes_exports, {
|
|
55117
55216
|
CanvasBase: () => CanvasBaseItem3,
|
|
55118
55217
|
CanvasBaseItem: () => CanvasBaseItem3,
|
|
55119
|
-
CanvasContainer: () =>
|
|
55218
|
+
CanvasContainer: () => Container3,
|
|
55120
55219
|
CanvasEvent: () => CanvasEvent,
|
|
55121
55220
|
CanvasImage: () => ImageSprite,
|
|
55122
55221
|
CanvasSprite: () => Sprite2,
|
|
@@ -55126,7 +55225,7 @@ __export(classes_exports, {
|
|
|
55126
55225
|
CharacterStoredClass: () => CharacterStoredClass,
|
|
55127
55226
|
ChoiceMenuOption: () => ChoiceMenuOption,
|
|
55128
55227
|
ChoiceMenuOptionClose: () => ChoiceMenuOptionClose,
|
|
55129
|
-
Container: () =>
|
|
55228
|
+
Container: () => Container3,
|
|
55130
55229
|
Dialogue: () => Dialogue,
|
|
55131
55230
|
DialogueBaseModel: () => Dialogue,
|
|
55132
55231
|
ImageContainer: () => ImageContainer,
|
|
@@ -57743,7 +57842,7 @@ extensions.add(soundAsset);
|
|
|
57743
57842
|
var sound = setInstance(new SoundLibrary());
|
|
57744
57843
|
|
|
57745
57844
|
// package.json
|
|
57746
|
-
var version = "0.9.
|
|
57845
|
+
var version = "0.9.9";
|
|
57747
57846
|
|
|
57748
57847
|
// src/constants.ts
|
|
57749
57848
|
var Repeat = "repeat";
|
|
@@ -57875,6 +57974,79 @@ var CANVAS_VIDEO_ID = "Video";
|
|
|
57875
57974
|
// src/classes/canvas/ImageSprite.ts
|
|
57876
57975
|
init_lib();
|
|
57877
57976
|
|
|
57977
|
+
// src/functions/texture-utility.ts
|
|
57978
|
+
init_lib();
|
|
57979
|
+
async function getTexture(textureAlias) {
|
|
57980
|
+
if (textureAlias === "EMPTY") {
|
|
57981
|
+
return;
|
|
57982
|
+
}
|
|
57983
|
+
if (!textureAlias) {
|
|
57984
|
+
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
57985
|
+
return;
|
|
57986
|
+
}
|
|
57987
|
+
if (Assets.cache.has(textureAlias)) {
|
|
57988
|
+
let texture = Assets.get(textureAlias);
|
|
57989
|
+
if (texture) {
|
|
57990
|
+
return texture;
|
|
57991
|
+
}
|
|
57992
|
+
}
|
|
57993
|
+
return Assets.load(textureAlias).then((texture) => {
|
|
57994
|
+
if (!texture) {
|
|
57995
|
+
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
57996
|
+
return;
|
|
57997
|
+
}
|
|
57998
|
+
if (!(texture instanceof Texture)) {
|
|
57999
|
+
console.error("[Pixi\u2019VN] File not is a file", textureAlias);
|
|
58000
|
+
return;
|
|
58001
|
+
}
|
|
58002
|
+
return texture;
|
|
58003
|
+
}).catch((e2) => {
|
|
58004
|
+
console.error("[Pixi\u2019VN] Error loading file", e2);
|
|
58005
|
+
return;
|
|
58006
|
+
});
|
|
58007
|
+
}
|
|
58008
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
58009
|
+
if (!(prop instanceof Object)) {
|
|
58010
|
+
return prop;
|
|
58011
|
+
}
|
|
58012
|
+
console.warn(`[Pixi\u2019VN] Text.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
58013
|
+
return void 0;
|
|
58014
|
+
}
|
|
58015
|
+
function getTextStyle(style) {
|
|
58016
|
+
return {
|
|
58017
|
+
align: style.align,
|
|
58018
|
+
breakWords: style.breakWords,
|
|
58019
|
+
dropShadow: style.dropShadow,
|
|
58020
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
58021
|
+
fontFamily: style.fontFamily,
|
|
58022
|
+
fontSize: style.fontSize,
|
|
58023
|
+
fontStyle: style.fontStyle,
|
|
58024
|
+
fontVariant: style.fontVariant,
|
|
58025
|
+
fontWeight: style.fontWeight,
|
|
58026
|
+
leading: style.leading,
|
|
58027
|
+
letterSpacing: style.letterSpacing,
|
|
58028
|
+
lineHeight: style.lineHeight,
|
|
58029
|
+
padding: style.padding,
|
|
58030
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
58031
|
+
textBaseline: style.textBaseline,
|
|
58032
|
+
trim: style.trim,
|
|
58033
|
+
whiteSpace: style.whiteSpace,
|
|
58034
|
+
wordWrap: style.wordWrap,
|
|
58035
|
+
wordWrapWidth: style.wordWrapWidth
|
|
58036
|
+
};
|
|
58037
|
+
}
|
|
58038
|
+
function checkIfTextureNotIsEmpty(element) {
|
|
58039
|
+
if ((element instanceof ImageSprite || element instanceof ImageContainer) && element.haveEmptyTexture) {
|
|
58040
|
+
return false;
|
|
58041
|
+
} else if (element instanceof Sprite && element.texture?.label == "EMPTY") {
|
|
58042
|
+
return false;
|
|
58043
|
+
}
|
|
58044
|
+
return true;
|
|
58045
|
+
}
|
|
58046
|
+
|
|
58047
|
+
// src/classes/canvas/AdditionalPositions.ts
|
|
58048
|
+
init_lib();
|
|
58049
|
+
|
|
57878
58050
|
// src/index.ts
|
|
57879
58051
|
init_lib();
|
|
57880
58052
|
|
|
@@ -57900,7 +58072,7 @@ function getCanvasElementInstanceById(canvasId) {
|
|
|
57900
58072
|
let eventType = registeredCanvasElement[canvasId];
|
|
57901
58073
|
if (!eventType) {
|
|
57902
58074
|
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
57903
|
-
eventType =
|
|
58075
|
+
eventType = Container3;
|
|
57904
58076
|
} else if (canvasId === CANVAS_VIDEO_ID) {
|
|
57905
58077
|
eventType = VideoSprite;
|
|
57906
58078
|
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
@@ -58039,76 +58211,6 @@ function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
|
58039
58211
|
}
|
|
58040
58212
|
}
|
|
58041
58213
|
|
|
58042
|
-
// src/functions/texture-utility.ts
|
|
58043
|
-
init_lib();
|
|
58044
|
-
async function getTexture(textureAlias) {
|
|
58045
|
-
if (textureAlias === "EMPTY") {
|
|
58046
|
-
return;
|
|
58047
|
-
}
|
|
58048
|
-
if (!textureAlias) {
|
|
58049
|
-
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
58050
|
-
return;
|
|
58051
|
-
}
|
|
58052
|
-
if (Assets.cache.has(textureAlias)) {
|
|
58053
|
-
let texture = Assets.get(textureAlias);
|
|
58054
|
-
if (texture) {
|
|
58055
|
-
return texture;
|
|
58056
|
-
}
|
|
58057
|
-
}
|
|
58058
|
-
return Assets.load(textureAlias).then((texture) => {
|
|
58059
|
-
if (!texture) {
|
|
58060
|
-
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
58061
|
-
return;
|
|
58062
|
-
}
|
|
58063
|
-
if (!(texture instanceof Texture)) {
|
|
58064
|
-
console.error("[Pixi\u2019VN] File not is a file", textureAlias);
|
|
58065
|
-
return;
|
|
58066
|
-
}
|
|
58067
|
-
return texture;
|
|
58068
|
-
}).catch((e2) => {
|
|
58069
|
-
console.error("[Pixi\u2019VN] Error loading file", e2);
|
|
58070
|
-
return;
|
|
58071
|
-
});
|
|
58072
|
-
}
|
|
58073
|
-
function getFillGradientFillPattern(prop, propName) {
|
|
58074
|
-
if (!(prop instanceof Object)) {
|
|
58075
|
-
return prop;
|
|
58076
|
-
}
|
|
58077
|
-
console.warn(`[Pixi\u2019VN] Text.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
58078
|
-
return void 0;
|
|
58079
|
-
}
|
|
58080
|
-
function getTextStyle(style) {
|
|
58081
|
-
return {
|
|
58082
|
-
align: style.align,
|
|
58083
|
-
breakWords: style.breakWords,
|
|
58084
|
-
dropShadow: style.dropShadow,
|
|
58085
|
-
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
58086
|
-
fontFamily: style.fontFamily,
|
|
58087
|
-
fontSize: style.fontSize,
|
|
58088
|
-
fontStyle: style.fontStyle,
|
|
58089
|
-
fontVariant: style.fontVariant,
|
|
58090
|
-
fontWeight: style.fontWeight,
|
|
58091
|
-
leading: style.leading,
|
|
58092
|
-
letterSpacing: style.letterSpacing,
|
|
58093
|
-
lineHeight: style.lineHeight,
|
|
58094
|
-
padding: style.padding,
|
|
58095
|
-
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
58096
|
-
textBaseline: style.textBaseline,
|
|
58097
|
-
trim: style.trim,
|
|
58098
|
-
whiteSpace: style.whiteSpace,
|
|
58099
|
-
wordWrap: style.wordWrap,
|
|
58100
|
-
wordWrapWidth: style.wordWrapWidth
|
|
58101
|
-
};
|
|
58102
|
-
}
|
|
58103
|
-
function checkIfTextureNotIsEmpty(element) {
|
|
58104
|
-
if ((element instanceof ImageSprite || element instanceof ImageContainer) && element.haveEmptyTexture) {
|
|
58105
|
-
return false;
|
|
58106
|
-
} else if (element instanceof Sprite && element.texture?.label == "EMPTY") {
|
|
58107
|
-
return false;
|
|
58108
|
-
}
|
|
58109
|
-
return true;
|
|
58110
|
-
}
|
|
58111
|
-
|
|
58112
58214
|
// src/managers/CanvasManager.ts
|
|
58113
58215
|
init_lib();
|
|
58114
58216
|
|
|
@@ -58130,7 +58232,7 @@ async function importCanvasElement(memory) {
|
|
|
58130
58232
|
}
|
|
58131
58233
|
|
|
58132
58234
|
// src/classes/canvas/Container.ts
|
|
58133
|
-
var
|
|
58235
|
+
var Container3 = class extends Container {
|
|
58134
58236
|
constructor(options) {
|
|
58135
58237
|
super(options);
|
|
58136
58238
|
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
@@ -58236,58 +58338,7 @@ async function setMemoryContainer(element, memory, opstions) {
|
|
|
58236
58338
|
|
|
58237
58339
|
// src/classes/canvas/ImageContainer.ts
|
|
58238
58340
|
init_lib();
|
|
58239
|
-
|
|
58240
|
-
// src/classes/canvas/AdditionalPositions.ts
|
|
58241
|
-
init_lib();
|
|
58242
|
-
function analizePositionsExtensionProps(props) {
|
|
58243
|
-
if (!props) {
|
|
58244
|
-
return props;
|
|
58245
|
-
}
|
|
58246
|
-
if (typeof props.align !== "number") {
|
|
58247
|
-
if (props.xAlign != void 0) {
|
|
58248
|
-
if (props.align === void 0) {
|
|
58249
|
-
props.align = { x: props.xAlign };
|
|
58250
|
-
delete props.xAlign;
|
|
58251
|
-
} else {
|
|
58252
|
-
props.align.x = props.xAlign;
|
|
58253
|
-
delete props.xAlign;
|
|
58254
|
-
}
|
|
58255
|
-
}
|
|
58256
|
-
if (props.yAlign != void 0) {
|
|
58257
|
-
if (props.align === void 0) {
|
|
58258
|
-
props.align = { y: props.yAlign };
|
|
58259
|
-
delete props.yAlign;
|
|
58260
|
-
} else {
|
|
58261
|
-
props.align.y = props.yAlign;
|
|
58262
|
-
delete props.yAlign;
|
|
58263
|
-
}
|
|
58264
|
-
}
|
|
58265
|
-
}
|
|
58266
|
-
if (typeof props.percentagePosition !== "number") {
|
|
58267
|
-
if (props.xPercentagePosition != void 0) {
|
|
58268
|
-
if (props.percentagePosition === void 0) {
|
|
58269
|
-
props.percentagePosition = { x: props.xPercentagePosition };
|
|
58270
|
-
delete props.xPercentagePosition;
|
|
58271
|
-
} else {
|
|
58272
|
-
props.percentagePosition.x = props.xPercentagePosition;
|
|
58273
|
-
delete props.xPercentagePosition;
|
|
58274
|
-
}
|
|
58275
|
-
}
|
|
58276
|
-
if (props.yPercentagePosition != void 0) {
|
|
58277
|
-
if (props.percentagePosition === void 0) {
|
|
58278
|
-
props.percentagePosition = { y: props.yPercentagePosition };
|
|
58279
|
-
delete props.yPercentagePosition;
|
|
58280
|
-
} else {
|
|
58281
|
-
props.percentagePosition.y = props.yPercentagePosition;
|
|
58282
|
-
delete props.yPercentagePosition;
|
|
58283
|
-
}
|
|
58284
|
-
}
|
|
58285
|
-
}
|
|
58286
|
-
return props;
|
|
58287
|
-
}
|
|
58288
|
-
|
|
58289
|
-
// src/classes/canvas/ImageContainer.ts
|
|
58290
|
-
var ImageContainer = class extends Container2 {
|
|
58341
|
+
var ImageContainer = class extends Container3 {
|
|
58291
58342
|
constructor(options, textureAliases = []) {
|
|
58292
58343
|
super(options);
|
|
58293
58344
|
options = analizePositionsExtensionProps(options);
|
|
@@ -58455,17 +58506,17 @@ var ImageContainer = class extends Container2 {
|
|
|
58455
58506
|
reloadPosition() {
|
|
58456
58507
|
if (this._align) {
|
|
58457
58508
|
if (this._align.x !== void 0) {
|
|
58458
|
-
super.x = this._align.x
|
|
58509
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x);
|
|
58459
58510
|
}
|
|
58460
58511
|
if (this._align.y !== void 0) {
|
|
58461
|
-
super.y = this._align.y
|
|
58512
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y);
|
|
58462
58513
|
}
|
|
58463
58514
|
} else if (this._percentagePosition) {
|
|
58464
58515
|
if (this._percentagePosition.x !== void 0) {
|
|
58465
|
-
super.x = this._percentagePosition.x
|
|
58516
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
58466
58517
|
}
|
|
58467
58518
|
if (this._percentagePosition.y !== void 0) {
|
|
58468
|
-
super.y = this._percentagePosition.y
|
|
58519
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
58469
58520
|
}
|
|
58470
58521
|
}
|
|
58471
58522
|
}
|
|
@@ -58613,7 +58664,7 @@ function checkIfVideo(imageUrl) {
|
|
|
58613
58664
|
|
|
58614
58665
|
// src/functions/canvas/image-utility.ts
|
|
58615
58666
|
init_lib();
|
|
58616
|
-
function addImage(alias, imageUrl) {
|
|
58667
|
+
function addImage(alias, imageUrl, options) {
|
|
58617
58668
|
if (!imageUrl) {
|
|
58618
58669
|
if (Assets.resolver.hasKey(alias)) {
|
|
58619
58670
|
imageUrl = alias;
|
|
@@ -58621,8 +58672,7 @@ function addImage(alias, imageUrl) {
|
|
|
58621
58672
|
throw new Error(`The image ${alias} does not exist in the cache.`);
|
|
58622
58673
|
}
|
|
58623
58674
|
}
|
|
58624
|
-
let image = new ImageSprite();
|
|
58625
|
-
image.textureAlias = imageUrl;
|
|
58675
|
+
let image = new ImageSprite(options, imageUrl);
|
|
58626
58676
|
canvas.add(alias, image);
|
|
58627
58677
|
return image;
|
|
58628
58678
|
}
|
|
@@ -58645,15 +58695,23 @@ async function loadImage(canvasImages) {
|
|
|
58645
58695
|
});
|
|
58646
58696
|
});
|
|
58647
58697
|
}
|
|
58648
|
-
async function showImage(alias, imageUrl) {
|
|
58649
|
-
|
|
58698
|
+
async function showImage(alias, imageUrl, options) {
|
|
58699
|
+
if (!imageUrl) {
|
|
58700
|
+
if (Assets.resolver.hasKey(alias)) {
|
|
58701
|
+
imageUrl = alias;
|
|
58702
|
+
} else {
|
|
58703
|
+
throw new Error(`The image ${alias} does not exist in the cache.`);
|
|
58704
|
+
}
|
|
58705
|
+
}
|
|
58706
|
+
let image = new ImageSprite(options, imageUrl);
|
|
58650
58707
|
await image.load();
|
|
58708
|
+
canvas.add(alias, image);
|
|
58651
58709
|
return image;
|
|
58652
58710
|
}
|
|
58653
58711
|
|
|
58654
58712
|
// src/functions/canvas/video-utility.ts
|
|
58655
58713
|
init_lib();
|
|
58656
|
-
function addVideo(alias, videoUrl) {
|
|
58714
|
+
function addVideo(alias, videoUrl, options) {
|
|
58657
58715
|
if (!videoUrl) {
|
|
58658
58716
|
if (Assets.resolver.hasKey(alias)) {
|
|
58659
58717
|
videoUrl = alias;
|
|
@@ -58661,8 +58719,7 @@ function addVideo(alias, videoUrl) {
|
|
|
58661
58719
|
throw new Error(`The video ${alias} does not exist in the cache.`);
|
|
58662
58720
|
}
|
|
58663
58721
|
}
|
|
58664
|
-
let video = new VideoSprite();
|
|
58665
|
-
video.textureAlias = videoUrl;
|
|
58722
|
+
let video = new VideoSprite(options, videoUrl);
|
|
58666
58723
|
canvas.add(alias, video);
|
|
58667
58724
|
return video;
|
|
58668
58725
|
}
|
|
@@ -58882,7 +58939,7 @@ async function zoomIn(alias, image, props = { direction: "right" }, priority) {
|
|
|
58882
58939
|
if (canvas.find(alias)) {
|
|
58883
58940
|
canvas.copyCanvasElementProperty(alias, canvasElement);
|
|
58884
58941
|
}
|
|
58885
|
-
let container = new
|
|
58942
|
+
let container = new Container3();
|
|
58886
58943
|
container.addChild(canvasElement);
|
|
58887
58944
|
container.height = canvas.canvasHeight;
|
|
58888
58945
|
container.width = canvas.canvasWidth;
|
|
@@ -58939,7 +58996,7 @@ function zoomOut(alias, props = { direction: "right" }, priority) {
|
|
|
58939
58996
|
return;
|
|
58940
58997
|
}
|
|
58941
58998
|
let zIndex = canvas.app.stage.getChildIndex(canvasElement);
|
|
58942
|
-
let container = new
|
|
58999
|
+
let container = new Container3();
|
|
58943
59000
|
container.addChild(canvasElement);
|
|
58944
59001
|
container.height = canvas.canvasHeight;
|
|
58945
59002
|
container.width = canvas.canvasWidth;
|
|
@@ -59003,7 +59060,7 @@ async function pushIn(alias, image, props = { direction: "right" }, priority) {
|
|
|
59003
59060
|
canvas.editAlias(alias, oldCanvasAlias, { ignoreTickers: true });
|
|
59004
59061
|
pushOut(oldCanvasAlias, props, priority);
|
|
59005
59062
|
}
|
|
59006
|
-
let container = new
|
|
59063
|
+
let container = new Container3();
|
|
59007
59064
|
container.height = canvas.canvasHeight;
|
|
59008
59065
|
container.width = canvas.canvasWidth;
|
|
59009
59066
|
container.addChild(canvasElement);
|
|
@@ -59049,7 +59106,7 @@ function pushOut(alias, props = { direction: "right" }, priority) {
|
|
|
59049
59106
|
console.warn("[Pixi\u2019VN] The canvas element is not found.");
|
|
59050
59107
|
return;
|
|
59051
59108
|
}
|
|
59052
|
-
let container = new
|
|
59109
|
+
let container = new Container3();
|
|
59053
59110
|
container.pivot.x = 0;
|
|
59054
59111
|
container.pivot.y = 0;
|
|
59055
59112
|
container.x = 0;
|
|
@@ -59084,8 +59141,8 @@ function pushOut(alias, props = { direction: "right" }, priority) {
|
|
|
59084
59141
|
}
|
|
59085
59142
|
|
|
59086
59143
|
// src/functions/canvas/image-container-utility.ts
|
|
59087
|
-
function addImageCointainer(alias, imageUrls) {
|
|
59088
|
-
let container = new ImageContainer(
|
|
59144
|
+
function addImageCointainer(alias, imageUrls, options) {
|
|
59145
|
+
let container = new ImageContainer(options, imageUrls);
|
|
59089
59146
|
canvas.add(alias, container);
|
|
59090
59147
|
return container;
|
|
59091
59148
|
}
|
|
@@ -59233,27 +59290,30 @@ function getMemorySprite(element) {
|
|
|
59233
59290
|
};
|
|
59234
59291
|
}
|
|
59235
59292
|
async function setMemorySprite(element, memory, options) {
|
|
59293
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
59236
59294
|
await setMemoryContainer(element, memory);
|
|
59237
|
-
if (
|
|
59238
|
-
|
|
59239
|
-
|
|
59240
|
-
element.texture = texture;
|
|
59241
|
-
}
|
|
59242
|
-
}
|
|
59243
|
-
if ("textureData" in memory) {
|
|
59244
|
-
if (memory.textureData.alias) {
|
|
59245
|
-
element.textureAlias = memory.textureData.alias;
|
|
59246
|
-
}
|
|
59247
|
-
if (memory.textureData.url !== "EMPTY") {
|
|
59248
|
-
let textureUrl = memory.textureData.url;
|
|
59249
|
-
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
59250
|
-
textureUrl = memory.textureData.alias;
|
|
59251
|
-
}
|
|
59252
|
-
let texture = await getTexture(textureUrl);
|
|
59295
|
+
if (!ignoreTexture) {
|
|
59296
|
+
if ("textureImage" in memory && memory.textureImage && memory.textureImage.image) {
|
|
59297
|
+
let texture = await getTexture(memory.textureImage.image);
|
|
59253
59298
|
if (texture) {
|
|
59254
59299
|
element.texture = texture;
|
|
59255
59300
|
}
|
|
59256
59301
|
}
|
|
59302
|
+
if ("textureData" in memory) {
|
|
59303
|
+
if (memory.textureData.alias) {
|
|
59304
|
+
element.textureAlias = memory.textureData.alias;
|
|
59305
|
+
}
|
|
59306
|
+
if (memory.textureData.url !== "EMPTY") {
|
|
59307
|
+
let textureUrl = memory.textureData.url;
|
|
59308
|
+
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
59309
|
+
textureUrl = memory.textureData.alias;
|
|
59310
|
+
}
|
|
59311
|
+
let texture = await getTexture(textureUrl);
|
|
59312
|
+
if (texture) {
|
|
59313
|
+
element.texture = texture;
|
|
59314
|
+
}
|
|
59315
|
+
}
|
|
59316
|
+
}
|
|
59257
59317
|
}
|
|
59258
59318
|
let half = options?.half;
|
|
59259
59319
|
if (half) {
|
|
@@ -59781,11 +59841,11 @@ var CanvasManager = class {
|
|
|
59781
59841
|
"height" in oldAlias && delete oldAlias.height;
|
|
59782
59842
|
"width" in oldAlias && delete oldAlias.width;
|
|
59783
59843
|
if (newAlias instanceof VideoSprite) {
|
|
59784
|
-
await setMemoryVideoSprite(newAlias, oldAlias);
|
|
59844
|
+
await setMemoryVideoSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
59785
59845
|
} else if (newAlias instanceof ImageSprite) {
|
|
59786
|
-
await setMemoryImageSprite(newAlias, oldAlias);
|
|
59846
|
+
await setMemoryImageSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
59787
59847
|
} else if (newAlias instanceof Sprite2) {
|
|
59788
|
-
await setMemorySprite(newAlias, oldAlias);
|
|
59848
|
+
await setMemorySprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
59789
59849
|
} else if (newAlias instanceof Text2) {
|
|
59790
59850
|
await setMemoryText(newAlias, oldAlias);
|
|
59791
59851
|
} else if (newAlias instanceof ImageContainer) {
|
|
@@ -61520,16 +61580,25 @@ var NarrationManager = class {
|
|
|
61520
61580
|
return this.alreadyCurrentStepMadeChoicesObj?.find((choice) => choice.choiceIndex === index)?.madeTimes || 0;
|
|
61521
61581
|
}
|
|
61522
61582
|
/* Run Methods */
|
|
61583
|
+
getCanGoNext(options) {
|
|
61584
|
+
let showWarn = options?.showWarn || false;
|
|
61585
|
+
let choiceMenuOptions = this.choiceMenuOptions;
|
|
61586
|
+
if (choiceMenuOptions && choiceMenuOptions.length > 0) {
|
|
61587
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
61588
|
+
return false;
|
|
61589
|
+
}
|
|
61590
|
+
if (this.isRequiredInput) {
|
|
61591
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must enter a value");
|
|
61592
|
+
return false;
|
|
61593
|
+
}
|
|
61594
|
+
return true;
|
|
61595
|
+
}
|
|
61523
61596
|
/**
|
|
61524
61597
|
* Return if can go to the next step.
|
|
61525
61598
|
* @returns True if can go to the next step.
|
|
61526
61599
|
*/
|
|
61527
61600
|
get canGoNext() {
|
|
61528
|
-
|
|
61529
|
-
if (options && options.length > 0) {
|
|
61530
|
-
return false;
|
|
61531
|
-
}
|
|
61532
|
-
return true;
|
|
61601
|
+
return this.getCanGoNext();
|
|
61533
61602
|
}
|
|
61534
61603
|
/**
|
|
61535
61604
|
* Execute the next step and add it to the history.
|
|
@@ -61556,8 +61625,7 @@ var NarrationManager = class {
|
|
|
61556
61625
|
* ```
|
|
61557
61626
|
*/
|
|
61558
61627
|
async goNext(props, choiseMade) {
|
|
61559
|
-
if (!this.
|
|
61560
|
-
console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
61628
|
+
if (!this.getCanGoNext({ showWarn: true })) {
|
|
61561
61629
|
return;
|
|
61562
61630
|
}
|
|
61563
61631
|
if (this.currentLabel && this.currentLabel.onStepEnd) {
|
|
@@ -61927,6 +61995,7 @@ var NarrationManager = class {
|
|
|
61927
61995
|
let glueDialogue = storage.getVariable(storage.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
61928
61996
|
if (glueDialogue) {
|
|
61929
61997
|
dialogue.text = `${glueDialogue.text}${dialogue.text}`;
|
|
61998
|
+
dialogue.character = dialogue.character || glueDialogue.character;
|
|
61930
61999
|
}
|
|
61931
62000
|
this.dialogGlue = false;
|
|
61932
62001
|
}
|
|
@@ -62804,6 +62873,24 @@ function getExponentialProgression(number, progression, valueConvert) {
|
|
|
62804
62873
|
}
|
|
62805
62874
|
|
|
62806
62875
|
// src/classes/ticker/MoveTicker.ts
|
|
62876
|
+
function calculateDestination(args, element) {
|
|
62877
|
+
let destination = createExportableElement(args.destination);
|
|
62878
|
+
if (destination.type === "align") {
|
|
62879
|
+
let anchorx = void 0;
|
|
62880
|
+
let anchory = void 0;
|
|
62881
|
+
if (element instanceof Sprite) {
|
|
62882
|
+
anchorx = element.anchor.x;
|
|
62883
|
+
anchory = element.anchor.y;
|
|
62884
|
+
}
|
|
62885
|
+
destination.x = calculateAlign("width", destination.x, element.width, element.pivot.x, anchorx);
|
|
62886
|
+
destination.y = calculateAlign("height", destination.y, element.height, element.pivot.y, anchory);
|
|
62887
|
+
}
|
|
62888
|
+
if (destination.type === "percentage") {
|
|
62889
|
+
destination.x = calculatePercentagePosition("width", destination.x);
|
|
62890
|
+
destination.y = calculatePercentagePosition("height", destination.y);
|
|
62891
|
+
}
|
|
62892
|
+
return destination;
|
|
62893
|
+
}
|
|
62807
62894
|
var MoveTicker = class extends TickerBase {
|
|
62808
62895
|
fn(ticker, args, aliases, tickerId) {
|
|
62809
62896
|
let xSpeed = 10;
|
|
@@ -62817,7 +62904,6 @@ var MoveTicker = class extends TickerBase {
|
|
|
62817
62904
|
ySpeed = this.speedConvert(args.speed.y);
|
|
62818
62905
|
}
|
|
62819
62906
|
}
|
|
62820
|
-
let destination = args.destination;
|
|
62821
62907
|
let aliasToRemoveAfter2 = args.aliasToRemoveAfter || [];
|
|
62822
62908
|
if (typeof aliasToRemoveAfter2 === "string") {
|
|
62823
62909
|
aliasToRemoveAfter2 = [aliasToRemoveAfter2];
|
|
@@ -62840,6 +62926,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
62840
62926
|
}).forEach((alias) => {
|
|
62841
62927
|
let element = canvas.find(alias);
|
|
62842
62928
|
if (element && element instanceof Container) {
|
|
62929
|
+
let destination = calculateDestination(args, element);
|
|
62843
62930
|
let xDistance = destination.x - element.x > 0 ? 1 : -1;
|
|
62844
62931
|
if (xDistance != 0) {
|
|
62845
62932
|
element.x += xDistance * xSpeed * ticker.deltaTime;
|
|
@@ -62871,7 +62958,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
62871
62958
|
alias.forEach((alias2) => {
|
|
62872
62959
|
let element = canvas.find(alias2);
|
|
62873
62960
|
if (element) {
|
|
62874
|
-
let destination = args
|
|
62961
|
+
let destination = calculateDestination(args, element);
|
|
62875
62962
|
element.x = destination.x;
|
|
62876
62963
|
element.y = destination.y;
|
|
62877
62964
|
if (args.isPushInOut && element.children.length > 0) {
|
|
@@ -63103,7 +63190,7 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
63103
63190
|
character: juliette,
|
|
63104
63191
|
text: `Here's what's going to happen: I'm going to create ${number} bunnies (CanvasSprites) and put them in a Container.`
|
|
63105
63192
|
};
|
|
63106
|
-
const container = new
|
|
63193
|
+
const container = new Container3();
|
|
63107
63194
|
canvas.add("container", container);
|
|
63108
63195
|
const texture = await Assets.load(bunnyImage);
|
|
63109
63196
|
for (let i3 = 0; i3 < number; i3++) {
|
|
@@ -63596,7 +63683,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
63596
63683
|
character: juliette,
|
|
63597
63684
|
text: `Here's what's going to happen:
|
|
63598
63685
|
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
|
|
63599
|
-
- ${flowerTopName} will move to { x:
|
|
63686
|
+
- ${flowerTopName} will move to { x: 0.5, y: 0.5, type: "align" } with a speed of 18.
|
|
63600
63687
|
- ${helmlokName} will move to { x: 100, y: 500 } with a speed of 150 and a linear speed progression of -2 ( limit 10 ), and then move to { x: 1700, y: 500 } with a speed of 10 and a linear speed progression of 2 ( limit 150 ), and repeat.
|
|
63601
63688
|
- ${skullyName} will move to { x: 500, y: 500 } with a speed of 40, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 40.`
|
|
63602
63689
|
};
|
|
@@ -63605,7 +63692,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
63605
63692
|
speed: 24
|
|
63606
63693
|
}));
|
|
63607
63694
|
canvas.addTicker("flowerTop", new MoveTicker({
|
|
63608
|
-
destination: { x:
|
|
63695
|
+
destination: { x: 0.5, y: 0.5, type: "align" },
|
|
63609
63696
|
speed: 18
|
|
63610
63697
|
}));
|
|
63611
63698
|
canvas.addTickersSteps("helmlok", [
|
|
@@ -64199,6 +64286,68 @@ var pixivnTestStartLabel2 = newLabel(
|
|
|
64199
64286
|
]
|
|
64200
64287
|
);
|
|
64201
64288
|
|
|
64289
|
+
// src/classes/canvas/AdditionalPositions.ts
|
|
64290
|
+
function analizePositionsExtensionProps(props) {
|
|
64291
|
+
if (!props) {
|
|
64292
|
+
return props;
|
|
64293
|
+
}
|
|
64294
|
+
if (typeof props.align !== "number") {
|
|
64295
|
+
if (props.xAlign != void 0) {
|
|
64296
|
+
if (props.align === void 0) {
|
|
64297
|
+
props.align = { x: props.xAlign };
|
|
64298
|
+
delete props.xAlign;
|
|
64299
|
+
} else {
|
|
64300
|
+
props.align.x = props.xAlign;
|
|
64301
|
+
delete props.xAlign;
|
|
64302
|
+
}
|
|
64303
|
+
}
|
|
64304
|
+
if (props.yAlign != void 0) {
|
|
64305
|
+
if (props.align === void 0) {
|
|
64306
|
+
props.align = { y: props.yAlign };
|
|
64307
|
+
delete props.yAlign;
|
|
64308
|
+
} else {
|
|
64309
|
+
props.align.y = props.yAlign;
|
|
64310
|
+
delete props.yAlign;
|
|
64311
|
+
}
|
|
64312
|
+
}
|
|
64313
|
+
}
|
|
64314
|
+
if (typeof props.percentagePosition !== "number") {
|
|
64315
|
+
if (props.xPercentagePosition != void 0) {
|
|
64316
|
+
if (props.percentagePosition === void 0) {
|
|
64317
|
+
props.percentagePosition = { x: props.xPercentagePosition };
|
|
64318
|
+
delete props.xPercentagePosition;
|
|
64319
|
+
} else {
|
|
64320
|
+
props.percentagePosition.x = props.xPercentagePosition;
|
|
64321
|
+
delete props.xPercentagePosition;
|
|
64322
|
+
}
|
|
64323
|
+
}
|
|
64324
|
+
if (props.yPercentagePosition != void 0) {
|
|
64325
|
+
if (props.percentagePosition === void 0) {
|
|
64326
|
+
props.percentagePosition = { y: props.yPercentagePosition };
|
|
64327
|
+
delete props.yPercentagePosition;
|
|
64328
|
+
} else {
|
|
64329
|
+
props.percentagePosition.y = props.yPercentagePosition;
|
|
64330
|
+
delete props.yPercentagePosition;
|
|
64331
|
+
}
|
|
64332
|
+
}
|
|
64333
|
+
}
|
|
64334
|
+
return props;
|
|
64335
|
+
}
|
|
64336
|
+
function calculateAlign(type, align, width, pivot, anchor = 0) {
|
|
64337
|
+
if (type === "width") {
|
|
64338
|
+
return align * (canvas.screen.width - width) + pivot + anchor * width;
|
|
64339
|
+
} else {
|
|
64340
|
+
return align * (canvas.screen.height - width) + pivot + anchor * width;
|
|
64341
|
+
}
|
|
64342
|
+
}
|
|
64343
|
+
function calculatePercentagePosition(type, percentage) {
|
|
64344
|
+
if (type === "width") {
|
|
64345
|
+
return percentage * canvas.screen.width;
|
|
64346
|
+
} else {
|
|
64347
|
+
return percentage * canvas.screen.height;
|
|
64348
|
+
}
|
|
64349
|
+
}
|
|
64350
|
+
|
|
64202
64351
|
// src/classes/canvas/ImageSprite.ts
|
|
64203
64352
|
var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
64204
64353
|
pixivnId = CANVAS_IMAGE_ID;
|
|
@@ -64325,17 +64474,17 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
64325
64474
|
reloadPosition() {
|
|
64326
64475
|
if (this._align) {
|
|
64327
64476
|
if (this._align.x !== void 0) {
|
|
64328
|
-
super.x = this._align.x
|
|
64477
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x, this.anchor.x);
|
|
64329
64478
|
}
|
|
64330
64479
|
if (this._align.y !== void 0) {
|
|
64331
|
-
super.y = this._align.y
|
|
64480
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y, this.anchor.y);
|
|
64332
64481
|
}
|
|
64333
64482
|
} else if (this._percentagePosition) {
|
|
64334
64483
|
if (this._percentagePosition.x !== void 0) {
|
|
64335
|
-
super.x = this._percentagePosition.x
|
|
64484
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
64336
64485
|
}
|
|
64337
64486
|
if (this._percentagePosition.y !== void 0) {
|
|
64338
|
-
super.y = this._percentagePosition.y
|
|
64487
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
64339
64488
|
}
|
|
64340
64489
|
}
|
|
64341
64490
|
}
|
|
@@ -64364,17 +64513,21 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
64364
64513
|
super.y = value;
|
|
64365
64514
|
}
|
|
64366
64515
|
};
|
|
64367
|
-
async function setMemoryImageSprite(element, memory) {
|
|
64516
|
+
async function setMemoryImageSprite(element, memory, options) {
|
|
64517
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
64368
64518
|
memory = analizePositionsExtensionProps(memory);
|
|
64369
64519
|
return await setMemorySprite(element, memory, {
|
|
64370
64520
|
half: async () => {
|
|
64371
64521
|
"align" in memory && memory.align !== void 0 && (element.align = memory.align);
|
|
64372
64522
|
"percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
|
|
64373
|
-
|
|
64523
|
+
if (!ignoreTexture) {
|
|
64524
|
+
"imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
|
|
64525
|
+
}
|
|
64374
64526
|
if ("loadIsStarted" in memory && memory.loadIsStarted) {
|
|
64375
64527
|
await element.load();
|
|
64376
64528
|
}
|
|
64377
|
-
}
|
|
64529
|
+
},
|
|
64530
|
+
ignoreTexture: options?.ignoreTexture
|
|
64378
64531
|
});
|
|
64379
64532
|
}
|
|
64380
64533
|
|
|
@@ -64485,8 +64638,8 @@ var VideoSprite = class _VideoSprite extends ImageSprite {
|
|
|
64485
64638
|
}
|
|
64486
64639
|
}
|
|
64487
64640
|
};
|
|
64488
|
-
async function setMemoryVideoSprite(element, memory) {
|
|
64489
|
-
await setMemoryImageSprite(element, memory);
|
|
64641
|
+
async function setMemoryVideoSprite(element, memory, options) {
|
|
64642
|
+
await setMemoryImageSprite(element, memory, { ignoreTexture: options?.ignoreTexture });
|
|
64490
64643
|
"loop" in memory && memory.loop !== void 0 && (element.loop = memory.loop);
|
|
64491
64644
|
"currentTime" in memory && memory.currentTime !== void 0 && (element.currentTime = memory.currentTime);
|
|
64492
64645
|
"paused" in memory && memory.paused !== void 0 && (element.paused = memory.paused);
|