rename renderFrame() so it's more consistent with other drawing functions
This commit is contained in:
parent
d5b7e174a1
commit
22f0d4a008
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue