registerPaint(class { constructor() { this.otherImage = new PaintRC2D(100, 100); this.otherImage /\* draw commands go here */ } paint(ctx, ...) { ctx.drawImage(this.otherImage, 0, 100); ctx.drawImage(this.otherImage, 0, 200); } });