rename renderFrame() so it's more consistent with other drawing functions

This commit is contained in:
Lily Tsuru 2024-07-10 07:16:33 -04:00
parent d5b7e174a1
commit 22f0d4a008

View file

@ -37,7 +37,7 @@ class AgentAnimationState {
} }
nextFrame() { nextFrame() {
this.char.renderFrame(this.anim.frameInfo[this.frameIndex++]); this.char.drawAnimationFrame(this.anim.frameInfo[this.frameIndex++]);
if (this.frameIndex >= this.anim.frameInfo.length) { if (this.frameIndex >= this.anim.frameInfo.length) {
this.finishCallback(); this.finishCallback();
@ -196,7 +196,7 @@ export class Agent {
}; };
} }
renderFrame(frame: AcsAnimationFrameInfo) { drawAnimationFrame(frame: AcsAnimationFrameInfo) {
this.ctx.clearRect(0, 0, this.cnv.width, this.cnv.height); this.ctx.clearRect(0, 0, this.cnv.width, this.cnv.height);
for (const mimg of frame.images) { for (const mimg of frame.images) {
this.drawImage(this.data.images[mimg.imageIndex], mimg.xOffset, mimg.yOffset); this.drawImage(this.data.images[mimg.imageIndex], mimg.xOffset, mimg.yOffset);