Skip to content

Commit a6ef139

Browse files
committed
Added fill method.
1 parent 51223c5 commit a6ef139

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

src/gameobjects/graphics/Graphics.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,26 @@ var Graphics = new Class({
506506
return this;
507507
},
508508

509+
/**
510+
* Fill the current path.
511+
*
512+
* This is an alias for `Graphics.fillPath` and does the same thing.
513+
* It was added to match the CanvasRenderingContext 2D API.
514+
*
515+
* @method Phaser.GameObjects.Graphics#fill
516+
* @since 3.16.0
517+
*
518+
* @return {Phaser.GameObjects.Graphics} This Game Object.
519+
*/
520+
fill: function ()
521+
{
522+
this.commandBuffer.push(
523+
Commands.FILL_PATH
524+
);
525+
526+
return this;
527+
},
528+
509529
/**
510530
* Stroke the current path.
511531
*
@@ -527,7 +547,7 @@ var Graphics = new Class({
527547
* Stroke the current path.
528548
*
529549
* This is an alias for `Graphics.strokePath` and does the same thing.
530-
* It was added to match calls found in the Canvas API.
550+
* It was added to match the CanvasRenderingContext 2D API.
531551
*
532552
* @method Phaser.GameObjects.Graphics#stroke
533553
* @since 3.16.0

0 commit comments

Comments
 (0)