@drincs/pixi-vn 0.4.2 → 0.4.3

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 CHANGED
@@ -544,12 +544,6 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
544
544
  static from(source: Texture | TextureSourceLike, skipCache?: boolean): CanvasSprite<any>;
545
545
  }
546
546
 
547
- interface CanvasImageOptions extends SpriteOptions {
548
- /**
549
- * The image link to load in the canvas.
550
- */
551
- textureImage?: string;
552
- }
553
547
  /**
554
548
  * This class is a extension of the CanvasSprite class, it has the same properties and methods,
555
549
  * but it has some features that make texture management easier.
@@ -557,11 +551,11 @@ interface CanvasImageOptions extends SpriteOptions {
557
551
  * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
558
552
  * @example
559
553
  * ```typescript
560
- * let alien = new CanvasImage({ textureImage: 'https://pixijs.com/assets/eggHead.png' })
554
+ * let alien = new CanvasImage()
561
555
  * alien.anchor.set(0.5);
562
556
  * alien.x = 100
563
557
  * alien.y = 100
564
- * await alien.load()
558
+ * await alien.load('https://pixijs.com/assets/eggHead.png')
565
559
  * GameWindowManager.addCanvasElement("alien", alien)
566
560
  * ```
567
561
  * @example
@@ -574,16 +568,16 @@ interface CanvasImageOptions extends SpriteOptions {
574
568
  * ```
575
569
  */
576
570
  declare class CanvasImage extends CanvasSprite<ICanvasImageMemory> {
577
- constructor(options?: CanvasImageOptions | Texture);
578
571
  get memory(): ICanvasImageMemory;
579
572
  set memory(memory: ICanvasImageMemory);
580
573
  imageLink: string;
581
574
  static from(source: Texture | TextureSourceLike, skipCache?: boolean): CanvasImage;
582
575
  /**
583
- * Load the image in the canvas.
584
- * @returns a promise that resolves when the image is loaded.
576
+ * Load the image from the link and set the texture of the sprite.
577
+ * @param image The link of the image. If it is not set, it will use the imageLink property.
578
+ * @returns A promise that resolves when the image is loaded.
585
579
  */
586
- load(): Promise<void>;
580
+ load(image?: string): Promise<void>;
587
581
  }
588
582
 
589
583
  /**
package/dist/index.d.ts CHANGED
@@ -544,12 +544,6 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
544
544
  static from(source: Texture | TextureSourceLike, skipCache?: boolean): CanvasSprite<any>;
545
545
  }
546
546
 
547
- interface CanvasImageOptions extends SpriteOptions {
548
- /**
549
- * The image link to load in the canvas.
550
- */
551
- textureImage?: string;
552
- }
553
547
  /**
554
548
  * This class is a extension of the CanvasSprite class, it has the same properties and methods,
555
549
  * but it has some features that make texture management easier.
@@ -557,11 +551,11 @@ interface CanvasImageOptions extends SpriteOptions {
557
551
  * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
558
552
  * @example
559
553
  * ```typescript
560
- * let alien = new CanvasImage({ textureImage: 'https://pixijs.com/assets/eggHead.png' })
554
+ * let alien = new CanvasImage()
561
555
  * alien.anchor.set(0.5);
562
556
  * alien.x = 100
563
557
  * alien.y = 100
564
- * await alien.load()
558
+ * await alien.load('https://pixijs.com/assets/eggHead.png')
565
559
  * GameWindowManager.addCanvasElement("alien", alien)
566
560
  * ```
567
561
  * @example
@@ -574,16 +568,16 @@ interface CanvasImageOptions extends SpriteOptions {
574
568
  * ```
575
569
  */
576
570
  declare class CanvasImage extends CanvasSprite<ICanvasImageMemory> {
577
- constructor(options?: CanvasImageOptions | Texture);
578
571
  get memory(): ICanvasImageMemory;
579
572
  set memory(memory: ICanvasImageMemory);
580
573
  imageLink: string;
581
574
  static from(source: Texture | TextureSourceLike, skipCache?: boolean): CanvasImage;
582
575
  /**
583
- * Load the image in the canvas.
584
- * @returns a promise that resolves when the image is loaded.
576
+ * Load the image from the link and set the texture of the sprite.
577
+ * @param image The link of the image. If it is not set, it will use the imageLink property.
578
+ * @returns A promise that resolves when the image is loaded.
585
579
  */
586
- load(): Promise<void>;
580
+ load(image?: string): Promise<void>;
587
581
  }
588
582
 
589
583
  /**
package/dist/index.js CHANGED
@@ -665,12 +665,9 @@ function setMemorySprite(element, memory) {
665
665
 
666
666
  // src/classes/canvas/CanvasImage.ts
667
667
  var CanvasImage = class _CanvasImage extends CanvasSprite {
668
- constructor(options = import_pixi5.Texture.EMPTY) {
669
- super(options);
668
+ constructor() {
669
+ super(...arguments);
670
670
  this.imageLink = "";
671
- if (options && typeof options === "object" && "textureImage" in options && options.textureImage) {
672
- this.imageLink = options.textureImage;
673
- }
674
671
  }
675
672
  get memory() {
676
673
  return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
@@ -688,11 +685,15 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
688
685
  return mySprite;
689
686
  }
690
687
  /**
691
- * Load the image in the canvas.
692
- * @returns a promise that resolves when the image is loaded.
688
+ * Load the image from the link and set the texture of the sprite.
689
+ * @param image The link of the image. If it is not set, it will use the imageLink property.
690
+ * @returns A promise that resolves when the image is loaded.
693
691
  */
694
- load() {
692
+ load(image) {
695
693
  return __async(this, null, function* () {
694
+ if (!image) {
695
+ image = this.imageLink;
696
+ }
696
697
  return getTexture(this.imageLink).then((texture) => {
697
698
  if (texture) {
698
699
  this.texture = texture;
@@ -1118,7 +1119,7 @@ function showImageWithDissolveTransition(tag, imageUrl, speed, priority) {
1118
1119
  }
1119
1120
 
1120
1121
  // src/constants.ts
1121
- var PIXIVN_VERSION = "0.4.2";
1122
+ var PIXIVN_VERSION = "0.4.3";
1122
1123
 
1123
1124
  // src/functions/SavesUtility.ts
1124
1125
  function getSaveData() {