Skip to content

Commit c6c5856

Browse files
committed
Phaser.Graphics.drawCircle now overrides PIXI.drawCircle which means the docs are now correct re: diameter not radius (thanks @ethankaminski phaserjs#1454)
1 parent f23c0aa commit c6c5856

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Version 2.2.2 - "Alkindar" - in development
8282
* The new fixed time-step code has been more carefully linked to Pixi transform updates. This should finally put a stop to the tunneling issues that were being reported.
8383
* Tween.stop fired a different set of onComplete parameters to Tween.update. Both now dispatch onComplete(target, tween) as the parameters in that order (thanks @P0rnflake #1450)
8484
* Removed redundant `tolerance` parameter from Rectangle.intersects (thanks @toolness #1463)
85+
* Phaser.Graphics.drawCircle now overrides PIXI.drawCircle which means the docs are now correct re: diameter not radius (thanks @ethankaminski #1454)
8586

8687
### Bug Fixes
8788

src/gameobjects/Graphics.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,22 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) {
194194

195195
};
196196

197+
/*
198+
* Draws a circle.
199+
*
200+
* @method Phaser.Graphics.prototype.drawCircle
201+
* @param {Number} x - The X coordinate of the center of the circle.
202+
* @param {Number} y - The Y coordinate of the center of the circle.
203+
* @param {Number} radius - The diameter of the circle.
204+
* @return {Phaser.Graphics} This Graphics object.
205+
*/
206+
Phaser.Graphics.prototype.drawCircle = function(x, y, diameter)
207+
{
208+
this.drawShape(new Phaser.Circle(x, y, diameter));
209+
210+
return this;
211+
};
212+
197213
/*
198214
* Draws a single {Phaser.Polygon} triangle from a {Phaser.Point} array
199215
*

0 commit comments

Comments
 (0)