BitmapData#imageData

imageData :ImageData The context image data.Please note that a call to BitmapData.draw() or BitmapData.copy() does not update immediately this property for performance reason. Use BitmapData.update() to do so.This property is updated automatically after the first game loop, according to the dirty flag property. Source code: gameobjects/BitmapData.js (Line 77)

BitmapData#height

height : number The height of the BitmapData in pixels. Source code: gameobjects/BitmapData.js (Line 48)

BitmapData#getPixels()

getPixels(rect) → {ImageData} Gets all the pixels from the region specified by the given Rectangle object. Parameters Name Type Description rect Phaser.Rectangle The Rectangle region to get. Returns ImageData - Returns a ImageData object containing a Uint8ClampedArray data property. Source code: gameobjects/BitmapData.js (Line 1055)

BitmapData#getPixelRGB()

getPixelRGB(x, y, out, hsl, hsv) → {object} Get the color of a specific pixel including its alpha value as a color object containing r,g,b,a and rgba properties.If you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. Parameters Name Type Argument Default Description x number

BitmapData#getPixel32()

getPixel32(x, y) → {number} Get the color of a specific pixel including its alpha value.If you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist.Note that on little-endian systems the format is 0xAABBGGRR and on big-endian the format is 0xRRGGBBAA. Parameters Name Type Description x

BitmapData#getFirstPixel()

getFirstPixel(direction) → {object} Scans the BitmapData, pixel by pixel, until it encounters a pixel that isn't transparent (i.e. has an alpha value > 0).It then stops scanning and returns an object containing the color of the pixel in r, g and b properties and the location in the x and y properties. The direction parameter controls from which direction it should start the scan: 0 = top to bottom1 = bottom to top2 = left to right3 = right to left Parameters Name Type Argument Default Des

BitmapData#getPixel()

getPixel(x, y, out) → {object} Get the color of a specific pixel in the context into a color object.If you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. Parameters Name Type Argument Description x number The x coordinate of the pixel to be set. Must lay within the dimension

BitmapData#getBounds()

getBounds(rect) → {Phaser.Rectangle} Scans the BitmapData and calculates the bounds. This is a rectangle that defines the extent of all non-transparent pixels.The rectangle returned will extend from the top-left of the image to the bottom-right, excluding transparent pixels. Parameters Name Type Argument Description rect Phaser.Rectangle <optional> If provided this Rectangle object will be populated with the bounds, otherwise a new object will be created. Returns Phaser.Rectangl

BitmapData#game

game : Phaser.Game A reference to the currently running game. Source code: gameobjects/BitmapData.js (Line 33)

BitmapData#generateTexture()

generateTexture(key) → {PIXI.Texture} Creates a new Image element by converting this BitmapDatas canvas into a dataURL. The image is then stored in the image Cache using the key given. Finally a PIXI.Texture is created based on the image and returned. You can apply the texture to a sprite or any other supporting object by using either thekey or the texture. First call generateTexture: var texture = bitmapdata.generateTexture('ball'); Then you can either apply the texture to a sprite: game.add