wgge 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,21 +60,36 @@ export default class CanvasRenderer extends RendererBase {
60
60
  *
61
61
  * @param {Vector2} center
62
62
  * @param {Number} radius
63
+ * @param {CanvasGradient|string} fill
64
+ * @param {any} stroke
63
65
  * @param {Number} startAngle
64
66
  * @param {Number} endAngle
65
67
  */
66
- drawArc(center, radius, startAngle, endAngle) {
68
+ drawArc(
69
+ center,
70
+ radius,
71
+ fill = 'white',
72
+ stroke = {width: 1, color: 'black'},
73
+ startAngle = 0,
74
+ endAngle = 2 * Math.PI
75
+ ) {
67
76
  this.context2d.beginPath();
77
+ this.context2d.fillStyle = (fill) ? fill : 'transparent';
78
+ this.context2d.strokeStyle = stroke ? stroke.color ? stroke.color : 'orange' : 'transparent';
79
+ this.context2d.lineWidth = stroke ? stroke.width ? stroke.width : 1 : 0;
68
80
  this.context2d.arc(center.x, center.y, radius, startAngle, endAngle);
69
81
  this.context2d.stroke();
82
+ this.context2d.fill();
70
83
  }
71
84
 
72
85
  /**
73
86
  *
74
87
  * @param {Vector2} center
75
88
  * @param {Number} radius
89
+ * @param {CanvasGradient|string} fill
90
+ * @param {any} stroke
76
91
  */
77
- drawCircle(center, radius) {
78
- this.drawArc(center, radius, 0, 2 * Math.PI);
92
+ drawCircle(center, radius, fill, stroke) {
93
+ this.drawArc(center, radius, fill, stroke);
79
94
  }
80
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "dependencies": {