@drincs/pixi-vn 0.9.7 → 0.9.8
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-EFHDNV22.js +9 -0
- package/dist/WebGPURenderer-LEKL575M.js +10 -0
- package/dist/{browserAll-2HD5EH7K.js → browserAll-S4EPEXZD.js} +5 -5
- package/dist/{chunk-WNOARCWH.js → chunk-3XKVLXKN.js} +2 -2
- package/dist/{chunk-PP5T5HEO.js → chunk-52ZSR3AN.js} +1 -1
- package/dist/{chunk-SAUNZQHZ.js → chunk-D753T42C.js} +1 -1
- package/dist/{chunk-TOG67Z7Q.js → chunk-DQ47ST7G.js} +2 -2
- package/dist/{chunk-73ID6GAW.js → chunk-DWJGQ2A5.js} +2 -2
- package/dist/{chunk-5VX2VTDZ.js → chunk-DXOIIOAQ.js} +81 -27
- package/dist/{chunk-Z3NBKYVU.js → chunk-DZMWRZUL.js} +10 -9
- package/dist/{chunk-NB4Q3GFK.js → chunk-FXH7A6UR.js} +224 -53
- 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-ODIEVSQX.js → chunk-OPLBQKS2.js} +3 -3
- package/dist/{chunk-Y3WNBACN.js → chunk-R4J2U4HN.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 +397 -248
- package/dist/classes/CharacterBaseModel.js +14 -15
- package/dist/classes/CharacterStoredClass.cjs +397 -248
- package/dist/classes/CharacterStoredClass.js +14 -15
- package/dist/classes/ChoiceMenuOption.cjs +325 -178
- package/dist/classes/ChoiceMenuOption.js +14 -15
- package/dist/classes/Sound.cjs +397 -248
- package/dist/classes/Sound.js +14 -15
- package/dist/classes/StoredClassModel.cjs +397 -248
- package/dist/classes/StoredClassModel.js +14 -15
- package/dist/classes/canvas/AdditionalPositions.cjs +39323 -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 +389 -242
- package/dist/classes/canvas/Container.d.cts +1 -1
- package/dist/classes/canvas/Container.d.ts +1 -1
- package/dist/classes/canvas/Container.js +14 -15
- package/dist/classes/canvas/ImageContainer.cjs +325 -176
- package/dist/classes/canvas/ImageContainer.d.cts +1 -1
- package/dist/classes/canvas/ImageContainer.d.ts +1 -1
- package/dist/classes/canvas/ImageContainer.js +14 -15
- package/dist/classes/canvas/ImageSprite.cjs +3041 -2892
- package/dist/classes/canvas/ImageSprite.d.cts +1 -1
- package/dist/classes/canvas/ImageSprite.d.ts +1 -1
- package/dist/classes/canvas/ImageSprite.js +14 -15
- package/dist/classes/canvas/Sprite.cjs +397 -252
- package/dist/classes/canvas/Sprite.d.cts +1 -1
- package/dist/classes/canvas/Sprite.d.ts +1 -1
- package/dist/classes/canvas/Sprite.js +14 -15
- package/dist/classes/canvas/Text.cjs +319 -172
- package/dist/classes/canvas/Text.d.cts +1 -1
- package/dist/classes/canvas/Text.d.ts +1 -1
- package/dist/classes/canvas/Text.js +14 -15
- package/dist/classes/canvas/VideoSprite.cjs +3038 -2887
- package/dist/classes/canvas/VideoSprite.d.cts +4 -2
- package/dist/classes/canvas/VideoSprite.d.ts +4 -2
- package/dist/classes/canvas/VideoSprite.js +14 -15
- package/dist/classes/index.cjs +399 -252
- package/dist/classes/index.d.cts +1 -1
- package/dist/classes/index.d.ts +1 -1
- package/dist/classes/index.js +14 -15
- package/dist/classes/ticker/FadeAlphaTicker.cjs +325 -178
- package/dist/classes/ticker/FadeAlphaTicker.js +14 -15
- package/dist/classes/ticker/MoveTicker.cjs +3563 -3418
- package/dist/classes/ticker/MoveTicker.js +14 -15
- package/dist/classes/ticker/RotateTicker.cjs +325 -178
- package/dist/classes/ticker/RotateTicker.js +14 -15
- package/dist/classes/ticker/TickerBase.cjs +397 -248
- package/dist/classes/ticker/TickerBase.js +14 -15
- package/dist/classes/ticker/ZoomTicker.cjs +325 -178
- package/dist/classes/ticker/ZoomTicker.js +14 -15
- package/dist/classes/ticker/index.cjs +397 -252
- package/dist/classes/ticker/index.js +14 -15
- 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 +389 -242
- 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 +14 -15
- package/dist/decorators/event-decorator.d.cts +1 -1
- package/dist/decorators/event-decorator.d.ts +1 -1
- package/dist/decorators/index.cjs +325 -178
- package/dist/decorators/index.d.cts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +14 -15
- package/dist/decorators/label-decorator.cjs +397 -250
- package/dist/decorators/label-decorator.js +14 -15
- package/dist/functions/canvas/canvas-effect.cjs +394 -247
- package/dist/functions/canvas/canvas-effect.js +14 -15
- package/dist/functions/canvas/canvas-memory-utility.cjs +389 -242
- 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 +14 -15
- package/dist/functions/canvas/canvas-transition.cjs +397 -250
- 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 +14 -15
- package/dist/functions/canvas/canvas-utility.cjs +397 -248
- package/dist/functions/canvas/canvas-utility.js +14 -15
- package/dist/functions/canvas/image-container-utility.cjs +397 -250
- package/dist/functions/canvas/image-container-utility.d.cts +1 -1
- package/dist/functions/canvas/image-container-utility.d.ts +1 -1
- package/dist/functions/canvas/image-container-utility.js +14 -15
- package/dist/functions/canvas/image-utility.cjs +397 -250
- package/dist/functions/canvas/image-utility.d.cts +1 -1
- package/dist/functions/canvas/image-utility.d.ts +1 -1
- package/dist/functions/canvas/image-utility.js +14 -15
- package/dist/functions/canvas/video-utility.cjs +4682 -4531
- package/dist/functions/canvas/video-utility.d.cts +1 -1
- package/dist/functions/canvas/video-utility.d.ts +1 -1
- package/dist/functions/canvas/video-utility.js +14 -15
- package/dist/functions/dialogue-utility.cjs +397 -248
- package/dist/functions/dialogue-utility.js +14 -15
- package/dist/functions/flags-utility.cjs +397 -248
- package/dist/functions/flags-utility.js +14 -15
- package/dist/functions/game-utility.cjs +397 -248
- package/dist/functions/game-utility.js +14 -15
- package/dist/functions/index.cjs +397 -252
- package/dist/functions/index.d.cts +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/index.js +14 -15
- package/dist/functions/saves-utility.cjs +397 -248
- package/dist/functions/saves-utility.d.cts +1 -1
- package/dist/functions/saves-utility.d.ts +1 -1
- package/dist/functions/saves-utility.js +14 -15
- package/dist/functions/sound-utility.cjs +92 -48
- package/dist/functions/sound-utility.js +10 -10
- package/dist/functions/texture-utility.cjs +319 -172
- package/dist/functions/texture-utility.d.cts +1 -1
- package/dist/functions/texture-utility.d.ts +1 -1
- package/dist/functions/texture-utility.js +14 -15
- package/dist/index.cjs +268 -121
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -15
- 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 +397 -250
- package/dist/labels/BaseCanvasElementTestLabel.js +14 -15
- package/dist/labels/CanvasEventsTestLabel.cjs +397 -250
- package/dist/labels/CanvasEventsTestLabel.d.cts +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.ts +1 -1
- package/dist/labels/CanvasEventsTestLabel.js +14 -15
- package/dist/labels/CustomTickerCanvasElementTestLabel.cjs +268 -121
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +14 -15
- package/dist/labels/ImagesAnimationsTestLabel.cjs +397 -250
- package/dist/labels/ImagesAnimationsTestLabel.js +14 -15
- package/dist/labels/InputTestLabel.cjs +325 -178
- package/dist/labels/InputTestLabel.js +14 -15
- package/dist/labels/MarkdownTest.cjs +325 -178
- package/dist/labels/MarkdownTest.js +14 -15
- package/dist/labels/SoundTestLabel.cjs +325 -178
- package/dist/labels/SoundTestLabel.js +14 -15
- package/dist/labels/StartLabel.cjs +397 -250
- package/dist/labels/StartLabel.js +14 -15
- package/dist/labels/StepLabelTest.cjs +325 -178
- package/dist/labels/StepLabelTest.js +14 -15
- package/dist/labels/VideoTestLabel.cjs +325 -178
- package/dist/labels/VideoTestLabel.js +14 -15
- package/dist/labels/index.cjs +397 -250
- package/dist/labels/index.js +14 -15
- package/dist/{lib-6FCVILMQ.js → lib-5KZOZFFM.js} +8 -8
- package/dist/managers/CanvasManager.cjs +397 -248
- package/dist/managers/CanvasManager.d.cts +1 -1
- package/dist/managers/CanvasManager.d.ts +1 -1
- package/dist/managers/CanvasManager.js +14 -15
- 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 +397 -248
- package/dist/managers/NarrationManager.d.cts +2 -1
- package/dist/managers/NarrationManager.d.ts +2 -1
- package/dist/managers/NarrationManager.js +14 -15
- package/dist/managers/NarrationManagerStatic.cjs +397 -248
- package/dist/managers/NarrationManagerStatic.d.cts +1 -1
- package/dist/managers/NarrationManagerStatic.d.ts +1 -1
- package/dist/managers/NarrationManagerStatic.js +14 -15
- package/dist/managers/SoundManager.cjs +397 -248
- package/dist/managers/SoundManager.js +14 -15
- package/dist/managers/StorageManager.cjs +397 -248
- package/dist/managers/StorageManager.js +14 -15
- package/dist/managers/index.cjs +397 -248
- package/dist/managers/index.d.cts +1 -1
- package/dist/managers/index.d.ts +1 -1
- package/dist/managers/index.js +14 -15
- 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
|
@@ -2966,22 +2966,25 @@ var init_Rectangle = __esm({
|
|
|
2966
2966
|
* @param x - The X coordinate of the point to test
|
|
2967
2967
|
* @param y - The Y coordinate of the point to test
|
|
2968
2968
|
* @param strokeWidth - The width of the line to check
|
|
2969
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
2969
2970
|
* @returns Whether the x/y coordinates are within this rectangle
|
|
2970
2971
|
*/
|
|
2971
|
-
strokeContains(x2, y2, strokeWidth) {
|
|
2972
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
2972
2973
|
const { width, height } = this;
|
|
2973
2974
|
if (width <= 0 || height <= 0)
|
|
2974
2975
|
return false;
|
|
2975
2976
|
const _x = this.x;
|
|
2976
2977
|
const _y = this.y;
|
|
2977
|
-
const
|
|
2978
|
-
const
|
|
2979
|
-
const
|
|
2980
|
-
const
|
|
2981
|
-
const
|
|
2982
|
-
const
|
|
2983
|
-
const
|
|
2984
|
-
const
|
|
2978
|
+
const strokeWidthOuter = strokeWidth * (1 - alignment);
|
|
2979
|
+
const strokeWidthInner = strokeWidth - strokeWidthOuter;
|
|
2980
|
+
const outerLeft = _x - strokeWidthOuter;
|
|
2981
|
+
const outerRight = _x + width + strokeWidthOuter;
|
|
2982
|
+
const outerTop = _y - strokeWidthOuter;
|
|
2983
|
+
const outerBottom = _y + height + strokeWidthOuter;
|
|
2984
|
+
const innerLeft = _x + strokeWidthInner;
|
|
2985
|
+
const innerRight = _x + width - strokeWidthInner;
|
|
2986
|
+
const innerTop = _y + strokeWidthInner;
|
|
2987
|
+
const innerBottom = _y + height - strokeWidthInner;
|
|
2985
2988
|
return x2 >= outerLeft && x2 <= outerRight && y2 >= outerTop && y2 <= outerBottom && !(x2 > innerLeft && x2 < innerRight && y2 > innerTop && y2 < innerBottom);
|
|
2986
2989
|
}
|
|
2987
2990
|
/**
|
|
@@ -4115,24 +4118,22 @@ var init_toLocalGlobalMixin = __esm({
|
|
|
4115
4118
|
});
|
|
4116
4119
|
|
|
4117
4120
|
// node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs
|
|
4118
|
-
var
|
|
4121
|
+
var InstructionSet;
|
|
4119
4122
|
var init_InstructionSet = __esm({
|
|
4120
4123
|
"node_modules/pixi.js/lib/rendering/renderers/shared/instructions/InstructionSet.mjs"() {
|
|
4121
4124
|
"use strict";
|
|
4122
4125
|
init_uid();
|
|
4123
|
-
_tick = 0;
|
|
4124
4126
|
InstructionSet = class {
|
|
4125
4127
|
constructor() {
|
|
4126
4128
|
this.uid = uid("instructionSet");
|
|
4127
4129
|
this.instructions = [];
|
|
4128
4130
|
this.instructionSize = 0;
|
|
4129
4131
|
this.renderables = [];
|
|
4130
|
-
this.
|
|
4132
|
+
this.gcTick = 0;
|
|
4131
4133
|
}
|
|
4132
4134
|
/** reset the instruction set so it can be reused set size back to 0 */
|
|
4133
4135
|
reset() {
|
|
4134
4136
|
this.instructionSize = 0;
|
|
4135
|
-
this.tick = _tick++;
|
|
4136
4137
|
}
|
|
4137
4138
|
/**
|
|
4138
4139
|
* Add an instruction to the set
|
|
@@ -5305,6 +5306,7 @@ var init_RenderGroup = __esm({
|
|
|
5305
5306
|
this.worldAlpha = 1;
|
|
5306
5307
|
this.childrenToUpdate = /* @__PURE__ */ Object.create(null);
|
|
5307
5308
|
this.updateTick = 0;
|
|
5309
|
+
this.gcTick = 0;
|
|
5308
5310
|
this.childrenRenderablesToUpdate = { list: [], index: 0 };
|
|
5309
5311
|
this.structureDidChange = true;
|
|
5310
5312
|
this.instructionSet = new InstructionSet();
|
|
@@ -5320,7 +5322,9 @@ var init_RenderGroup = __esm({
|
|
|
5320
5322
|
root.didChange = true;
|
|
5321
5323
|
const children = root.children;
|
|
5322
5324
|
for (let i3 = 0; i3 < children.length; i3++) {
|
|
5323
|
-
|
|
5325
|
+
const child = children[i3];
|
|
5326
|
+
child._updateFlags = 15;
|
|
5327
|
+
this.addChild(child);
|
|
5324
5328
|
}
|
|
5325
5329
|
}
|
|
5326
5330
|
enableCacheAsTexture(options = {}) {
|
|
@@ -11255,8 +11259,7 @@ var init_ViewContainer = __esm({
|
|
|
11255
11259
|
this.canBundle = true;
|
|
11256
11260
|
this.allowChildren = false;
|
|
11257
11261
|
this._roundPixels = 0;
|
|
11258
|
-
this._lastUsed =
|
|
11259
|
-
this._lastInstructionTick = -1;
|
|
11262
|
+
this._lastUsed = -1;
|
|
11260
11263
|
this._bounds = new Bounds(0, 1, 0, 0);
|
|
11261
11264
|
this._boundsDirty = true;
|
|
11262
11265
|
}
|
|
@@ -18587,17 +18590,18 @@ var init_Circle = __esm({
|
|
|
18587
18590
|
* @param x - The X coordinate of the point to test
|
|
18588
18591
|
* @param y - The Y coordinate of the point to test
|
|
18589
18592
|
* @param width - The width of the line to check
|
|
18593
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
18590
18594
|
* @returns Whether the x/y coordinates are within this Circle
|
|
18591
18595
|
*/
|
|
18592
|
-
strokeContains(x2, y2, width) {
|
|
18596
|
+
strokeContains(x2, y2, width, alignment = 0.5) {
|
|
18593
18597
|
if (this.radius === 0)
|
|
18594
18598
|
return false;
|
|
18595
18599
|
const dx = this.x - x2;
|
|
18596
18600
|
const dy = this.y - y2;
|
|
18597
|
-
const
|
|
18598
|
-
const
|
|
18601
|
+
const radius = this.radius;
|
|
18602
|
+
const outerWidth = (1 - alignment) * width;
|
|
18599
18603
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
18600
|
-
return distance
|
|
18604
|
+
return distance <= radius + outerWidth && distance > radius - (width - outerWidth);
|
|
18601
18605
|
}
|
|
18602
18606
|
/**
|
|
18603
18607
|
* Returns the framing rectangle of the circle as a Rectangle object
|
|
@@ -18686,23 +18690,25 @@ var init_Ellipse = __esm({
|
|
|
18686
18690
|
* Checks whether the x and y coordinates given are contained within this ellipse including stroke
|
|
18687
18691
|
* @param x - The X coordinate of the point to test
|
|
18688
18692
|
* @param y - The Y coordinate of the point to test
|
|
18689
|
-
* @param width
|
|
18693
|
+
* @param strokeWidth - The width of the line to check
|
|
18694
|
+
* @param alignment - The alignment of the stroke
|
|
18690
18695
|
* @returns Whether the x/y coords are within this ellipse
|
|
18691
18696
|
*/
|
|
18692
|
-
strokeContains(x2, y2,
|
|
18697
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
18693
18698
|
const { halfWidth, halfHeight } = this;
|
|
18694
18699
|
if (halfWidth <= 0 || halfHeight <= 0) {
|
|
18695
18700
|
return false;
|
|
18696
18701
|
}
|
|
18697
|
-
const
|
|
18698
|
-
const
|
|
18699
|
-
const
|
|
18700
|
-
const
|
|
18701
|
-
const
|
|
18702
|
+
const strokeOuterWidth = strokeWidth * (1 - alignment);
|
|
18703
|
+
const strokeInnerWidth = strokeWidth - strokeOuterWidth;
|
|
18704
|
+
const innerHorizontal = halfWidth - strokeInnerWidth;
|
|
18705
|
+
const innerVertical = halfHeight - strokeInnerWidth;
|
|
18706
|
+
const outerHorizontal = halfWidth + strokeOuterWidth;
|
|
18707
|
+
const outerVertical = halfHeight + strokeOuterWidth;
|
|
18702
18708
|
const normalizedX = x2 - this.x;
|
|
18703
18709
|
const normalizedY = y2 - this.y;
|
|
18704
|
-
const innerEllipse = normalizedX * normalizedX / (
|
|
18705
|
-
const outerEllipse = normalizedX * normalizedX / (
|
|
18710
|
+
const innerEllipse = normalizedX * normalizedX / (innerHorizontal * innerHorizontal) + normalizedY * normalizedY / (innerVertical * innerVertical);
|
|
18711
|
+
const outerEllipse = normalizedX * normalizedX / (outerHorizontal * outerHorizontal) + normalizedY * normalizedY / (outerVertical * outerVertical);
|
|
18706
18712
|
return innerEllipse > 1 && outerEllipse <= 1;
|
|
18707
18713
|
}
|
|
18708
18714
|
/**
|
|
@@ -18844,11 +18850,13 @@ var init_Polygon = __esm({
|
|
|
18844
18850
|
* @param x - The X coordinate of the point to test
|
|
18845
18851
|
* @param y - The Y coordinate of the point to test
|
|
18846
18852
|
* @param strokeWidth - The width of the line to check
|
|
18853
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
18847
18854
|
* @returns Whether the x/y coordinates are within this polygon
|
|
18848
18855
|
*/
|
|
18849
|
-
strokeContains(x2, y2, strokeWidth) {
|
|
18850
|
-
const
|
|
18851
|
-
const
|
|
18856
|
+
strokeContains(x2, y2, strokeWidth, alignment = 0.5) {
|
|
18857
|
+
const strokeWidthSquared = strokeWidth * strokeWidth;
|
|
18858
|
+
const rightWidthSquared = strokeWidthSquared * (1 - alignment);
|
|
18859
|
+
const leftWidthSquared = strokeWidthSquared - rightWidthSquared;
|
|
18852
18860
|
const { points } = this;
|
|
18853
18861
|
const iterationLength = points.length - (this.closePath ? 0 : 2);
|
|
18854
18862
|
for (let i3 = 0; i3 < iterationLength; i3 += 2) {
|
|
@@ -18856,8 +18864,9 @@ var init_Polygon = __esm({
|
|
|
18856
18864
|
const y1 = points[i3 + 1];
|
|
18857
18865
|
const x22 = points[(i3 + 2) % points.length];
|
|
18858
18866
|
const y22 = points[(i3 + 3) % points.length];
|
|
18859
|
-
const
|
|
18860
|
-
|
|
18867
|
+
const distanceSquared = squaredDistanceToLineSegment(x2, y2, x1, y1, x22, y22);
|
|
18868
|
+
const sign = Math.sign((x22 - x1) * (y2 - y1) - (y22 - y1) * (x2 - x1));
|
|
18869
|
+
if (distanceSquared <= (sign < 0 ? leftWidthSquared : rightWidthSquared)) {
|
|
18861
18870
|
return true;
|
|
18862
18871
|
}
|
|
18863
18872
|
}
|
|
@@ -18949,11 +18958,11 @@ var init_RoundedRectangle = __esm({
|
|
|
18949
18958
|
"node_modules/pixi.js/lib/maths/shapes/RoundedRectangle.mjs"() {
|
|
18950
18959
|
"use strict";
|
|
18951
18960
|
init_Rectangle();
|
|
18952
|
-
isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius,
|
|
18961
|
+
isCornerWithinStroke = (pX, pY, cornerX, cornerY, radius, strokeWidthInner, strokeWidthOuter) => {
|
|
18953
18962
|
const dx = pX - cornerX;
|
|
18954
18963
|
const dy = pY - cornerY;
|
|
18955
18964
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
18956
|
-
return distance >= radius -
|
|
18965
|
+
return distance >= radius - strokeWidthInner && distance <= radius + strokeWidthOuter;
|
|
18957
18966
|
};
|
|
18958
18967
|
RoundedRectangle = class _RoundedRectangle {
|
|
18959
18968
|
/**
|
|
@@ -19055,26 +19064,60 @@ var init_RoundedRectangle = __esm({
|
|
|
19055
19064
|
* @param pX - The X coordinate of the point to test
|
|
19056
19065
|
* @param pY - The Y coordinate of the point to test
|
|
19057
19066
|
* @param strokeWidth - The width of the line to check
|
|
19067
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
19058
19068
|
* @returns Whether the x/y coordinates are within this rectangle
|
|
19059
19069
|
*/
|
|
19060
|
-
strokeContains(pX, pY, strokeWidth) {
|
|
19070
|
+
strokeContains(pX, pY, strokeWidth, alignment = 0.5) {
|
|
19061
19071
|
const { x: x2, y: y2, width, height, radius } = this;
|
|
19062
|
-
const
|
|
19072
|
+
const strokeWidthOuter = strokeWidth * (1 - alignment);
|
|
19073
|
+
const strokeWidthInner = strokeWidth - strokeWidthOuter;
|
|
19063
19074
|
const innerX = x2 + radius;
|
|
19064
19075
|
const innerY = y2 + radius;
|
|
19065
19076
|
const innerWidth = width - radius * 2;
|
|
19066
19077
|
const innerHeight = height - radius * 2;
|
|
19067
19078
|
const rightBound = x2 + width;
|
|
19068
19079
|
const bottomBound = y2 + height;
|
|
19069
|
-
if ((pX >= x2 -
|
|
19080
|
+
if ((pX >= x2 - strokeWidthOuter && pX <= x2 + strokeWidthInner || pX >= rightBound - strokeWidthInner && pX <= rightBound + strokeWidthOuter) && pY >= innerY && pY <= innerY + innerHeight) {
|
|
19070
19081
|
return true;
|
|
19071
19082
|
}
|
|
19072
|
-
if ((pY >= y2 -
|
|
19083
|
+
if ((pY >= y2 - strokeWidthOuter && pY <= y2 + strokeWidthInner || pY >= bottomBound - strokeWidthInner && pY <= bottomBound + strokeWidthOuter) && pX >= innerX && pX <= innerX + innerWidth) {
|
|
19073
19084
|
return true;
|
|
19074
19085
|
}
|
|
19075
19086
|
return (
|
|
19076
19087
|
// Top-left
|
|
19077
|
-
pX < innerX && pY < innerY && isCornerWithinStroke(
|
|
19088
|
+
pX < innerX && pY < innerY && isCornerWithinStroke(
|
|
19089
|
+
pX,
|
|
19090
|
+
pY,
|
|
19091
|
+
innerX,
|
|
19092
|
+
innerY,
|
|
19093
|
+
radius,
|
|
19094
|
+
strokeWidthInner,
|
|
19095
|
+
strokeWidthOuter
|
|
19096
|
+
) || pX > rightBound - radius && pY < innerY && isCornerWithinStroke(
|
|
19097
|
+
pX,
|
|
19098
|
+
pY,
|
|
19099
|
+
rightBound - radius,
|
|
19100
|
+
innerY,
|
|
19101
|
+
radius,
|
|
19102
|
+
strokeWidthInner,
|
|
19103
|
+
strokeWidthOuter
|
|
19104
|
+
) || pX > rightBound - radius && pY > bottomBound - radius && isCornerWithinStroke(
|
|
19105
|
+
pX,
|
|
19106
|
+
pY,
|
|
19107
|
+
rightBound - radius,
|
|
19108
|
+
bottomBound - radius,
|
|
19109
|
+
radius,
|
|
19110
|
+
strokeWidthInner,
|
|
19111
|
+
strokeWidthOuter
|
|
19112
|
+
) || pX < innerX && pY > bottomBound - radius && isCornerWithinStroke(
|
|
19113
|
+
pX,
|
|
19114
|
+
pY,
|
|
19115
|
+
innerX,
|
|
19116
|
+
bottomBound - radius,
|
|
19117
|
+
radius,
|
|
19118
|
+
strokeWidthInner,
|
|
19119
|
+
strokeWidthOuter
|
|
19120
|
+
)
|
|
19078
19121
|
);
|
|
19079
19122
|
}
|
|
19080
19123
|
toString() {
|
|
@@ -19908,7 +19951,7 @@ var init_ShapePath = __esm({
|
|
|
19908
19951
|
const delta = Math.PI * 2 / sides;
|
|
19909
19952
|
const polygon = [];
|
|
19910
19953
|
for (let i3 = 0; i3 < sides; i3++) {
|
|
19911
|
-
const angle = i3 * delta
|
|
19954
|
+
const angle = startAngle - i3 * delta;
|
|
19912
19955
|
polygon.push(
|
|
19913
19956
|
x2 + radius * Math.cos(angle),
|
|
19914
19957
|
y2 + radius * Math.sin(angle)
|
|
@@ -21608,13 +21651,13 @@ var init_GraphicsContext = __esm({
|
|
|
21608
21651
|
if (action === "stroke") {
|
|
21609
21652
|
const data = instruction.data;
|
|
21610
21653
|
const alignment = data.style.alignment;
|
|
21611
|
-
const
|
|
21654
|
+
const outerPadding = data.style.width * (1 - alignment);
|
|
21612
21655
|
const _bounds = data.path.bounds;
|
|
21613
21656
|
bounds.addFrame(
|
|
21614
|
-
_bounds.minX -
|
|
21615
|
-
_bounds.minY -
|
|
21616
|
-
_bounds.maxX +
|
|
21617
|
-
_bounds.maxY +
|
|
21657
|
+
_bounds.minX - outerPadding,
|
|
21658
|
+
_bounds.minY - outerPadding,
|
|
21659
|
+
_bounds.maxX + outerPadding,
|
|
21660
|
+
_bounds.maxY + outerPadding
|
|
21618
21661
|
);
|
|
21619
21662
|
}
|
|
21620
21663
|
}
|
|
@@ -21647,7 +21690,8 @@ var init_GraphicsContext = __esm({
|
|
|
21647
21690
|
if (instruction.action === "fill") {
|
|
21648
21691
|
hasHit = shape.contains(transformedPoint.x, transformedPoint.y);
|
|
21649
21692
|
} else {
|
|
21650
|
-
|
|
21693
|
+
const strokeStyle = style;
|
|
21694
|
+
hasHit = shape.strokeContains(transformedPoint.x, transformedPoint.y, strokeStyle.width, strokeStyle.alignment);
|
|
21651
21695
|
}
|
|
21652
21696
|
const holes = data.hole;
|
|
21653
21697
|
if (holes) {
|
|
@@ -29503,7 +29547,7 @@ function collectAllRenderablesSimple(container, instructionSet, renderer) {
|
|
|
29503
29547
|
renderPipes3.blendMode.setBlendMode(renderable, container.groupBlendMode, instructionSet);
|
|
29504
29548
|
const rp = renderPipes3;
|
|
29505
29549
|
rp[renderable.renderPipeId].addRenderable(renderable, instructionSet);
|
|
29506
|
-
renderableGC.addRenderable(renderable
|
|
29550
|
+
renderableGC.addRenderable(renderable);
|
|
29507
29551
|
renderable.didViewUpdate = false;
|
|
29508
29552
|
}
|
|
29509
29553
|
if (!container.renderGroup) {
|
|
@@ -29530,7 +29574,7 @@ function collectAllRenderablesAdvanced(container, instructionSet, renderer, isRo
|
|
|
29530
29574
|
renderPipes3.blendMode.setBlendMode(renderable, renderable.groupBlendMode, instructionSet);
|
|
29531
29575
|
const pipe = renderPipes3[renderPipeId];
|
|
29532
29576
|
pipe.addRenderable(renderable, instructionSet);
|
|
29533
|
-
renderableGC.addRenderable(renderable
|
|
29577
|
+
renderableGC.addRenderable(renderable);
|
|
29534
29578
|
renderable.didViewUpdate = false;
|
|
29535
29579
|
}
|
|
29536
29580
|
const children = container.children;
|
|
@@ -29929,7 +29973,7 @@ var init_const8 = __esm({
|
|
|
29929
29973
|
"use strict";
|
|
29930
29974
|
init_eventemitter3();
|
|
29931
29975
|
DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;
|
|
29932
|
-
VERSION = "8.6.
|
|
29976
|
+
VERSION = "8.6.5";
|
|
29933
29977
|
}
|
|
29934
29978
|
});
|
|
29935
29979
|
|
|
@@ -31362,29 +31406,46 @@ var init_clean = __esm({
|
|
|
31362
31406
|
});
|
|
31363
31407
|
|
|
31364
31408
|
// node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs
|
|
31365
|
-
var _RenderableGCSystem, RenderableGCSystem;
|
|
31409
|
+
var renderableGCTick, _RenderableGCSystem, RenderableGCSystem;
|
|
31366
31410
|
var init_RenderableGCSystem = __esm({
|
|
31367
31411
|
"node_modules/pixi.js/lib/rendering/renderers/shared/texture/RenderableGCSystem.mjs"() {
|
|
31368
31412
|
"use strict";
|
|
31369
31413
|
init_Extensions();
|
|
31370
31414
|
init_clean();
|
|
31415
|
+
renderableGCTick = 0;
|
|
31371
31416
|
_RenderableGCSystem = class _RenderableGCSystem2 {
|
|
31372
|
-
/**
|
|
31417
|
+
/**
|
|
31418
|
+
* Creates a new RenderableGCSystem instance.
|
|
31419
|
+
* @param renderer - The renderer this garbage collection system works for
|
|
31420
|
+
*/
|
|
31373
31421
|
constructor(renderer) {
|
|
31374
31422
|
this._managedRenderables = [];
|
|
31375
31423
|
this._managedHashes = [];
|
|
31376
31424
|
this._managedArrays = [];
|
|
31377
31425
|
this._renderer = renderer;
|
|
31378
31426
|
}
|
|
31427
|
+
/**
|
|
31428
|
+
* Initializes the garbage collection system with the provided options.
|
|
31429
|
+
* @param options - Configuration options for the renderer
|
|
31430
|
+
*/
|
|
31379
31431
|
init(options) {
|
|
31380
31432
|
options = { ..._RenderableGCSystem2.defaultOptions, ...options };
|
|
31381
31433
|
this.maxUnusedTime = options.renderableGCMaxUnusedTime;
|
|
31382
31434
|
this._frequency = options.renderableGCFrequency;
|
|
31383
31435
|
this.enabled = options.renderableGCActive;
|
|
31384
31436
|
}
|
|
31437
|
+
/**
|
|
31438
|
+
* Gets whether the garbage collection system is currently enabled.
|
|
31439
|
+
* @returns True if GC is enabled, false otherwise
|
|
31440
|
+
*/
|
|
31385
31441
|
get enabled() {
|
|
31386
31442
|
return !!this._handler;
|
|
31387
31443
|
}
|
|
31444
|
+
/**
|
|
31445
|
+
* Enables or disables the garbage collection system.
|
|
31446
|
+
* When enabled, schedules periodic cleanup of resources.
|
|
31447
|
+
* When disabled, cancels all scheduled cleanups.
|
|
31448
|
+
*/
|
|
31388
31449
|
set enabled(value) {
|
|
31389
31450
|
if (this.enabled === value)
|
|
31390
31451
|
return;
|
|
@@ -31416,28 +31477,53 @@ var init_RenderableGCSystem = __esm({
|
|
|
31416
31477
|
this._renderer.scheduler.cancel(this._arrayHandler);
|
|
31417
31478
|
}
|
|
31418
31479
|
}
|
|
31480
|
+
/**
|
|
31481
|
+
* Adds a hash table to be managed by the garbage collector.
|
|
31482
|
+
* @param context - The object containing the hash table
|
|
31483
|
+
* @param hash - The property name of the hash table
|
|
31484
|
+
*/
|
|
31419
31485
|
addManagedHash(context2, hash) {
|
|
31420
31486
|
this._managedHashes.push({ context: context2, hash });
|
|
31421
31487
|
}
|
|
31488
|
+
/**
|
|
31489
|
+
* Adds an array to be managed by the garbage collector.
|
|
31490
|
+
* @param context - The object containing the array
|
|
31491
|
+
* @param hash - The property name of the array
|
|
31492
|
+
*/
|
|
31422
31493
|
addManagedArray(context2, hash) {
|
|
31423
31494
|
this._managedArrays.push({ context: context2, hash });
|
|
31424
31495
|
}
|
|
31425
|
-
|
|
31496
|
+
/**
|
|
31497
|
+
* Updates the GC timestamp and tracking before rendering.
|
|
31498
|
+
* @param options - The render options
|
|
31499
|
+
* @param options.container - The container to render
|
|
31500
|
+
*/
|
|
31501
|
+
prerender({
|
|
31502
|
+
container
|
|
31503
|
+
}) {
|
|
31426
31504
|
this._now = performance.now();
|
|
31505
|
+
container.renderGroup.gcTick = renderableGCTick++;
|
|
31506
|
+
this._updateInstructionGCTick(container.renderGroup, container.renderGroup.gcTick);
|
|
31427
31507
|
}
|
|
31428
|
-
|
|
31508
|
+
/**
|
|
31509
|
+
* Starts tracking a renderable for garbage collection.
|
|
31510
|
+
* @param renderable - The renderable to track
|
|
31511
|
+
*/
|
|
31512
|
+
addRenderable(renderable) {
|
|
31429
31513
|
if (!this.enabled)
|
|
31430
31514
|
return;
|
|
31431
|
-
renderable._lastUsed
|
|
31432
|
-
if (renderable._lastInstructionTick === -1) {
|
|
31515
|
+
if (renderable._lastUsed === -1) {
|
|
31433
31516
|
this._managedRenderables.push(renderable);
|
|
31434
31517
|
renderable.once("destroyed", this._removeRenderable, this);
|
|
31435
31518
|
}
|
|
31436
|
-
renderable.
|
|
31519
|
+
renderable._lastUsed = this._now;
|
|
31437
31520
|
}
|
|
31438
|
-
/**
|
|
31521
|
+
/**
|
|
31522
|
+
* Performs garbage collection by cleaning up unused renderables.
|
|
31523
|
+
* Removes renderables that haven't been used for longer than maxUnusedTime.
|
|
31524
|
+
*/
|
|
31439
31525
|
run() {
|
|
31440
|
-
const now =
|
|
31526
|
+
const now = this._now;
|
|
31441
31527
|
const managedRenderables = this._managedRenderables;
|
|
31442
31528
|
const renderPipes3 = this._renderer.renderPipes;
|
|
31443
31529
|
let offset = 0;
|
|
@@ -31448,13 +31534,18 @@ var init_RenderableGCSystem = __esm({
|
|
|
31448
31534
|
continue;
|
|
31449
31535
|
}
|
|
31450
31536
|
const renderGroup = renderable.renderGroup ?? renderable.parentRenderGroup;
|
|
31451
|
-
const
|
|
31452
|
-
if (
|
|
31537
|
+
const currentTick = renderGroup?.instructionSet?.gcTick ?? -1;
|
|
31538
|
+
if ((renderGroup?.gcTick ?? 0) === currentTick) {
|
|
31539
|
+
renderable._lastUsed = now;
|
|
31540
|
+
}
|
|
31541
|
+
if (now - renderable._lastUsed > this.maxUnusedTime) {
|
|
31453
31542
|
if (!renderable.destroyed) {
|
|
31454
31543
|
const rp = renderPipes3;
|
|
31544
|
+
if (renderGroup)
|
|
31545
|
+
renderGroup.structureDidChange = false;
|
|
31455
31546
|
rp[renderable.renderPipeId].destroyRenderable(renderable);
|
|
31456
31547
|
}
|
|
31457
|
-
renderable.
|
|
31548
|
+
renderable._lastUsed = -1;
|
|
31458
31549
|
offset++;
|
|
31459
31550
|
renderable.off("destroyed", this._removeRenderable, this);
|
|
31460
31551
|
} else {
|
|
@@ -31463,6 +31554,7 @@ var init_RenderableGCSystem = __esm({
|
|
|
31463
31554
|
}
|
|
31464
31555
|
managedRenderables.length -= offset;
|
|
31465
31556
|
}
|
|
31557
|
+
/** Cleans up the garbage collection system. Disables GC and removes all tracked resources. */
|
|
31466
31558
|
destroy() {
|
|
31467
31559
|
this.enabled = false;
|
|
31468
31560
|
this._renderer = null;
|
|
@@ -31470,6 +31562,10 @@ var init_RenderableGCSystem = __esm({
|
|
|
31470
31562
|
this._managedHashes.length = 0;
|
|
31471
31563
|
this._managedArrays.length = 0;
|
|
31472
31564
|
}
|
|
31565
|
+
/**
|
|
31566
|
+
* Removes a renderable from being tracked when it's destroyed.
|
|
31567
|
+
* @param renderable - The renderable to stop tracking
|
|
31568
|
+
*/
|
|
31473
31569
|
_removeRenderable(renderable) {
|
|
31474
31570
|
const index = this._managedRenderables.indexOf(renderable);
|
|
31475
31571
|
if (index >= 0) {
|
|
@@ -31477,6 +31573,17 @@ var init_RenderableGCSystem = __esm({
|
|
|
31477
31573
|
this._managedRenderables[index] = null;
|
|
31478
31574
|
}
|
|
31479
31575
|
}
|
|
31576
|
+
/**
|
|
31577
|
+
* Updates the GC tick counter for a render group and its children.
|
|
31578
|
+
* @param renderGroup - The render group to update
|
|
31579
|
+
* @param gcTick - The new tick value
|
|
31580
|
+
*/
|
|
31581
|
+
_updateInstructionGCTick(renderGroup, gcTick) {
|
|
31582
|
+
renderGroup.instructionSet.gcTick = gcTick;
|
|
31583
|
+
for (const child of renderGroup.renderGroupChildren) {
|
|
31584
|
+
this._updateInstructionGCTick(child, gcTick);
|
|
31585
|
+
}
|
|
31586
|
+
}
|
|
31480
31587
|
};
|
|
31481
31588
|
_RenderableGCSystem.extension = {
|
|
31482
31589
|
type: [
|
|
@@ -31487,20 +31594,11 @@ var init_RenderableGCSystem = __esm({
|
|
|
31487
31594
|
priority: 0
|
|
31488
31595
|
};
|
|
31489
31596
|
_RenderableGCSystem.defaultOptions = {
|
|
31490
|
-
/**
|
|
31491
|
-
* If set to true, this will enable the garbage collector on the GPU.
|
|
31492
|
-
* @default true
|
|
31493
|
-
*/
|
|
31597
|
+
/** Enable/disable the garbage collector */
|
|
31494
31598
|
renderableGCActive: true,
|
|
31495
|
-
/**
|
|
31496
|
-
* The maximum idle frames before a texture is destroyed by garbage collection.
|
|
31497
|
-
* @default 60 * 60
|
|
31498
|
-
*/
|
|
31599
|
+
/** Time in ms before an unused resource is collected (default 1 minute) */
|
|
31499
31600
|
renderableGCMaxUnusedTime: 6e4,
|
|
31500
|
-
/**
|
|
31501
|
-
* Frames between two garbage collections.
|
|
31502
|
-
* @default 600
|
|
31503
|
-
*/
|
|
31601
|
+
/** How often to run garbage collection in ms (default 30 seconds) */
|
|
31504
31602
|
renderableGCFrequency: 3e4
|
|
31505
31603
|
};
|
|
31506
31604
|
RenderableGCSystem = _RenderableGCSystem;
|
|
@@ -39995,7 +40093,7 @@ var init_loadWebFont = __esm({
|
|
|
39995
40093
|
},
|
|
39996
40094
|
unload(font) {
|
|
39997
40095
|
(Array.isArray(font) ? font : [font]).forEach((t2) => {
|
|
39998
|
-
Cache.remove(t2.family);
|
|
40096
|
+
Cache.remove(`${t2.family}-and-url`);
|
|
39999
40097
|
DOMAdapter.get().getFontFaceSet().delete(t2);
|
|
40000
40098
|
});
|
|
40001
40099
|
}
|
|
@@ -49702,9 +49800,10 @@ var init_Triangle = __esm({
|
|
|
49702
49800
|
* @param pointX - The X coordinate of the point to test
|
|
49703
49801
|
* @param pointY - The Y coordinate of the point to test
|
|
49704
49802
|
* @param strokeWidth - The width of the line to check
|
|
49803
|
+
* @param _alignment - The alignment of the stroke
|
|
49705
49804
|
* @returns Whether the x/y coordinates are within this triangle
|
|
49706
49805
|
*/
|
|
49707
|
-
strokeContains(pointX, pointY, strokeWidth) {
|
|
49806
|
+
strokeContains(pointX, pointY, strokeWidth, _alignment = 0.5) {
|
|
49708
49807
|
const halfStrokeWidth = strokeWidth / 2;
|
|
49709
49808
|
const halfStrokeWidthSquared = halfStrokeWidth * halfStrokeWidth;
|
|
49710
49809
|
const { x: x2, x2: x22, x3, y: y2, y2: y22, y3 } = this;
|
|
@@ -57724,7 +57823,7 @@ extensions.add(soundAsset);
|
|
|
57724
57823
|
var sound = setInstance(new SoundLibrary());
|
|
57725
57824
|
|
|
57726
57825
|
// package.json
|
|
57727
|
-
var version = "0.9.
|
|
57826
|
+
var version = "0.9.8";
|
|
57728
57827
|
|
|
57729
57828
|
// src/constants.ts
|
|
57730
57829
|
var Repeat = "repeat";
|
|
@@ -57856,6 +57955,79 @@ var CANVAS_VIDEO_ID = "Video";
|
|
|
57856
57955
|
// src/classes/canvas/ImageSprite.ts
|
|
57857
57956
|
init_lib();
|
|
57858
57957
|
|
|
57958
|
+
// src/functions/texture-utility.ts
|
|
57959
|
+
init_lib();
|
|
57960
|
+
async function getTexture(textureAlias) {
|
|
57961
|
+
if (textureAlias === "EMPTY") {
|
|
57962
|
+
return;
|
|
57963
|
+
}
|
|
57964
|
+
if (!textureAlias) {
|
|
57965
|
+
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
57966
|
+
return;
|
|
57967
|
+
}
|
|
57968
|
+
if (Assets.cache.has(textureAlias)) {
|
|
57969
|
+
let texture = Assets.get(textureAlias);
|
|
57970
|
+
if (texture) {
|
|
57971
|
+
return texture;
|
|
57972
|
+
}
|
|
57973
|
+
}
|
|
57974
|
+
return Assets.load(textureAlias).then((texture) => {
|
|
57975
|
+
if (!texture) {
|
|
57976
|
+
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
57977
|
+
return;
|
|
57978
|
+
}
|
|
57979
|
+
if (!(texture instanceof Texture)) {
|
|
57980
|
+
console.error("[Pixi\u2019VN] File not is a file", textureAlias);
|
|
57981
|
+
return;
|
|
57982
|
+
}
|
|
57983
|
+
return texture;
|
|
57984
|
+
}).catch((e2) => {
|
|
57985
|
+
console.error("[Pixi\u2019VN] Error loading file", e2);
|
|
57986
|
+
return;
|
|
57987
|
+
});
|
|
57988
|
+
}
|
|
57989
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
57990
|
+
if (!(prop instanceof Object)) {
|
|
57991
|
+
return prop;
|
|
57992
|
+
}
|
|
57993
|
+
console.warn(`[Pixi\u2019VN] Text.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
57994
|
+
return void 0;
|
|
57995
|
+
}
|
|
57996
|
+
function getTextStyle(style) {
|
|
57997
|
+
return {
|
|
57998
|
+
align: style.align,
|
|
57999
|
+
breakWords: style.breakWords,
|
|
58000
|
+
dropShadow: style.dropShadow,
|
|
58001
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
58002
|
+
fontFamily: style.fontFamily,
|
|
58003
|
+
fontSize: style.fontSize,
|
|
58004
|
+
fontStyle: style.fontStyle,
|
|
58005
|
+
fontVariant: style.fontVariant,
|
|
58006
|
+
fontWeight: style.fontWeight,
|
|
58007
|
+
leading: style.leading,
|
|
58008
|
+
letterSpacing: style.letterSpacing,
|
|
58009
|
+
lineHeight: style.lineHeight,
|
|
58010
|
+
padding: style.padding,
|
|
58011
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
58012
|
+
textBaseline: style.textBaseline,
|
|
58013
|
+
trim: style.trim,
|
|
58014
|
+
whiteSpace: style.whiteSpace,
|
|
58015
|
+
wordWrap: style.wordWrap,
|
|
58016
|
+
wordWrapWidth: style.wordWrapWidth
|
|
58017
|
+
};
|
|
58018
|
+
}
|
|
58019
|
+
function checkIfTextureNotIsEmpty(element) {
|
|
58020
|
+
if ((element instanceof ImageSprite || element instanceof ImageContainer) && element.haveEmptyTexture) {
|
|
58021
|
+
return false;
|
|
58022
|
+
} else if (element instanceof Sprite && element.texture?.label == "EMPTY") {
|
|
58023
|
+
return false;
|
|
58024
|
+
}
|
|
58025
|
+
return true;
|
|
58026
|
+
}
|
|
58027
|
+
|
|
58028
|
+
// src/classes/canvas/AdditionalPositions.ts
|
|
58029
|
+
init_lib();
|
|
58030
|
+
|
|
57859
58031
|
// src/index.ts
|
|
57860
58032
|
init_lib();
|
|
57861
58033
|
|
|
@@ -57881,7 +58053,7 @@ function getCanvasElementInstanceById(canvasId) {
|
|
|
57881
58053
|
let eventType = registeredCanvasElement[canvasId];
|
|
57882
58054
|
if (!eventType) {
|
|
57883
58055
|
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
57884
|
-
eventType =
|
|
58056
|
+
eventType = Container3;
|
|
57885
58057
|
} else if (canvasId === CANVAS_VIDEO_ID) {
|
|
57886
58058
|
eventType = VideoSprite;
|
|
57887
58059
|
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
@@ -58020,76 +58192,6 @@ function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
|
58020
58192
|
}
|
|
58021
58193
|
}
|
|
58022
58194
|
|
|
58023
|
-
// src/functions/texture-utility.ts
|
|
58024
|
-
init_lib();
|
|
58025
|
-
async function getTexture(textureAlias) {
|
|
58026
|
-
if (textureAlias === "EMPTY") {
|
|
58027
|
-
return;
|
|
58028
|
-
}
|
|
58029
|
-
if (!textureAlias) {
|
|
58030
|
-
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
58031
|
-
return;
|
|
58032
|
-
}
|
|
58033
|
-
if (Assets.cache.has(textureAlias)) {
|
|
58034
|
-
let texture = Assets.get(textureAlias);
|
|
58035
|
-
if (texture) {
|
|
58036
|
-
return texture;
|
|
58037
|
-
}
|
|
58038
|
-
}
|
|
58039
|
-
return Assets.load(textureAlias).then((texture) => {
|
|
58040
|
-
if (!texture) {
|
|
58041
|
-
console.error("[Pixi\u2019VN] Texture not found", textureAlias);
|
|
58042
|
-
return;
|
|
58043
|
-
}
|
|
58044
|
-
if (!(texture instanceof Texture)) {
|
|
58045
|
-
console.error("[Pixi\u2019VN] File not is a file", textureAlias);
|
|
58046
|
-
return;
|
|
58047
|
-
}
|
|
58048
|
-
return texture;
|
|
58049
|
-
}).catch((e2) => {
|
|
58050
|
-
console.error("[Pixi\u2019VN] Error loading file", e2);
|
|
58051
|
-
return;
|
|
58052
|
-
});
|
|
58053
|
-
}
|
|
58054
|
-
function getFillGradientFillPattern(prop, propName) {
|
|
58055
|
-
if (!(prop instanceof Object)) {
|
|
58056
|
-
return prop;
|
|
58057
|
-
}
|
|
58058
|
-
console.warn(`[Pixi\u2019VN] Text.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
58059
|
-
return void 0;
|
|
58060
|
-
}
|
|
58061
|
-
function getTextStyle(style) {
|
|
58062
|
-
return {
|
|
58063
|
-
align: style.align,
|
|
58064
|
-
breakWords: style.breakWords,
|
|
58065
|
-
dropShadow: style.dropShadow,
|
|
58066
|
-
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
58067
|
-
fontFamily: style.fontFamily,
|
|
58068
|
-
fontSize: style.fontSize,
|
|
58069
|
-
fontStyle: style.fontStyle,
|
|
58070
|
-
fontVariant: style.fontVariant,
|
|
58071
|
-
fontWeight: style.fontWeight,
|
|
58072
|
-
leading: style.leading,
|
|
58073
|
-
letterSpacing: style.letterSpacing,
|
|
58074
|
-
lineHeight: style.lineHeight,
|
|
58075
|
-
padding: style.padding,
|
|
58076
|
-
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
58077
|
-
textBaseline: style.textBaseline,
|
|
58078
|
-
trim: style.trim,
|
|
58079
|
-
whiteSpace: style.whiteSpace,
|
|
58080
|
-
wordWrap: style.wordWrap,
|
|
58081
|
-
wordWrapWidth: style.wordWrapWidth
|
|
58082
|
-
};
|
|
58083
|
-
}
|
|
58084
|
-
function checkIfTextureNotIsEmpty(element) {
|
|
58085
|
-
if ((element instanceof ImageSprite || element instanceof ImageContainer) && element.haveEmptyTexture) {
|
|
58086
|
-
return false;
|
|
58087
|
-
} else if (element instanceof Sprite && element.texture?.label == "EMPTY") {
|
|
58088
|
-
return false;
|
|
58089
|
-
}
|
|
58090
|
-
return true;
|
|
58091
|
-
}
|
|
58092
|
-
|
|
58093
58195
|
// src/classes/ticker/TickerBase.ts
|
|
58094
58196
|
var TickerBase = class {
|
|
58095
58197
|
/**
|
|
@@ -58264,6 +58366,24 @@ function getExponentialProgression(number, progression, valueConvert) {
|
|
|
58264
58366
|
}
|
|
58265
58367
|
|
|
58266
58368
|
// src/classes/ticker/MoveTicker.ts
|
|
58369
|
+
function calculateDestination(args, element) {
|
|
58370
|
+
let destination = createExportableElement(args.destination);
|
|
58371
|
+
if (destination.type === "align") {
|
|
58372
|
+
let anchorx = void 0;
|
|
58373
|
+
let anchory = void 0;
|
|
58374
|
+
if (element instanceof Sprite) {
|
|
58375
|
+
anchorx = element.anchor.x;
|
|
58376
|
+
anchory = element.anchor.y;
|
|
58377
|
+
}
|
|
58378
|
+
destination.x = calculateAlign("width", destination.x, element.width, element.pivot.x, anchorx);
|
|
58379
|
+
destination.y = calculateAlign("height", destination.y, element.height, element.pivot.y, anchory);
|
|
58380
|
+
}
|
|
58381
|
+
if (destination.type === "percentage") {
|
|
58382
|
+
destination.x = calculatePercentagePosition("width", destination.x);
|
|
58383
|
+
destination.y = calculatePercentagePosition("height", destination.y);
|
|
58384
|
+
}
|
|
58385
|
+
return destination;
|
|
58386
|
+
}
|
|
58267
58387
|
var MoveTicker = class extends TickerBase {
|
|
58268
58388
|
fn(ticker, args, aliases, tickerId) {
|
|
58269
58389
|
let xSpeed = 10;
|
|
@@ -58277,7 +58397,6 @@ var MoveTicker = class extends TickerBase {
|
|
|
58277
58397
|
ySpeed = this.speedConvert(args.speed.y);
|
|
58278
58398
|
}
|
|
58279
58399
|
}
|
|
58280
|
-
let destination = args.destination;
|
|
58281
58400
|
let aliasToRemoveAfter2 = args.aliasToRemoveAfter || [];
|
|
58282
58401
|
if (typeof aliasToRemoveAfter2 === "string") {
|
|
58283
58402
|
aliasToRemoveAfter2 = [aliasToRemoveAfter2];
|
|
@@ -58300,6 +58419,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
58300
58419
|
}).forEach((alias) => {
|
|
58301
58420
|
let element = canvas.find(alias);
|
|
58302
58421
|
if (element && element instanceof Container) {
|
|
58422
|
+
let destination = calculateDestination(args, element);
|
|
58303
58423
|
let xDistance = destination.x - element.x > 0 ? 1 : -1;
|
|
58304
58424
|
if (xDistance != 0) {
|
|
58305
58425
|
element.x += xDistance * xSpeed * ticker.deltaTime;
|
|
@@ -58331,7 +58451,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
58331
58451
|
alias.forEach((alias2) => {
|
|
58332
58452
|
let element = canvas.find(alias2);
|
|
58333
58453
|
if (element) {
|
|
58334
|
-
let destination = args
|
|
58454
|
+
let destination = calculateDestination(args, element);
|
|
58335
58455
|
element.x = destination.x;
|
|
58336
58456
|
element.y = destination.y;
|
|
58337
58457
|
if (args.isPushInOut && element.children.length > 0) {
|
|
@@ -58619,55 +58739,6 @@ async function shakeEffect(alias, props = {}, priority) {
|
|
|
58619
58739
|
// src/classes/canvas/ImageContainer.ts
|
|
58620
58740
|
init_lib();
|
|
58621
58741
|
|
|
58622
|
-
// src/classes/canvas/AdditionalPositions.ts
|
|
58623
|
-
init_lib();
|
|
58624
|
-
function analizePositionsExtensionProps(props) {
|
|
58625
|
-
if (!props) {
|
|
58626
|
-
return props;
|
|
58627
|
-
}
|
|
58628
|
-
if (typeof props.align !== "number") {
|
|
58629
|
-
if (props.xAlign != void 0) {
|
|
58630
|
-
if (props.align === void 0) {
|
|
58631
|
-
props.align = { x: props.xAlign };
|
|
58632
|
-
delete props.xAlign;
|
|
58633
|
-
} else {
|
|
58634
|
-
props.align.x = props.xAlign;
|
|
58635
|
-
delete props.xAlign;
|
|
58636
|
-
}
|
|
58637
|
-
}
|
|
58638
|
-
if (props.yAlign != void 0) {
|
|
58639
|
-
if (props.align === void 0) {
|
|
58640
|
-
props.align = { y: props.yAlign };
|
|
58641
|
-
delete props.yAlign;
|
|
58642
|
-
} else {
|
|
58643
|
-
props.align.y = props.yAlign;
|
|
58644
|
-
delete props.yAlign;
|
|
58645
|
-
}
|
|
58646
|
-
}
|
|
58647
|
-
}
|
|
58648
|
-
if (typeof props.percentagePosition !== "number") {
|
|
58649
|
-
if (props.xPercentagePosition != void 0) {
|
|
58650
|
-
if (props.percentagePosition === void 0) {
|
|
58651
|
-
props.percentagePosition = { x: props.xPercentagePosition };
|
|
58652
|
-
delete props.xPercentagePosition;
|
|
58653
|
-
} else {
|
|
58654
|
-
props.percentagePosition.x = props.xPercentagePosition;
|
|
58655
|
-
delete props.xPercentagePosition;
|
|
58656
|
-
}
|
|
58657
|
-
}
|
|
58658
|
-
if (props.yPercentagePosition != void 0) {
|
|
58659
|
-
if (props.percentagePosition === void 0) {
|
|
58660
|
-
props.percentagePosition = { y: props.yPercentagePosition };
|
|
58661
|
-
delete props.yPercentagePosition;
|
|
58662
|
-
} else {
|
|
58663
|
-
props.percentagePosition.y = props.yPercentagePosition;
|
|
58664
|
-
delete props.yPercentagePosition;
|
|
58665
|
-
}
|
|
58666
|
-
}
|
|
58667
|
-
}
|
|
58668
|
-
return props;
|
|
58669
|
-
}
|
|
58670
|
-
|
|
58671
58742
|
// src/classes/canvas/Container.ts
|
|
58672
58743
|
init_lib();
|
|
58673
58744
|
|
|
@@ -58686,7 +58757,7 @@ async function importCanvasElement(memory) {
|
|
|
58686
58757
|
}
|
|
58687
58758
|
|
|
58688
58759
|
// src/classes/canvas/Container.ts
|
|
58689
|
-
var
|
|
58760
|
+
var Container3 = class extends Container {
|
|
58690
58761
|
constructor(options) {
|
|
58691
58762
|
super(options);
|
|
58692
58763
|
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
@@ -58791,7 +58862,7 @@ async function setMemoryContainer(element, memory, opstions) {
|
|
|
58791
58862
|
}
|
|
58792
58863
|
|
|
58793
58864
|
// src/classes/canvas/ImageContainer.ts
|
|
58794
|
-
var ImageContainer = class extends
|
|
58865
|
+
var ImageContainer = class extends Container3 {
|
|
58795
58866
|
constructor(options, textureAliases = []) {
|
|
58796
58867
|
super(options);
|
|
58797
58868
|
options = analizePositionsExtensionProps(options);
|
|
@@ -58959,17 +59030,17 @@ var ImageContainer = class extends Container2 {
|
|
|
58959
59030
|
reloadPosition() {
|
|
58960
59031
|
if (this._align) {
|
|
58961
59032
|
if (this._align.x !== void 0) {
|
|
58962
|
-
super.x = this._align.x
|
|
59033
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x);
|
|
58963
59034
|
}
|
|
58964
59035
|
if (this._align.y !== void 0) {
|
|
58965
|
-
super.y = this._align.y
|
|
59036
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y);
|
|
58966
59037
|
}
|
|
58967
59038
|
} else if (this._percentagePosition) {
|
|
58968
59039
|
if (this._percentagePosition.x !== void 0) {
|
|
58969
|
-
super.x = this._percentagePosition.x
|
|
59040
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
58970
59041
|
}
|
|
58971
59042
|
if (this._percentagePosition.y !== void 0) {
|
|
58972
|
-
super.y = this._percentagePosition.y
|
|
59043
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
58973
59044
|
}
|
|
58974
59045
|
}
|
|
58975
59046
|
}
|
|
@@ -59301,7 +59372,7 @@ async function zoomIn(alias, image, props = { direction: "right" }, priority) {
|
|
|
59301
59372
|
if (canvas.find(alias)) {
|
|
59302
59373
|
canvas.copyCanvasElementProperty(alias, canvasElement);
|
|
59303
59374
|
}
|
|
59304
|
-
let container = new
|
|
59375
|
+
let container = new Container3();
|
|
59305
59376
|
container.addChild(canvasElement);
|
|
59306
59377
|
container.height = canvas.canvasHeight;
|
|
59307
59378
|
container.width = canvas.canvasWidth;
|
|
@@ -59358,7 +59429,7 @@ function zoomOut(alias, props = { direction: "right" }, priority) {
|
|
|
59358
59429
|
return;
|
|
59359
59430
|
}
|
|
59360
59431
|
let zIndex = canvas.app.stage.getChildIndex(canvasElement);
|
|
59361
|
-
let container = new
|
|
59432
|
+
let container = new Container3();
|
|
59362
59433
|
container.addChild(canvasElement);
|
|
59363
59434
|
container.height = canvas.canvasHeight;
|
|
59364
59435
|
container.width = canvas.canvasWidth;
|
|
@@ -59422,7 +59493,7 @@ async function pushIn(alias, image, props = { direction: "right" }, priority) {
|
|
|
59422
59493
|
canvas.editAlias(alias, oldCanvasAlias, { ignoreTickers: true });
|
|
59423
59494
|
pushOut(oldCanvasAlias, props, priority);
|
|
59424
59495
|
}
|
|
59425
|
-
let container = new
|
|
59496
|
+
let container = new Container3();
|
|
59426
59497
|
container.height = canvas.canvasHeight;
|
|
59427
59498
|
container.width = canvas.canvasWidth;
|
|
59428
59499
|
container.addChild(canvasElement);
|
|
@@ -59468,7 +59539,7 @@ function pushOut(alias, props = { direction: "right" }, priority) {
|
|
|
59468
59539
|
console.warn("[Pixi\u2019VN] The canvas element is not found.");
|
|
59469
59540
|
return;
|
|
59470
59541
|
}
|
|
59471
|
-
let container = new
|
|
59542
|
+
let container = new Container3();
|
|
59472
59543
|
container.pivot.x = 0;
|
|
59473
59544
|
container.pivot.y = 0;
|
|
59474
59545
|
container.x = 0;
|
|
@@ -59581,7 +59652,7 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
59581
59652
|
character: juliette,
|
|
59582
59653
|
text: `Here's what's going to happen: I'm going to create ${number} bunnies (CanvasSprites) and put them in a Container.`
|
|
59583
59654
|
};
|
|
59584
|
-
const container = new
|
|
59655
|
+
const container = new Container3();
|
|
59585
59656
|
canvas.add("container", container);
|
|
59586
59657
|
const texture = await Assets.load(bunnyImage);
|
|
59587
59658
|
for (let i3 = 0; i3 < number; i3++) {
|
|
@@ -60074,7 +60145,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
60074
60145
|
character: juliette,
|
|
60075
60146
|
text: `Here's what's going to happen:
|
|
60076
60147
|
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
|
|
60077
|
-
- ${flowerTopName} will move to { x:
|
|
60148
|
+
- ${flowerTopName} will move to { x: 0.5, y: 0.5, type: "align" } with a speed of 18.
|
|
60078
60149
|
- ${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.
|
|
60079
60150
|
- ${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.`
|
|
60080
60151
|
};
|
|
@@ -60083,7 +60154,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
60083
60154
|
speed: 24
|
|
60084
60155
|
}));
|
|
60085
60156
|
canvas.addTicker("flowerTop", new MoveTicker({
|
|
60086
|
-
destination: { x:
|
|
60157
|
+
destination: { x: 0.5, y: 0.5, type: "align" },
|
|
60087
60158
|
speed: 18
|
|
60088
60159
|
}));
|
|
60089
60160
|
canvas.addTickersSteps("helmlok", [
|
|
@@ -60680,6 +60751,68 @@ var pixivnTestStartLabel2 = newLabel(
|
|
|
60680
60751
|
// src/types/CloseType.ts
|
|
60681
60752
|
var Close = "close";
|
|
60682
60753
|
|
|
60754
|
+
// src/classes/canvas/AdditionalPositions.ts
|
|
60755
|
+
function analizePositionsExtensionProps(props) {
|
|
60756
|
+
if (!props) {
|
|
60757
|
+
return props;
|
|
60758
|
+
}
|
|
60759
|
+
if (typeof props.align !== "number") {
|
|
60760
|
+
if (props.xAlign != void 0) {
|
|
60761
|
+
if (props.align === void 0) {
|
|
60762
|
+
props.align = { x: props.xAlign };
|
|
60763
|
+
delete props.xAlign;
|
|
60764
|
+
} else {
|
|
60765
|
+
props.align.x = props.xAlign;
|
|
60766
|
+
delete props.xAlign;
|
|
60767
|
+
}
|
|
60768
|
+
}
|
|
60769
|
+
if (props.yAlign != void 0) {
|
|
60770
|
+
if (props.align === void 0) {
|
|
60771
|
+
props.align = { y: props.yAlign };
|
|
60772
|
+
delete props.yAlign;
|
|
60773
|
+
} else {
|
|
60774
|
+
props.align.y = props.yAlign;
|
|
60775
|
+
delete props.yAlign;
|
|
60776
|
+
}
|
|
60777
|
+
}
|
|
60778
|
+
}
|
|
60779
|
+
if (typeof props.percentagePosition !== "number") {
|
|
60780
|
+
if (props.xPercentagePosition != void 0) {
|
|
60781
|
+
if (props.percentagePosition === void 0) {
|
|
60782
|
+
props.percentagePosition = { x: props.xPercentagePosition };
|
|
60783
|
+
delete props.xPercentagePosition;
|
|
60784
|
+
} else {
|
|
60785
|
+
props.percentagePosition.x = props.xPercentagePosition;
|
|
60786
|
+
delete props.xPercentagePosition;
|
|
60787
|
+
}
|
|
60788
|
+
}
|
|
60789
|
+
if (props.yPercentagePosition != void 0) {
|
|
60790
|
+
if (props.percentagePosition === void 0) {
|
|
60791
|
+
props.percentagePosition = { y: props.yPercentagePosition };
|
|
60792
|
+
delete props.yPercentagePosition;
|
|
60793
|
+
} else {
|
|
60794
|
+
props.percentagePosition.y = props.yPercentagePosition;
|
|
60795
|
+
delete props.yPercentagePosition;
|
|
60796
|
+
}
|
|
60797
|
+
}
|
|
60798
|
+
}
|
|
60799
|
+
return props;
|
|
60800
|
+
}
|
|
60801
|
+
function calculateAlign(type, align, width, pivot, anchor = 0) {
|
|
60802
|
+
if (type === "width") {
|
|
60803
|
+
return align * (canvas.screen.width - width) + pivot + anchor * width;
|
|
60804
|
+
} else {
|
|
60805
|
+
return align * (canvas.screen.height - width) + pivot + anchor * width;
|
|
60806
|
+
}
|
|
60807
|
+
}
|
|
60808
|
+
function calculatePercentagePosition(type, percentage) {
|
|
60809
|
+
if (type === "width") {
|
|
60810
|
+
return percentage * canvas.screen.width;
|
|
60811
|
+
} else {
|
|
60812
|
+
return percentage * canvas.screen.height;
|
|
60813
|
+
}
|
|
60814
|
+
}
|
|
60815
|
+
|
|
60683
60816
|
// src/classes/canvas/Sprite.ts
|
|
60684
60817
|
init_lib();
|
|
60685
60818
|
var Sprite2 = class _Sprite extends Sprite {
|
|
@@ -60781,27 +60914,30 @@ function getMemorySprite(element) {
|
|
|
60781
60914
|
};
|
|
60782
60915
|
}
|
|
60783
60916
|
async function setMemorySprite(element, memory, options) {
|
|
60917
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
60784
60918
|
await setMemoryContainer(element, memory);
|
|
60785
|
-
if (
|
|
60786
|
-
|
|
60787
|
-
|
|
60788
|
-
element.texture = texture;
|
|
60789
|
-
}
|
|
60790
|
-
}
|
|
60791
|
-
if ("textureData" in memory) {
|
|
60792
|
-
if (memory.textureData.alias) {
|
|
60793
|
-
element.textureAlias = memory.textureData.alias;
|
|
60794
|
-
}
|
|
60795
|
-
if (memory.textureData.url !== "EMPTY") {
|
|
60796
|
-
let textureUrl = memory.textureData.url;
|
|
60797
|
-
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
60798
|
-
textureUrl = memory.textureData.alias;
|
|
60799
|
-
}
|
|
60800
|
-
let texture = await getTexture(textureUrl);
|
|
60919
|
+
if (!ignoreTexture) {
|
|
60920
|
+
if ("textureImage" in memory && memory.textureImage && memory.textureImage.image) {
|
|
60921
|
+
let texture = await getTexture(memory.textureImage.image);
|
|
60801
60922
|
if (texture) {
|
|
60802
60923
|
element.texture = texture;
|
|
60803
60924
|
}
|
|
60804
60925
|
}
|
|
60926
|
+
if ("textureData" in memory) {
|
|
60927
|
+
if (memory.textureData.alias) {
|
|
60928
|
+
element.textureAlias = memory.textureData.alias;
|
|
60929
|
+
}
|
|
60930
|
+
if (memory.textureData.url !== "EMPTY") {
|
|
60931
|
+
let textureUrl = memory.textureData.url;
|
|
60932
|
+
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
60933
|
+
textureUrl = memory.textureData.alias;
|
|
60934
|
+
}
|
|
60935
|
+
let texture = await getTexture(textureUrl);
|
|
60936
|
+
if (texture) {
|
|
60937
|
+
element.texture = texture;
|
|
60938
|
+
}
|
|
60939
|
+
}
|
|
60940
|
+
}
|
|
60805
60941
|
}
|
|
60806
60942
|
let half = options?.half;
|
|
60807
60943
|
if (half) {
|
|
@@ -60952,17 +61088,17 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
60952
61088
|
reloadPosition() {
|
|
60953
61089
|
if (this._align) {
|
|
60954
61090
|
if (this._align.x !== void 0) {
|
|
60955
|
-
super.x = this._align.x
|
|
61091
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x, this.anchor.x);
|
|
60956
61092
|
}
|
|
60957
61093
|
if (this._align.y !== void 0) {
|
|
60958
|
-
super.y = this._align.y
|
|
61094
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y, this.anchor.y);
|
|
60959
61095
|
}
|
|
60960
61096
|
} else if (this._percentagePosition) {
|
|
60961
61097
|
if (this._percentagePosition.x !== void 0) {
|
|
60962
|
-
super.x = this._percentagePosition.x
|
|
61098
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
60963
61099
|
}
|
|
60964
61100
|
if (this._percentagePosition.y !== void 0) {
|
|
60965
|
-
super.y = this._percentagePosition.y
|
|
61101
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
60966
61102
|
}
|
|
60967
61103
|
}
|
|
60968
61104
|
}
|
|
@@ -60991,17 +61127,21 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
60991
61127
|
super.y = value;
|
|
60992
61128
|
}
|
|
60993
61129
|
};
|
|
60994
|
-
async function setMemoryImageSprite(element, memory) {
|
|
61130
|
+
async function setMemoryImageSprite(element, memory, options) {
|
|
61131
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
60995
61132
|
memory = analizePositionsExtensionProps(memory);
|
|
60996
61133
|
return await setMemorySprite(element, memory, {
|
|
60997
61134
|
half: async () => {
|
|
60998
61135
|
"align" in memory && memory.align !== void 0 && (element.align = memory.align);
|
|
60999
61136
|
"percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
|
|
61000
|
-
|
|
61137
|
+
if (!ignoreTexture) {
|
|
61138
|
+
"imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
|
|
61139
|
+
}
|
|
61001
61140
|
if ("loadIsStarted" in memory && memory.loadIsStarted) {
|
|
61002
61141
|
await element.load();
|
|
61003
61142
|
}
|
|
61004
|
-
}
|
|
61143
|
+
},
|
|
61144
|
+
ignoreTexture: options?.ignoreTexture
|
|
61005
61145
|
});
|
|
61006
61146
|
}
|
|
61007
61147
|
|
|
@@ -61112,8 +61252,8 @@ var VideoSprite = class _VideoSprite extends ImageSprite {
|
|
|
61112
61252
|
}
|
|
61113
61253
|
}
|
|
61114
61254
|
};
|
|
61115
|
-
async function setMemoryVideoSprite(element, memory) {
|
|
61116
|
-
await setMemoryImageSprite(element, memory);
|
|
61255
|
+
async function setMemoryVideoSprite(element, memory, options) {
|
|
61256
|
+
await setMemoryImageSprite(element, memory, { ignoreTexture: options?.ignoreTexture });
|
|
61117
61257
|
"loop" in memory && memory.loop !== void 0 && (element.loop = memory.loop);
|
|
61118
61258
|
"currentTime" in memory && memory.currentTime !== void 0 && (element.currentTime = memory.currentTime);
|
|
61119
61259
|
"paused" in memory && memory.paused !== void 0 && (element.paused = memory.paused);
|
|
@@ -61965,11 +62105,11 @@ var CanvasManager = class {
|
|
|
61965
62105
|
"height" in oldAlias && delete oldAlias.height;
|
|
61966
62106
|
"width" in oldAlias && delete oldAlias.width;
|
|
61967
62107
|
if (newAlias instanceof VideoSprite) {
|
|
61968
|
-
await setMemoryVideoSprite(newAlias, oldAlias);
|
|
62108
|
+
await setMemoryVideoSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
61969
62109
|
} else if (newAlias instanceof ImageSprite) {
|
|
61970
|
-
await setMemoryImageSprite(newAlias, oldAlias);
|
|
62110
|
+
await setMemoryImageSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
61971
62111
|
} else if (newAlias instanceof Sprite2) {
|
|
61972
|
-
await setMemorySprite(newAlias, oldAlias);
|
|
62112
|
+
await setMemorySprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
61973
62113
|
} else if (newAlias instanceof Text2) {
|
|
61974
62114
|
await setMemoryText(newAlias, oldAlias);
|
|
61975
62115
|
} else if (newAlias instanceof ImageContainer) {
|
|
@@ -63967,16 +64107,25 @@ var NarrationManager = class {
|
|
|
63967
64107
|
return this.alreadyCurrentStepMadeChoicesObj?.find((choice) => choice.choiceIndex === index)?.madeTimes || 0;
|
|
63968
64108
|
}
|
|
63969
64109
|
/* Run Methods */
|
|
64110
|
+
getCanGoNext(options) {
|
|
64111
|
+
let showWarn = options?.showWarn || false;
|
|
64112
|
+
let choiceMenuOptions = this.choiceMenuOptions;
|
|
64113
|
+
if (choiceMenuOptions && choiceMenuOptions.length > 0) {
|
|
64114
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
64115
|
+
return false;
|
|
64116
|
+
}
|
|
64117
|
+
if (this.isRequiredInput) {
|
|
64118
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must enter a value");
|
|
64119
|
+
return false;
|
|
64120
|
+
}
|
|
64121
|
+
return true;
|
|
64122
|
+
}
|
|
63970
64123
|
/**
|
|
63971
64124
|
* Return if can go to the next step.
|
|
63972
64125
|
* @returns True if can go to the next step.
|
|
63973
64126
|
*/
|
|
63974
64127
|
get canGoNext() {
|
|
63975
|
-
|
|
63976
|
-
if (options && options.length > 0) {
|
|
63977
|
-
return false;
|
|
63978
|
-
}
|
|
63979
|
-
return true;
|
|
64128
|
+
return this.getCanGoNext();
|
|
63980
64129
|
}
|
|
63981
64130
|
/**
|
|
63982
64131
|
* Execute the next step and add it to the history.
|
|
@@ -64003,8 +64152,7 @@ var NarrationManager = class {
|
|
|
64003
64152
|
* ```
|
|
64004
64153
|
*/
|
|
64005
64154
|
async goNext(props, choiseMade) {
|
|
64006
|
-
if (!this.
|
|
64007
|
-
console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
64155
|
+
if (!this.getCanGoNext({ showWarn: true })) {
|
|
64008
64156
|
return;
|
|
64009
64157
|
}
|
|
64010
64158
|
if (this.currentLabel && this.currentLabel.onStepEnd) {
|
|
@@ -64374,6 +64522,7 @@ var NarrationManager = class {
|
|
|
64374
64522
|
let glueDialogue = storage.getVariable(storage.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
64375
64523
|
if (glueDialogue) {
|
|
64376
64524
|
dialogue.text = `${glueDialogue.text}${dialogue.text}`;
|
|
64525
|
+
dialogue.character = dialogue.character || glueDialogue.character;
|
|
64377
64526
|
}
|
|
64378
64527
|
this.dialogGlue = false;
|
|
64379
64528
|
}
|