@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
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-ZBUW3MBH.js";
|
|
4
4
|
import {
|
|
5
5
|
Application
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MQPMJVDR.js";
|
|
7
7
|
import {
|
|
8
8
|
require_sha1
|
|
9
9
|
} from "./chunk-IILCLBL2.js";
|
|
@@ -18,7 +18,7 @@ async function i(p) {
|
|
|
18
18
|
importPixi: false,
|
|
19
19
|
...p
|
|
20
20
|
};
|
|
21
|
-
e.app && (e.renderer = e.app.renderer, e.stage = e.app.stage), e.importPixi && !e.pixi && (e.pixi = await import("./lib-
|
|
21
|
+
e.app && (e.renderer = e.app.renderer, e.stage = e.app.stage), e.importPixi && !e.pixi && (e.pixi = await import("./lib-EBGYUC35.js")), window.__PIXI_DEVTOOLS__ = {
|
|
22
22
|
...window.__PIXI_DEVTOOLS__ || {},
|
|
23
23
|
app: e.app,
|
|
24
24
|
stage: e.stage,
|
|
@@ -32,12 +32,12 @@ import {
|
|
|
32
32
|
require_earcut,
|
|
33
33
|
squaredDistanceToLineSegment,
|
|
34
34
|
transformVertices
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-IG7HSAEJ.js";
|
|
36
36
|
import {
|
|
37
37
|
AbstractRenderer,
|
|
38
38
|
ApplicationInitHook,
|
|
39
39
|
Filter
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-BJGKFUMU.js";
|
|
41
41
|
import {
|
|
42
42
|
Bounds,
|
|
43
43
|
Buffer,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
groupD8,
|
|
73
73
|
v8_0_0,
|
|
74
74
|
warn
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-KAHX5SKO.js";
|
|
76
76
|
import {
|
|
77
77
|
__commonJS,
|
|
78
78
|
__toESM
|
|
@@ -4600,7 +4600,7 @@ var browserExt = {
|
|
|
4600
4600
|
},
|
|
4601
4601
|
test: () => true,
|
|
4602
4602
|
load: async () => {
|
|
4603
|
-
await import("./browserAll-
|
|
4603
|
+
await import("./browserAll-S4EPEXZD.js");
|
|
4604
4604
|
}
|
|
4605
4605
|
};
|
|
4606
4606
|
|
|
@@ -4613,7 +4613,7 @@ var webworkerExt = {
|
|
|
4613
4613
|
},
|
|
4614
4614
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
4615
4615
|
load: async () => {
|
|
4616
|
-
await import("./webworkerAll-
|
|
4616
|
+
await import("./webworkerAll-XFBJBJMM.js");
|
|
4617
4617
|
}
|
|
4618
4618
|
};
|
|
4619
4619
|
|
|
@@ -5988,14 +5988,14 @@ async function autoDetectRenderer(options) {
|
|
|
5988
5988
|
for (let i = 0; i < preferredOrder.length; i++) {
|
|
5989
5989
|
const rendererType = preferredOrder[i];
|
|
5990
5990
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
5991
|
-
const { WebGPURenderer: WebGPURenderer2 } = await import("./WebGPURenderer-
|
|
5991
|
+
const { WebGPURenderer: WebGPURenderer2 } = await import("./WebGPURenderer-46NKQGBG.js");
|
|
5992
5992
|
RendererClass = WebGPURenderer2;
|
|
5993
5993
|
finalOptions = { ...options, ...options.webgpu };
|
|
5994
5994
|
break;
|
|
5995
5995
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
5996
5996
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
5997
5997
|
)) {
|
|
5998
|
-
const { WebGLRenderer: WebGLRenderer2 } = await import("./WebGLRenderer-
|
|
5998
|
+
const { WebGLRenderer: WebGLRenderer2 } = await import("./WebGLRenderer-CWVLYTYY.js");
|
|
5999
5999
|
RendererClass = WebGLRenderer2;
|
|
6000
6000
|
finalOptions = { ...options, ...options.webgl };
|
|
6001
6001
|
break;
|
|
@@ -6907,7 +6907,7 @@ var loadWebFont = {
|
|
|
6907
6907
|
},
|
|
6908
6908
|
unload(font) {
|
|
6909
6909
|
(Array.isArray(font) ? font : [font]).forEach((t) => {
|
|
6910
|
-
Cache.remove(t.family);
|
|
6910
|
+
Cache.remove(`${t.family}-and-url`);
|
|
6911
6911
|
DOMAdapter.get().getFontFaceSet().delete(t);
|
|
6912
6912
|
});
|
|
6913
6913
|
}
|
|
@@ -11534,9 +11534,10 @@ var Triangle = class _Triangle {
|
|
|
11534
11534
|
* @param pointX - The X coordinate of the point to test
|
|
11535
11535
|
* @param pointY - The Y coordinate of the point to test
|
|
11536
11536
|
* @param strokeWidth - The width of the line to check
|
|
11537
|
+
* @param _alignment - The alignment of the stroke
|
|
11537
11538
|
* @returns Whether the x/y coordinates are within this triangle
|
|
11538
11539
|
*/
|
|
11539
|
-
strokeContains(pointX, pointY, strokeWidth) {
|
|
11540
|
+
strokeContains(pointX, pointY, strokeWidth, _alignment = 0.5) {
|
|
11540
11541
|
const halfStrokeWidth = strokeWidth / 2;
|
|
11541
11542
|
const halfStrokeWidthSquared = halfStrokeWidth * halfStrokeWidth;
|
|
11542
11543
|
const { x, x2, x3, y, y2, y3 } = this;
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
ResizePlugin,
|
|
16
16
|
TickerPlugin,
|
|
17
17
|
TilingSpritePipe
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IG7HSAEJ.js";
|
|
19
19
|
import {
|
|
20
20
|
extensions
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KAHX5SKO.js";
|
|
22
22
|
|
|
23
23
|
// node_modules/pixi.js/lib/app/init.mjs
|
|
24
24
|
extensions.add(ResizePlugin);
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
aliasToRemoveAfter
|
|
3
3
|
} from "./chunk-OMPJ74CO.js";
|
|
4
|
-
import {
|
|
5
|
-
analizePositionsExtensionProps
|
|
6
|
-
} from "./chunk-IRUKNG2Y.js";
|
|
7
|
-
import {
|
|
8
|
-
Close
|
|
9
|
-
} from "./chunk-I6TNJEE3.js";
|
|
10
4
|
import {
|
|
11
5
|
StorageManagerStatic
|
|
12
6
|
} from "./chunk-DPUSONJ3.js";
|
|
13
7
|
import {
|
|
14
8
|
CanvasManagerStatic
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LZNY6NEZ.js";
|
|
16
10
|
import {
|
|
17
11
|
SoundManagerStatic
|
|
18
12
|
} from "./chunk-6FAGAUDR.js";
|
|
13
|
+
import {
|
|
14
|
+
Close
|
|
15
|
+
} from "./chunk-I6TNJEE3.js";
|
|
19
16
|
import {
|
|
20
17
|
bunnyImage,
|
|
21
18
|
bunnyName,
|
|
@@ -37,7 +34,7 @@ import {
|
|
|
37
34
|
import {
|
|
38
35
|
FilterMemoryToFilter,
|
|
39
36
|
FilterToFilterMemory
|
|
40
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-52ZSR3AN.js";
|
|
41
38
|
import {
|
|
42
39
|
updateTickerProgression
|
|
43
40
|
} from "./chunk-ZZLQ3ILH.js";
|
|
@@ -72,28 +69,28 @@ import {
|
|
|
72
69
|
filters,
|
|
73
70
|
version,
|
|
74
71
|
videoFormats
|
|
75
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-V7WJOX65.js";
|
|
76
73
|
import {
|
|
77
74
|
Sound,
|
|
78
75
|
SoundLibrary,
|
|
79
76
|
filters_exports,
|
|
80
77
|
sound
|
|
81
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-X55ALTH7.js";
|
|
82
79
|
import {
|
|
83
80
|
Assets,
|
|
84
81
|
Text
|
|
85
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-MQPMJVDR.js";
|
|
86
83
|
import {
|
|
87
84
|
FillGradient,
|
|
88
85
|
TextStyle
|
|
89
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-IG7HSAEJ.js";
|
|
90
87
|
import {
|
|
91
88
|
Color,
|
|
92
89
|
Container,
|
|
93
90
|
Rectangle,
|
|
94
91
|
Sprite,
|
|
95
92
|
Texture
|
|
96
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-KAHX5SKO.js";
|
|
97
94
|
import {
|
|
98
95
|
CanvasEvent
|
|
99
96
|
} from "./chunk-HKAY3U4R.js";
|
|
@@ -943,17 +940,17 @@ var ImageContainer = class extends Container2 {
|
|
|
943
940
|
reloadPosition() {
|
|
944
941
|
if (this._align) {
|
|
945
942
|
if (this._align.x !== void 0) {
|
|
946
|
-
super.x = this._align.x
|
|
943
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x);
|
|
947
944
|
}
|
|
948
945
|
if (this._align.y !== void 0) {
|
|
949
|
-
super.y = this._align.y
|
|
946
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y);
|
|
950
947
|
}
|
|
951
948
|
} else if (this._percentagePosition) {
|
|
952
949
|
if (this._percentagePosition.x !== void 0) {
|
|
953
|
-
super.x = this._percentagePosition.x
|
|
950
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
954
951
|
}
|
|
955
952
|
if (this._percentagePosition.y !== void 0) {
|
|
956
|
-
super.y = this._percentagePosition.y
|
|
953
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
957
954
|
}
|
|
958
955
|
}
|
|
959
956
|
}
|
|
@@ -1100,7 +1097,7 @@ function checkIfVideo(imageUrl) {
|
|
|
1100
1097
|
}
|
|
1101
1098
|
|
|
1102
1099
|
// src/functions/canvas/image-utility.ts
|
|
1103
|
-
function addImage(alias, imageUrl) {
|
|
1100
|
+
function addImage(alias, imageUrl, options) {
|
|
1104
1101
|
if (!imageUrl) {
|
|
1105
1102
|
if (Assets.resolver.hasKey(alias)) {
|
|
1106
1103
|
imageUrl = alias;
|
|
@@ -1108,8 +1105,7 @@ function addImage(alias, imageUrl) {
|
|
|
1108
1105
|
throw new Error(`The image ${alias} does not exist in the cache.`);
|
|
1109
1106
|
}
|
|
1110
1107
|
}
|
|
1111
|
-
let image = new ImageSprite();
|
|
1112
|
-
image.textureAlias = imageUrl;
|
|
1108
|
+
let image = new ImageSprite(options, imageUrl);
|
|
1113
1109
|
canvas.add(alias, image);
|
|
1114
1110
|
return image;
|
|
1115
1111
|
}
|
|
@@ -1132,14 +1128,22 @@ async function loadImage(canvasImages) {
|
|
|
1132
1128
|
});
|
|
1133
1129
|
});
|
|
1134
1130
|
}
|
|
1135
|
-
async function showImage(alias, imageUrl) {
|
|
1136
|
-
|
|
1131
|
+
async function showImage(alias, imageUrl, options) {
|
|
1132
|
+
if (!imageUrl) {
|
|
1133
|
+
if (Assets.resolver.hasKey(alias)) {
|
|
1134
|
+
imageUrl = alias;
|
|
1135
|
+
} else {
|
|
1136
|
+
throw new Error(`The image ${alias} does not exist in the cache.`);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
let image = new ImageSprite(options, imageUrl);
|
|
1137
1140
|
await image.load();
|
|
1141
|
+
canvas.add(alias, image);
|
|
1138
1142
|
return image;
|
|
1139
1143
|
}
|
|
1140
1144
|
|
|
1141
1145
|
// src/functions/canvas/video-utility.ts
|
|
1142
|
-
function addVideo(alias, videoUrl) {
|
|
1146
|
+
function addVideo(alias, videoUrl, options) {
|
|
1143
1147
|
if (!videoUrl) {
|
|
1144
1148
|
if (Assets.resolver.hasKey(alias)) {
|
|
1145
1149
|
videoUrl = alias;
|
|
@@ -1147,8 +1151,7 @@ function addVideo(alias, videoUrl) {
|
|
|
1147
1151
|
throw new Error(`The video ${alias} does not exist in the cache.`);
|
|
1148
1152
|
}
|
|
1149
1153
|
}
|
|
1150
|
-
let video = new VideoSprite();
|
|
1151
|
-
video.textureAlias = videoUrl;
|
|
1154
|
+
let video = new VideoSprite(options, videoUrl);
|
|
1152
1155
|
canvas.add(alias, video);
|
|
1153
1156
|
return video;
|
|
1154
1157
|
}
|
|
@@ -1171,9 +1174,17 @@ async function loadVideo(canvasVideos) {
|
|
|
1171
1174
|
});
|
|
1172
1175
|
});
|
|
1173
1176
|
}
|
|
1174
|
-
async function showVideo(alias, videoUrl) {
|
|
1175
|
-
|
|
1177
|
+
async function showVideo(alias, videoUrl, options) {
|
|
1178
|
+
if (!videoUrl) {
|
|
1179
|
+
if (Assets.resolver.hasKey(alias)) {
|
|
1180
|
+
videoUrl = alias;
|
|
1181
|
+
} else {
|
|
1182
|
+
throw new Error(`The video ${alias} does not exist in the cache.`);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
let video = new VideoSprite(options, videoUrl);
|
|
1176
1186
|
await video.load();
|
|
1187
|
+
canvas.add(alias, video);
|
|
1177
1188
|
return video;
|
|
1178
1189
|
}
|
|
1179
1190
|
|
|
@@ -1594,14 +1605,15 @@ function pushOut(alias, props = { direction: "right" }, priority) {
|
|
|
1594
1605
|
}
|
|
1595
1606
|
|
|
1596
1607
|
// src/functions/canvas/image-container-utility.ts
|
|
1597
|
-
function addImageCointainer(alias, imageUrls) {
|
|
1598
|
-
let container = new ImageContainer(
|
|
1608
|
+
function addImageCointainer(alias, imageUrls, options) {
|
|
1609
|
+
let container = new ImageContainer(options, imageUrls);
|
|
1599
1610
|
canvas.add(alias, container);
|
|
1600
1611
|
return container;
|
|
1601
1612
|
}
|
|
1602
|
-
async function showImageContainer(alias, imageUrls) {
|
|
1603
|
-
let container =
|
|
1613
|
+
async function showImageContainer(alias, imageUrls, options) {
|
|
1614
|
+
let container = new ImageContainer(options, imageUrls);
|
|
1604
1615
|
await container.load();
|
|
1616
|
+
canvas.add(alias, container);
|
|
1605
1617
|
return container;
|
|
1606
1618
|
}
|
|
1607
1619
|
|
|
@@ -1782,27 +1794,30 @@ function getMemorySprite(element) {
|
|
|
1782
1794
|
};
|
|
1783
1795
|
}
|
|
1784
1796
|
async function setMemorySprite(element, memory, options) {
|
|
1797
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
1785
1798
|
await setMemoryContainer(element, memory);
|
|
1786
|
-
if (
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
element.texture = texture;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
if ("textureData" in memory) {
|
|
1793
|
-
if (memory.textureData.alias) {
|
|
1794
|
-
element.textureAlias = memory.textureData.alias;
|
|
1795
|
-
}
|
|
1796
|
-
if (memory.textureData.url !== "EMPTY") {
|
|
1797
|
-
let textureUrl = memory.textureData.url;
|
|
1798
|
-
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
1799
|
-
textureUrl = memory.textureData.alias;
|
|
1800
|
-
}
|
|
1801
|
-
let texture = await getTexture(textureUrl);
|
|
1799
|
+
if (!ignoreTexture) {
|
|
1800
|
+
if ("textureImage" in memory && memory.textureImage && memory.textureImage.image) {
|
|
1801
|
+
let texture = await getTexture(memory.textureImage.image);
|
|
1802
1802
|
if (texture) {
|
|
1803
1803
|
element.texture = texture;
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
|
+
if ("textureData" in memory) {
|
|
1807
|
+
if (memory.textureData.alias) {
|
|
1808
|
+
element.textureAlias = memory.textureData.alias;
|
|
1809
|
+
}
|
|
1810
|
+
if (memory.textureData.url !== "EMPTY") {
|
|
1811
|
+
let textureUrl = memory.textureData.url;
|
|
1812
|
+
if (memory.textureData.alias && Assets.resolver.hasKey(memory.textureData.alias)) {
|
|
1813
|
+
textureUrl = memory.textureData.alias;
|
|
1814
|
+
}
|
|
1815
|
+
let texture = await getTexture(textureUrl);
|
|
1816
|
+
if (texture) {
|
|
1817
|
+
element.texture = texture;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1806
1821
|
}
|
|
1807
1822
|
let half = options?.half;
|
|
1808
1823
|
if (half) {
|
|
@@ -2115,11 +2130,11 @@ var CanvasManager = class {
|
|
|
2115
2130
|
"height" in oldAlias && delete oldAlias.height;
|
|
2116
2131
|
"width" in oldAlias && delete oldAlias.width;
|
|
2117
2132
|
if (newAlias instanceof VideoSprite) {
|
|
2118
|
-
await setMemoryVideoSprite(newAlias, oldAlias);
|
|
2133
|
+
await setMemoryVideoSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
2119
2134
|
} else if (newAlias instanceof ImageSprite) {
|
|
2120
|
-
await setMemoryImageSprite(newAlias, oldAlias);
|
|
2135
|
+
await setMemoryImageSprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
2121
2136
|
} else if (newAlias instanceof Sprite2) {
|
|
2122
|
-
await setMemorySprite(newAlias, oldAlias);
|
|
2137
|
+
await setMemorySprite(newAlias, oldAlias, { ignoreTexture: true });
|
|
2123
2138
|
} else if (newAlias instanceof Text2) {
|
|
2124
2139
|
await setMemoryText(newAlias, oldAlias);
|
|
2125
2140
|
} else if (newAlias instanceof ImageContainer) {
|
|
@@ -3592,16 +3607,25 @@ var NarrationManager = class {
|
|
|
3592
3607
|
return this.alreadyCurrentStepMadeChoicesObj?.find((choice) => choice.choiceIndex === index)?.madeTimes || 0;
|
|
3593
3608
|
}
|
|
3594
3609
|
/* Run Methods */
|
|
3610
|
+
getCanGoNext(options) {
|
|
3611
|
+
let showWarn = options?.showWarn || false;
|
|
3612
|
+
let choiceMenuOptions = this.choiceMenuOptions;
|
|
3613
|
+
if (choiceMenuOptions && choiceMenuOptions.length > 0) {
|
|
3614
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
3615
|
+
return false;
|
|
3616
|
+
}
|
|
3617
|
+
if (this.isRequiredInput) {
|
|
3618
|
+
showWarn && console.warn("[Pixi\u2019VN] The player must enter a value");
|
|
3619
|
+
return false;
|
|
3620
|
+
}
|
|
3621
|
+
return true;
|
|
3622
|
+
}
|
|
3595
3623
|
/**
|
|
3596
3624
|
* Return if can go to the next step.
|
|
3597
3625
|
* @returns True if can go to the next step.
|
|
3598
3626
|
*/
|
|
3599
3627
|
get canGoNext() {
|
|
3600
|
-
|
|
3601
|
-
if (options && options.length > 0) {
|
|
3602
|
-
return false;
|
|
3603
|
-
}
|
|
3604
|
-
return true;
|
|
3628
|
+
return this.getCanGoNext();
|
|
3605
3629
|
}
|
|
3606
3630
|
/**
|
|
3607
3631
|
* Execute the next step and add it to the history.
|
|
@@ -3628,8 +3652,7 @@ var NarrationManager = class {
|
|
|
3628
3652
|
* ```
|
|
3629
3653
|
*/
|
|
3630
3654
|
async goNext(props, choiseMade) {
|
|
3631
|
-
if (!this.
|
|
3632
|
-
console.warn("[Pixi\u2019VN] The player must make a choice");
|
|
3655
|
+
if (!this.getCanGoNext({ showWarn: true })) {
|
|
3633
3656
|
return;
|
|
3634
3657
|
}
|
|
3635
3658
|
if (this.currentLabel && this.currentLabel.onStepEnd) {
|
|
@@ -3999,6 +4022,7 @@ var NarrationManager = class {
|
|
|
3999
4022
|
let glueDialogue = storage.getVariable(storage.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
4000
4023
|
if (glueDialogue) {
|
|
4001
4024
|
dialogue.text = `${glueDialogue.text}${dialogue.text}`;
|
|
4025
|
+
dialogue.character = dialogue.character || glueDialogue.character;
|
|
4002
4026
|
}
|
|
4003
4027
|
this.dialogGlue = false;
|
|
4004
4028
|
}
|
|
@@ -4740,6 +4764,24 @@ FadeAlphaTicker = __decorateClass([
|
|
|
4740
4764
|
], FadeAlphaTicker);
|
|
4741
4765
|
|
|
4742
4766
|
// src/classes/ticker/MoveTicker.ts
|
|
4767
|
+
function calculateDestination(args, element) {
|
|
4768
|
+
let destination = createExportableElement(args.destination);
|
|
4769
|
+
if (destination.type === "align") {
|
|
4770
|
+
let anchorx = void 0;
|
|
4771
|
+
let anchory = void 0;
|
|
4772
|
+
if (element instanceof Sprite) {
|
|
4773
|
+
anchorx = element.anchor.x;
|
|
4774
|
+
anchory = element.anchor.y;
|
|
4775
|
+
}
|
|
4776
|
+
destination.x = calculateAlign("width", destination.x, element.width, element.pivot.x, anchorx);
|
|
4777
|
+
destination.y = calculateAlign("height", destination.y, element.height, element.pivot.y, anchory);
|
|
4778
|
+
}
|
|
4779
|
+
if (destination.type === "percentage") {
|
|
4780
|
+
destination.x = calculatePercentagePosition("width", destination.x);
|
|
4781
|
+
destination.y = calculatePercentagePosition("height", destination.y);
|
|
4782
|
+
}
|
|
4783
|
+
return destination;
|
|
4784
|
+
}
|
|
4743
4785
|
var MoveTicker = class extends TickerBase {
|
|
4744
4786
|
fn(ticker, args, aliases, tickerId) {
|
|
4745
4787
|
let xSpeed = 10;
|
|
@@ -4753,7 +4795,6 @@ var MoveTicker = class extends TickerBase {
|
|
|
4753
4795
|
ySpeed = this.speedConvert(args.speed.y);
|
|
4754
4796
|
}
|
|
4755
4797
|
}
|
|
4756
|
-
let destination = args.destination;
|
|
4757
4798
|
let aliasToRemoveAfter2 = args.aliasToRemoveAfter || [];
|
|
4758
4799
|
if (typeof aliasToRemoveAfter2 === "string") {
|
|
4759
4800
|
aliasToRemoveAfter2 = [aliasToRemoveAfter2];
|
|
@@ -4776,6 +4817,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
4776
4817
|
}).forEach((alias) => {
|
|
4777
4818
|
let element = canvas.find(alias);
|
|
4778
4819
|
if (element && element instanceof Container) {
|
|
4820
|
+
let destination = calculateDestination(args, element);
|
|
4779
4821
|
let xDistance = destination.x - element.x > 0 ? 1 : -1;
|
|
4780
4822
|
if (xDistance != 0) {
|
|
4781
4823
|
element.x += xDistance * xSpeed * ticker.deltaTime;
|
|
@@ -4807,7 +4849,7 @@ var MoveTicker = class extends TickerBase {
|
|
|
4807
4849
|
alias.forEach((alias2) => {
|
|
4808
4850
|
let element = canvas.find(alias2);
|
|
4809
4851
|
if (element) {
|
|
4810
|
-
let destination = args
|
|
4852
|
+
let destination = calculateDestination(args, element);
|
|
4811
4853
|
element.x = destination.x;
|
|
4812
4854
|
element.y = destination.y;
|
|
4813
4855
|
if (args.isPushInOut && element.children.length > 0) {
|
|
@@ -5510,7 +5552,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
5510
5552
|
character: juliette,
|
|
5511
5553
|
text: `Here's what's going to happen:
|
|
5512
5554
|
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
|
|
5513
|
-
- ${flowerTopName} will move to { x:
|
|
5555
|
+
- ${flowerTopName} will move to { x: 0.5, y: 0.5, type: "align" } with a speed of 18.
|
|
5514
5556
|
- ${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.
|
|
5515
5557
|
- ${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.`
|
|
5516
5558
|
};
|
|
@@ -5519,7 +5561,7 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
5519
5561
|
speed: 24
|
|
5520
5562
|
}));
|
|
5521
5563
|
canvas.addTicker("flowerTop", new MoveTicker({
|
|
5522
|
-
destination: { x:
|
|
5564
|
+
destination: { x: 0.5, y: 0.5, type: "align" },
|
|
5523
5565
|
speed: 18
|
|
5524
5566
|
}));
|
|
5525
5567
|
canvas.addTickersSteps("helmlok", [
|
|
@@ -6113,6 +6155,142 @@ var pixivnTestStartLabel2 = newLabel(
|
|
|
6113
6155
|
]
|
|
6114
6156
|
);
|
|
6115
6157
|
|
|
6158
|
+
// src/classes/canvas/AdditionalPositions.ts
|
|
6159
|
+
var AdditionalPositionsExtension2 = class extends Container {
|
|
6160
|
+
/**
|
|
6161
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
6162
|
+
* For example:
|
|
6163
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
6164
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
6165
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
6166
|
+
*
|
|
6167
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
6168
|
+
*/
|
|
6169
|
+
set align(_value) {
|
|
6170
|
+
throw new Error("Method not implemented.");
|
|
6171
|
+
}
|
|
6172
|
+
/**
|
|
6173
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
6174
|
+
* For example:
|
|
6175
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
6176
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
6177
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
6178
|
+
*
|
|
6179
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
6180
|
+
*/
|
|
6181
|
+
set xAlign(_value) {
|
|
6182
|
+
throw new Error("Method not implemented.");
|
|
6183
|
+
}
|
|
6184
|
+
/**
|
|
6185
|
+
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
6186
|
+
* For example:
|
|
6187
|
+
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
6188
|
+
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
6189
|
+
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
6190
|
+
*
|
|
6191
|
+
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
6192
|
+
*/
|
|
6193
|
+
set yAlign(_value) {
|
|
6194
|
+
throw new Error("Method not implemented.");
|
|
6195
|
+
}
|
|
6196
|
+
/**
|
|
6197
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
6198
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
6199
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
6200
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
6201
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
6202
|
+
*
|
|
6203
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
6204
|
+
*/
|
|
6205
|
+
set percentagePosition(_value) {
|
|
6206
|
+
throw new Error("Method not implemented.");
|
|
6207
|
+
}
|
|
6208
|
+
/**
|
|
6209
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
6210
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
6211
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
6212
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
6213
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
6214
|
+
*
|
|
6215
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
6216
|
+
*/
|
|
6217
|
+
set xPercentagePosition(_value) {
|
|
6218
|
+
throw new Error("Method not implemented.");
|
|
6219
|
+
}
|
|
6220
|
+
/**
|
|
6221
|
+
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
6222
|
+
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
6223
|
+
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
6224
|
+
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
6225
|
+
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
6226
|
+
*
|
|
6227
|
+
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
6228
|
+
*/
|
|
6229
|
+
set yPercentagePosition(_value) {
|
|
6230
|
+
throw new Error("Method not implemented.");
|
|
6231
|
+
}
|
|
6232
|
+
};
|
|
6233
|
+
function analizePositionsExtensionProps(props) {
|
|
6234
|
+
if (!props) {
|
|
6235
|
+
return props;
|
|
6236
|
+
}
|
|
6237
|
+
if (typeof props.align !== "number") {
|
|
6238
|
+
if (props.xAlign != void 0) {
|
|
6239
|
+
if (props.align === void 0) {
|
|
6240
|
+
props.align = { x: props.xAlign };
|
|
6241
|
+
delete props.xAlign;
|
|
6242
|
+
} else {
|
|
6243
|
+
props.align.x = props.xAlign;
|
|
6244
|
+
delete props.xAlign;
|
|
6245
|
+
}
|
|
6246
|
+
}
|
|
6247
|
+
if (props.yAlign != void 0) {
|
|
6248
|
+
if (props.align === void 0) {
|
|
6249
|
+
props.align = { y: props.yAlign };
|
|
6250
|
+
delete props.yAlign;
|
|
6251
|
+
} else {
|
|
6252
|
+
props.align.y = props.yAlign;
|
|
6253
|
+
delete props.yAlign;
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
if (typeof props.percentagePosition !== "number") {
|
|
6258
|
+
if (props.xPercentagePosition != void 0) {
|
|
6259
|
+
if (props.percentagePosition === void 0) {
|
|
6260
|
+
props.percentagePosition = { x: props.xPercentagePosition };
|
|
6261
|
+
delete props.xPercentagePosition;
|
|
6262
|
+
} else {
|
|
6263
|
+
props.percentagePosition.x = props.xPercentagePosition;
|
|
6264
|
+
delete props.xPercentagePosition;
|
|
6265
|
+
}
|
|
6266
|
+
}
|
|
6267
|
+
if (props.yPercentagePosition != void 0) {
|
|
6268
|
+
if (props.percentagePosition === void 0) {
|
|
6269
|
+
props.percentagePosition = { y: props.yPercentagePosition };
|
|
6270
|
+
delete props.yPercentagePosition;
|
|
6271
|
+
} else {
|
|
6272
|
+
props.percentagePosition.y = props.yPercentagePosition;
|
|
6273
|
+
delete props.yPercentagePosition;
|
|
6274
|
+
}
|
|
6275
|
+
}
|
|
6276
|
+
}
|
|
6277
|
+
return props;
|
|
6278
|
+
}
|
|
6279
|
+
function calculateAlign(type, align, width, pivot, anchor = 0) {
|
|
6280
|
+
if (type === "width") {
|
|
6281
|
+
return align * (canvas.screen.width - width) + pivot + anchor * width;
|
|
6282
|
+
} else {
|
|
6283
|
+
return align * (canvas.screen.height - width) + pivot + anchor * width;
|
|
6284
|
+
}
|
|
6285
|
+
}
|
|
6286
|
+
function calculatePercentagePosition(type, percentage) {
|
|
6287
|
+
if (type === "width") {
|
|
6288
|
+
return percentage * canvas.screen.width;
|
|
6289
|
+
} else {
|
|
6290
|
+
return percentage * canvas.screen.height;
|
|
6291
|
+
}
|
|
6292
|
+
}
|
|
6293
|
+
|
|
6116
6294
|
// src/classes/canvas/ImageSprite.ts
|
|
6117
6295
|
var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
6118
6296
|
pixivnId = CANVAS_IMAGE_ID;
|
|
@@ -6239,17 +6417,17 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
6239
6417
|
reloadPosition() {
|
|
6240
6418
|
if (this._align) {
|
|
6241
6419
|
if (this._align.x !== void 0) {
|
|
6242
|
-
super.x = this._align.x
|
|
6420
|
+
super.x = calculateAlign("width", this._align.x, this.width, this.pivot.x, this.anchor.x);
|
|
6243
6421
|
}
|
|
6244
6422
|
if (this._align.y !== void 0) {
|
|
6245
|
-
super.y = this._align.y
|
|
6423
|
+
super.y = calculateAlign("height", this._align.y, this.height, this.pivot.y, this.anchor.y);
|
|
6246
6424
|
}
|
|
6247
6425
|
} else if (this._percentagePosition) {
|
|
6248
6426
|
if (this._percentagePosition.x !== void 0) {
|
|
6249
|
-
super.x = this._percentagePosition.x
|
|
6427
|
+
super.x = calculatePercentagePosition("width", this._percentagePosition.x);
|
|
6250
6428
|
}
|
|
6251
6429
|
if (this._percentagePosition.y !== void 0) {
|
|
6252
|
-
super.y = this._percentagePosition.y
|
|
6430
|
+
super.y = calculatePercentagePosition("height", this._percentagePosition.y);
|
|
6253
6431
|
}
|
|
6254
6432
|
}
|
|
6255
6433
|
}
|
|
@@ -6278,17 +6456,21 @@ var ImageSprite = class _ImageSprite extends Sprite2 {
|
|
|
6278
6456
|
super.y = value;
|
|
6279
6457
|
}
|
|
6280
6458
|
};
|
|
6281
|
-
async function setMemoryImageSprite(element, memory) {
|
|
6459
|
+
async function setMemoryImageSprite(element, memory, options) {
|
|
6460
|
+
let ignoreTexture = options?.ignoreTexture || false;
|
|
6282
6461
|
memory = analizePositionsExtensionProps(memory);
|
|
6283
6462
|
return await setMemorySprite(element, memory, {
|
|
6284
6463
|
half: async () => {
|
|
6285
6464
|
"align" in memory && memory.align !== void 0 && (element.align = memory.align);
|
|
6286
6465
|
"percentagePosition" in memory && memory.percentagePosition !== void 0 && (element.percentagePosition = memory.percentagePosition);
|
|
6287
|
-
|
|
6466
|
+
if (!ignoreTexture) {
|
|
6467
|
+
"imageLink" in memory && memory.imageLink !== void 0 && (element.textureAlias = memory.imageLink);
|
|
6468
|
+
}
|
|
6288
6469
|
if ("loadIsStarted" in memory && memory.loadIsStarted) {
|
|
6289
6470
|
await element.load();
|
|
6290
6471
|
}
|
|
6291
|
-
}
|
|
6472
|
+
},
|
|
6473
|
+
ignoreTexture: options?.ignoreTexture
|
|
6292
6474
|
});
|
|
6293
6475
|
}
|
|
6294
6476
|
|
|
@@ -6399,8 +6581,8 @@ var VideoSprite = class _VideoSprite extends ImageSprite {
|
|
|
6399
6581
|
}
|
|
6400
6582
|
}
|
|
6401
6583
|
};
|
|
6402
|
-
async function setMemoryVideoSprite(element, memory) {
|
|
6403
|
-
await setMemoryImageSprite(element, memory);
|
|
6584
|
+
async function setMemoryVideoSprite(element, memory, options) {
|
|
6585
|
+
await setMemoryImageSprite(element, memory, { ignoreTexture: options?.ignoreTexture });
|
|
6404
6586
|
"loop" in memory && memory.loop !== void 0 && (element.loop = memory.loop);
|
|
6405
6587
|
"currentTime" in memory && memory.currentTime !== void 0 && (element.currentTime = memory.currentTime);
|
|
6406
6588
|
"paused" in memory && memory.paused !== void 0 && (element.paused = memory.paused);
|
|
@@ -6685,6 +6867,10 @@ export {
|
|
|
6685
6867
|
getTexture,
|
|
6686
6868
|
getTextStyle,
|
|
6687
6869
|
checkIfTextureNotIsEmpty,
|
|
6870
|
+
AdditionalPositionsExtension2 as AdditionalPositionsExtension,
|
|
6871
|
+
analizePositionsExtensionProps,
|
|
6872
|
+
calculateAlign,
|
|
6873
|
+
calculatePercentagePosition,
|
|
6688
6874
|
registeredCanvasElement,
|
|
6689
6875
|
canvasElementDecorator,
|
|
6690
6876
|
getCanvasElementTypeById,
|