@drincs/pixi-vn 0.4.2 → 0.4.4
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/index.d.mts +6 -12
- package/dist/index.d.ts +6 -12
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -379,7 +379,7 @@ function setMemoryContainer(element, memory) {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
// src/classes/canvas/CanvasImage.ts
|
|
382
|
-
import { Sprite as Sprite2
|
|
382
|
+
import { Sprite as Sprite2 } from "pixi.js";
|
|
383
383
|
|
|
384
384
|
// src/functions/TextureUtility.ts
|
|
385
385
|
import { Assets, Texture } from "pixi.js";
|
|
@@ -587,12 +587,9 @@ function setMemorySprite(element, memory) {
|
|
|
587
587
|
|
|
588
588
|
// src/classes/canvas/CanvasImage.ts
|
|
589
589
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
590
|
-
constructor(
|
|
591
|
-
super(
|
|
590
|
+
constructor() {
|
|
591
|
+
super(...arguments);
|
|
592
592
|
this.imageLink = "";
|
|
593
|
-
if (options && typeof options === "object" && "textureImage" in options && options.textureImage) {
|
|
594
|
-
this.imageLink = options.textureImage;
|
|
595
|
-
}
|
|
596
593
|
}
|
|
597
594
|
get memory() {
|
|
598
595
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
@@ -610,11 +607,15 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
610
607
|
return mySprite;
|
|
611
608
|
}
|
|
612
609
|
/**
|
|
613
|
-
* Load the image
|
|
614
|
-
* @
|
|
610
|
+
* Load the image from the link and set the texture of the sprite.
|
|
611
|
+
* @param image The link of the image. If it is not set, it will use the imageLink property.
|
|
612
|
+
* @returns A promise that resolves when the image is loaded.
|
|
615
613
|
*/
|
|
616
|
-
load() {
|
|
614
|
+
load(image) {
|
|
617
615
|
return __async(this, null, function* () {
|
|
616
|
+
if (!image) {
|
|
617
|
+
image = this.imageLink;
|
|
618
|
+
}
|
|
618
619
|
return getTexture(this.imageLink).then((texture) => {
|
|
619
620
|
if (texture) {
|
|
620
621
|
this.texture = texture;
|
|
@@ -1040,7 +1041,7 @@ function showImageWithDissolveTransition(tag, imageUrl, speed, priority) {
|
|
|
1040
1041
|
}
|
|
1041
1042
|
|
|
1042
1043
|
// src/constants.ts
|
|
1043
|
-
var PIXIVN_VERSION = "0.4.
|
|
1044
|
+
var PIXIVN_VERSION = "0.4.4";
|
|
1044
1045
|
|
|
1045
1046
|
// src/functions/SavesUtility.ts
|
|
1046
1047
|
function getSaveData() {
|
|
@@ -1288,7 +1289,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1288
1289
|
_GameWindowManager.canvasWidth = width;
|
|
1289
1290
|
_GameWindowManager.canvasHeight = height;
|
|
1290
1291
|
_GameWindowManager._app = new Application();
|
|
1291
|
-
return _GameWindowManager.app.init(__spreadValues({
|
|
1292
|
+
return yield _GameWindowManager.app.init(__spreadValues({
|
|
1292
1293
|
resolution: window.devicePixelRatio || 1,
|
|
1293
1294
|
autoDensity: true,
|
|
1294
1295
|
width,
|