You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {TexturePacker.PackableObject} image An object, such as an <code>Image</code> with <code>width</code> and <code>height</code> properties in pixels
513
513
* @returns {Promise<number>} Promise which resolves to the image index once the image has been added, or rejects if there was an error. The promise resolves to <code>-1</code> if the texture atlas is destoyed in the interim.
@@ -527,6 +527,7 @@ TextureAtlas.prototype._addImage = function (index, image) {
527
527
reject,
528
528
}),
529
529
);
530
+
onImageLoad?.();
530
531
531
532
this._imagesToAddQueue.sort(
532
533
({image: imageA},{image: imageB})=>
@@ -644,14 +645,13 @@ async function resolveImage(image, id) {
644
645
* @param {string} id An identifier to detect whether the image already exists in the atlas.
645
646
* @param {HTMLImageElement|HTMLCanvasElement|string|Resource|Promise|TextureAtlas.CreateImageCallback} image An image or canvas to add to the texture atlas,
646
647
* or a URL to an Image, or a Promise for an image, or a function that creates an image.
647
-
* @returns {Promise<number>} A Promise that resolves to the image region index. -1 is returned if resouces are in the process of being destroyed.
648
+
* @returns {Promise<number>} A Promise that resolves to the image region index. -1 is returned if resources are in the process of being destroyed.
0 commit comments