UNPKG

2d-physics-engine

Version:

A lightweight, flexible 2D physics engine with ECS architecture, built with TypeScript

19 lines 578 B
import { Drawer } from './Drawer.component'; export class CircleDrawer extends Drawer { constructor(radius) { super(); Object.defineProperty(this, "radius", { enumerable: true, configurable: true, writable: true, value: radius }); } draw(canvasCtx, transform) { const { x, y } = transform.getPosition(); canvasCtx.beginPath(); canvasCtx.arc(x, y, this.radius, 0, Math.PI * 2, false); canvasCtx.stroke(); } } //# sourceMappingURL=CircleDrawer.component.js.map