Skip to content

Commit 7846da7

Browse files
committed
BitmapData.alphaMask 'mask' parameter is now optional, if not given it will use itself as the mask.
BitmapData.alphaMask now calls BitmapData.update after running.
1 parent 6e9c9c1 commit 7846da7

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Version 2.0.6 - "Jornhill" - -in development-
5151
* BitmapData.draw can now also take a Phaser.Sprite, Phaser.Image or BitmapData object as a source type. As a result BitmapData.drawSprite is now depcreated.
5252
* BitmapData.alphaMask can now also take a Phaser.Sprite, Phaser.Image or BitmapData object as a source type.
5353
* BitmapData.alphaMask has 4 new optional parameters: x, y, x2 and y2 to control exactly where the source and mask images are drawn.
54+
* BitmapData.alphaMask 'mask' parameter is now optional, if not given it will use itself as the mask.
55+
* BitmapData.alphaMask now calls BitmapData.update after running.
5456

5557
### New Features
5658

src/gameobjects/BitmapData.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ Phaser.BitmapData.prototype = {
845845
*/
846846
alphaMask: function (source, mask, x, y, x2, y2) {
847847

848+
if (typeof mask === 'undefined') { mask = this; }
848849
if (typeof x === 'undefined') { x = 0; }
849850
if (typeof y === 'undefined') { y = 0; }
850851
if (typeof x2 === 'undefined') { x2 = 0; }
@@ -860,6 +861,8 @@ Phaser.BitmapData.prototype = {
860861

861862
this.context.globalCompositeOperation = temp;
862863

864+
this.update();
865+
863866
this.dirty = true;
864867

865868
},

0 commit comments

Comments
 (0)