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
* @property {number} speed - Gets or sets the current speed of the animation, the time between each frame of the animation, given in ms. Takes effect from the NEXT frame. Minimum value is 1.
1229
+
* @property {number} speed - Gets or sets the current speed of the animation in frames per second. Changing this in a playing animation will take effect from the next frame. Minimum value is 1.
* If a string is given it will assume it's a cache key and look in Phaser.Cache for an image key matching the string.
785
785
*
786
786
* @method Phaser.BitmapData#load
787
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} source - The object that will be used to populate this BitmapData. If you give a string it will try and find the Image in the Game.Cache first.
787
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} source - The object that will be used to populate this BitmapData. If you give a string it will try and find the Image in the Game.Cache first.
788
788
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
* Scans the BitmapData, pixel by pixel, until it encounters a pixel that isn't transparent (i.e. has an alpha value > 0).
1368
+
* It then stops scanning and returns an object containing the colour of the pixel in r, g and b properties and the location in the x and y properties.
1369
+
*
1370
+
* The direction parameter controls from which direction it should start the scan:
1371
+
*
1372
+
* 0 = top to bottom
1373
+
* 1 = bottom to top
1374
+
* 2 = left to right
1375
+
* 3 = right to left
1376
+
*
1377
+
* @method Phaser.BitmapData#getFirstPixel
1378
+
* @param {number} [direction=0] - The direction in which to scan for the first pixel. 0 = top to bottom, 1 = bottom to top, 2 = left to right and 3 = right to left.
1379
+
* @return {object} Returns an object containing the colour of the pixel in the `r`, `g` and `b` properties and the location in the `x` and `y` properties.
1380
+
*/
1381
+
getFirstPixel: function (direction) {
1382
+
1383
+
if (typeof direction === 'undefined') { direction = 0; }
* You can use the more friendly methods like `copyRect` and `draw` to avoid having to remember them all.
1400
1511
*
1401
1512
* @method Phaser.BitmapData#copy
1402
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} [source] - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1513
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} [source] - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1403
1514
* @param {number} [x=0] - The x coordinate representing the top-left of the region to copy from the source image.
1404
1515
* @param {number} [y=0] - The y coordinate representing the top-left of the region to copy from the source image.
1405
1516
* @param {number} [width] - The width of the region to copy from the source image. If not specified it will use the full source image width.
* Copies the area defined by the Rectangle parameter from the source image to this BitmapData at the given location.
1587
1698
*
1588
1699
* @method Phaser.BitmapData#copyRect
1589
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|string} source - The Image to copy from. If you give a string it will try and find the Image in the Game.Cache.
1700
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|string} source - The Image to copy from. If you give a string it will try and find the Image in the Game.Cache.
1590
1701
* @param {Phaser.Rectangle} area - The Rectangle region to copy from the source image.
1591
1702
* @param {number} x - The destination x coordinate to copy the image to.
1592
1703
* @param {number} y - The destination y coordinate to copy the image to.
* Draws the image onto this BitmapData using an image as an alpha mask.
1656
1767
*
1657
1768
* @method Phaser.BitmapData#alphaMask
1658
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} source - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1659
-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} [mask] - The object to be used as the mask. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself. If you don't provide a mask it will use this BitmapData as the mask.
1769
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} source - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1770
+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} [mask] - The object to be used as the mask. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself. If you don't provide a mask it will use this BitmapData as the mask.
1660
1771
* @param {Phaser.Rectangle} [sourceRect] - A Rectangle where x/y define the coordinates to draw the Source image to and width/height define the size.
1661
1772
* @param {Phaser.Rectangle} [maskRect] - A Rectangle where x/y define the coordinates to draw the Mask image to and width/height define the size.
1662
1773
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
0 commit comments