@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.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, Texture as Texture3 } from "pixi.js";
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(options = Texture3.EMPTY) {
591
- super(options);
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 in the canvas.
614
- * @returns a promise that resolves when the image is loaded.
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.2";
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,