MCPcopy Create free account
hub / github.com/bwasti/mebm / render

Method render

script.js:480–493  ·  view source on GitHub ↗
(ctx_out, ref_time)

Source from the content-addressed store, hash-verified

478 }
479
480 render(ctx_out, ref_time) {
481 if (!this.ready) {
482 return;
483 }
484 let f = this.getFrame(ref_time);
485 if (f) {
486 let scale = f[2];
487 let x = f[0] + this.canvas.width / 2 - this.width / 2;
488 let y = f[1] + this.canvas.height / 2 - this.height / 2;
489 this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
490 this.ctx.drawImage(this.img, 0, 0, this.width, this.height, x, y, scale * this.width, scale * this.height);
491 this.drawScaled(this.ctx, ctx_out);
492 }
493 }
494}
495
496class TextLayer extends MoveableLayer {

Callers

nothing calls this directly

Calls 2

getFrameMethod · 0.80
drawScaledMethod · 0.80

Tested by

no test coverage detected