You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BitmapData.alphaMask has 2 new optional parameters: sourceRect and maskRect to give more fine-grained control over where the source and mask are drawn and their size
BitmapData.draw now has two optional parameters: width and height, to let you stretch the image being drawn if needed.
* 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.
52
52
* BitmapData.alphaMask can now also take a Phaser.Sprite, Phaser.Image or BitmapData object as a source type.
53
-
* BitmapData.alphaMask has 4 new optional parameters: x, y, x2 and y2 to control exactly where the source and mask images are drawn.
53
+
* BitmapData.alphaMask has 2 new optional parameters: sourceRect and maskRect to give more fine-grained control over where the source and mask are drawn and their size
54
54
* BitmapData.alphaMask 'mask' parameter is now optional, if not given it will use itself as the mask.
55
55
* BitmapData.alphaMask now calls BitmapData.update after running.
56
+
* BitmapData.draw now has two optional parameters: width and height, to let you stretch the image being drawn if needed.
* Draws the given image or Game Object to this BitmapData at the coordinates specified.
780
-
* If you need to only draw a part of the image use BitmapData.copyPixels instead.
780
+
* You can use the optional width and height values to 'stretch' the image as it's drawn.
781
781
*
782
782
* @method Phaser.BitmapData#draw
783
783
* @param {Phaser.Sprite|Phaser.Image|Phaser.BitmapData|HTMLImage|string} source - The Image to draw. If you give a string it will try and find the Image in the Game.Cache.
784
784
* @param {number} [x=0] - The x coordinate to draw the image to.
785
785
* @param {number} [y=0] - The y coordinate to draw the image to.
786
+
* @param {number} [width] - The width when drawing the image. You can use this to optionally stretch the drawn image horizontally.
787
+
* @param {number} [height] - The height when drawing the image. You can use this to optionally stretch the drawn image vertically.
* @param {Phaser.Sprite|Phaser.Image|Phaser.BitmapData|HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache.
840
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.BitmapData|HTMLImage|string} mask - The Image to use as the alpha mask. If you give a key it will try and find the Image in the Game.Cache.
841
-
* @param {number} [x=0] - The x coordinate to draw the source image to.
842
-
* @param {number} [y=0] - The y coordinate to draw the source image to.
843
-
* @param {number} [x2=0] - The x coordinate to draw the mask image to.
844
-
* @param {number} [y2=0] - The y coordinate to draw the mask image to.
862
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.BitmapData|HTMLImage|string|null} [mask] - The Image to use as the alpha mask. If you give a key it will try and find the Image in the Game.Cache. If you pass nothing or null it will use itself.
863
+
* @param {Phaser.Rectangle} [sourceRect] - A Rectangle where x/y define the coordinates to draw the Source image to and width/height define the size.
864
+
* @param {Phaser.Rectangle} [maskRect] - A Rectangle where x/y define the coordinates to draw the Mask image to and width/height define the size.
0 commit comments