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.
This commit is contained in:
photonstorm 2014-05-24 03:17:58 +01:00
parent 6e9c9c10b8
commit 7846da7c90
2 changed files with 5 additions and 0 deletions

View file

@ -51,6 +51,8 @@ Version 2.0.6 - "Jornhill" - -in development-
* 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.
* BitmapData.alphaMask can now also take a Phaser.Sprite, Phaser.Image or BitmapData object as a source type.
* BitmapData.alphaMask has 4 new optional parameters: x, y, x2 and y2 to control exactly where the source and mask images are drawn.
* 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.
### New Features

View file

@ -845,6 +845,7 @@ Phaser.BitmapData.prototype = {
*/
alphaMask: function (source, mask, x, y, x2, y2) {
if (typeof mask === 'undefined') { mask = this; }
if (typeof x === 'undefined') { x = 0; }
if (typeof y === 'undefined') { y = 0; }
if (typeof x2 === 'undefined') { x2 = 0; }
@ -860,6 +861,8 @@ Phaser.BitmapData.prototype = {
this.context.globalCompositeOperation = temp;
this.update();
this.dirty = true;
},