mirror of
https://github.com/photonstorm/phaser
synced 2024-11-16 01:38:23 +00:00
Allow Shape game object to be a mask
This commit is contained in:
parent
a2956176dd
commit
784c2bd1ae
1 changed files with 2 additions and 2 deletions
|
@ -123,13 +123,13 @@ var Mask = {
|
|||
* @method Phaser.GameObjects.Components.Mask#createGeometryMask
|
||||
* @since 3.6.2
|
||||
*
|
||||
* @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask.
|
||||
* @param {Phaser.GameObjects.Graphics|Phaser.GameObjects.Shape} [graphics] - A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask.
|
||||
*
|
||||
* @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created.
|
||||
*/
|
||||
createGeometryMask: function (graphics)
|
||||
{
|
||||
if (graphics === undefined && this.type === 'Graphics')
|
||||
if (graphics === undefined && (this instanceof Phaser.GameObjects.Graphics || this instanceof Phaser.GameObjects.Shape))
|
||||
{
|
||||
// eslint-disable-next-line consistent-this
|
||||
graphics = this;
|
||||
|
|
Loading…
Reference in a new issue