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
image.src=path;// Set the image source to the spritesheet image path
71
+
}
72
+
62
73
image.onerror=(err)=>{
63
-
console.error(`Failed to load spritesheet image <${data.meta.image}>:`,err);
74
+
console.error(`Failed to load spritesheet image <${spritesheetData.meta.image}>:`,err);
64
75
this.ready=false;
65
76
};
66
-
this.spritesheetData=data;// Store the parsed spritesheet data
67
-
this.frames=Object.fromEntries(Object.keys(data.meta.animations).map(animationName=>[animationName,Array(data.meta.animations[animationName].frames.length).fill(null)]));// Initialize frames for each animation
77
+
this.spritesheetData=spritesheetData;// Store the parsed spritesheet data
78
+
this.frames=Object.fromEntries(Object.keys(spritesheetData.meta.animations).map(animationName=>[animationName,Array(spritesheetData.meta.animations[animationName].frames.length).fill(null)]));// Initialize frames for each animation
68
79
awaitnewPromise<void>((resolve,reject)=>{
69
80
image.onload=()=>{
70
81
this.loadedSheet=image;
71
82
resolve();
72
83
};
73
84
image.onerror=(err)=>{
74
-
console.error(`Failed to load spritesheet image <${data.meta.image}>:`,err);
85
+
console.error(`Failed to load spritesheet image <${spritesheetData.meta.image}>:`,err);
0 commit comments