class Loader{ constructor(dom){ this.dim = createVector($(dom).width(), $(dom).height()); this.c = createGraphics(this.dim.x, this.dim.y); this.c.parent(dom); this.radius = min(this.dim.x, this.dim.y) * 0.4; this.center = createVector(this.dim.x / 2, this.dim.y / 2); $(dom).find('canvas').show(); this.angle = 0; } update(){ this.angle += PI / 10; } display(){ let c = this.c; c.clear(); c.noFill(); c.stroke(0); c.strokeWeight(5); c.arc(this.center.x, this.center.y, this.radius * 2, this.radius * 2, this.angle, this.angle + PI + HALF_PI); } destroy(){ this.c.remove(); } }