@drincs/pixi-vn 0.4.4 → 0.4.6

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
@@ -551,11 +551,12 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
551
551
  * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
552
552
  * @example
553
553
  * ```typescript
554
- * let alien = new CanvasImage()
555
- * alien.anchor.set(0.5);
556
- * alien.x = 100
557
- * alien.y = 100
558
- * await alien.load('https://pixijs.com/assets/eggHead.png')
554
+ * let alien = new CanvasImage({
555
+ * anchor: { x: 0.5, y: 0.5 },
556
+ * x: 100,
557
+ * y: 100,
558
+ * }, 'https://pixijs.com/assets/eggHead.png')
559
+ * await alien.load()
559
560
  * GameWindowManager.addCanvasElement("alien", alien)
560
561
  * ```
561
562
  * @example
@@ -568,6 +569,7 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
568
569
  * ```
569
570
  */
570
571
  declare class CanvasImage extends CanvasSprite<ICanvasImageMemory> {
572
+ constructor(options?: SpriteOptions | Texture | undefined, imageLink?: string);
571
573
  get memory(): ICanvasImageMemory;
572
574
  set memory(memory: ICanvasImageMemory);
573
575
  imageLink: string;
package/dist/index.d.ts CHANGED
@@ -551,11 +551,12 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
551
551
  * This class is used for functions like addImage, loadImages and showImageWithDissolveTransition.
552
552
  * @example
553
553
  * ```typescript
554
- * let alien = new CanvasImage()
555
- * alien.anchor.set(0.5);
556
- * alien.x = 100
557
- * alien.y = 100
558
- * await alien.load('https://pixijs.com/assets/eggHead.png')
554
+ * let alien = new CanvasImage({
555
+ * anchor: { x: 0.5, y: 0.5 },
556
+ * x: 100,
557
+ * y: 100,
558
+ * }, 'https://pixijs.com/assets/eggHead.png')
559
+ * await alien.load()
559
560
  * GameWindowManager.addCanvasElement("alien", alien)
560
561
  * ```
561
562
  * @example
@@ -568,6 +569,7 @@ declare class CanvasSprite<Memory extends SpriteOptions & ICanvasBaseMemory = IC
568
569
  * ```
569
570
  */
570
571
  declare class CanvasImage extends CanvasSprite<ICanvasImageMemory> {
572
+ constructor(options?: SpriteOptions | Texture | undefined, imageLink?: string);
571
573
  get memory(): ICanvasImageMemory;
572
574
  set memory(memory: ICanvasImageMemory);
573
575
  imageLink: string;
package/dist/index.js CHANGED
@@ -665,9 +665,12 @@ function setMemorySprite(element, memory) {
665
665
 
666
666
  // src/classes/canvas/CanvasImage.ts
667
667
  var CanvasImage = class _CanvasImage extends CanvasSprite {
668
- constructor() {
669
- super(...arguments);
668
+ constructor(options, imageLink) {
669
+ super(options);
670
670
  this.imageLink = "";
671
+ if (imageLink) {
672
+ this.imageLink = imageLink;
673
+ }
671
674
  }
672
675
  get memory() {
673
676
  return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
@@ -684,7 +687,7 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
684
687
  mySprite.texture = sprite.texture;
685
688
  return mySprite;
686
689
  }
687
- /**
690
+ /**
688
691
  * Load the image from the link and set the texture of the sprite.
689
692
  * @param image The link of the image. If it is not set, it will use the imageLink property.
690
693
  * @returns A promise that resolves when the image is loaded.
@@ -1119,7 +1122,7 @@ function showImageWithDissolveTransition(tag, imageUrl, speed, priority) {
1119
1122
  }
1120
1123
 
1121
1124
  // src/constants.ts
1122
- var PIXIVN_VERSION = "0.4.4";
1125
+ var PIXIVN_VERSION = "0.4.6";
1123
1126
 
1124
1127
  // src/functions/SavesUtility.ts
1125
1128
  function getSaveData() {
@@ -1367,7 +1370,7 @@ var _GameWindowManager = class _GameWindowManager {
1367
1370
  _GameWindowManager.canvasWidth = width;
1368
1371
  _GameWindowManager.canvasHeight = height;
1369
1372
  _GameWindowManager._app = new import_pixi10.Application();
1370
- return yield _GameWindowManager.app.init(__spreadValues({
1373
+ return _GameWindowManager.app.init(__spreadValues({
1371
1374
  resolution: window.devicePixelRatio || 1,
1372
1375
  autoDensity: true,
1373
1376
  width,