Added Graphics.fill and Graphics.stroke

This commit is contained in:
Richard Davey 2018-11-19 11:09:53 +00:00
parent 202c6c9c1a
commit 51223c518a
2 changed files with 22 additions and 0 deletions

View file

@ -63,6 +63,8 @@
* `WebAudioSoundManager.onFocus` will not try to resume the Audio Context if it's still locked.
* `WebAudioSoundManager.onBlur` will not try to suspend the Audio Context if it's still locked.
* When using `ScenePlugin.add`, to add a new Scene to the Scene Manager, it didn't allow you to include the optional Scene data object. You can now pass this in the call (thanks @kainage)
* `Graphics.stroke` is a new alias for the `strokePath` method, to keep the calls consistent with the Canvas Rendering Context API.
* `Graphics.fill` is a new alias for the `fillPath` method, to keep the calls consistent with the Canvas Rendering Context API.
### Bug Fixes

View file

@ -523,6 +523,26 @@ var Graphics = new Class({
return this;
},
/**
* Stroke the current path.
*
* This is an alias for `Graphics.strokePath` and does the same thing.
* It was added to match calls found in the Canvas API.
*
* @method Phaser.GameObjects.Graphics#stroke
* @since 3.16.0
*
* @return {Phaser.GameObjects.Graphics} This Game Object.
*/
stroke: function ()
{
this.commandBuffer.push(
Commands.STROKE_PATH
);
return this;
},
/**
* Fill the given circle.
*