BitmapData#rect()

rect(x, y, width, height, fillStyle) → {Phaser.BitmapData} Draws a filled Rectangle to the BitmapData at the given x, y coordinates and width / height in size. Parameters Name Type Argument Description x number The x coordinate of the top-left of the Rectangle. y number The y coordinate of the top-left of the Rectangle. width number The width of the Rectangle. height number The height of the Rectangle. fillStyle string <optional> If set the context fillStyle will be

BitmapData#processPixelRGB()

processPixelRGB(callback, callbackContext, x, y, width, height) → {Phaser.BitmapData} Scans through the area specified in this BitmapData and sends a color object for every pixel to the given callback.The callback will be sent a color object with 6 properties: { r: number, g: number, b: number, a: number, color: number, rgba: string }.Where r, g, b and a are integers between 0 and 255 representing the color component values for red, green, blue and alpha.The color property is an Int32 of the

BitmapData#processPixel()

processPixel(callback, callbackContext, x, y, width, height) → {Phaser.BitmapData} Scans through the area specified in this BitmapData and sends the color for every pixel to the given callback along with its x and y coordinates.Whatever value the callback returns is set as the new color for that pixel, unless it returns the same color, in which case it's skipped.Note that the format of the color received will be different depending on if the system is big or little endian.It is expected that

BitmapData#pixels

pixels :Uint32Array An Uint32Array view into BitmapData.buffer. Source code: gameobjects/BitmapData.js (Line 94)

BitmapData#moveV()

moveV(distance, wrap) → {Phaser.BitmapData} Shifts the contents of this BitmapData vertically. The image will wrap-around the sides if the wrap argument is true (the default). Parameters Name Type Argument Default Description distance integer The amount of pixels to vertically shift the canvas by. Use a negative value to shift up, positive to shift down. wrap boolean <optional> true Wrap the content of the BitmapData. Returns Phaser.BitmapData - This BitmapData object

BitmapData#moveH()

moveH(distance, wrap) → {Phaser.BitmapData} Shifts the contents of this BitmapData horizontally. The image will wrap-around the sides if the wrap argument is true (the default). Parameters Name Type Argument Default Description distance integer The amount of pixels to horizontally shift the canvas by. Use a negative value to shift to the left, positive to the right. wrap boolean <optional> true Wrap the content of the BitmapData. Returns Phaser.BitmapData - This Bitmap

BitmapData#move()

move(x, y, wrap) → {Phaser.BitmapData} Shifts the contents of this BitmapData by the distances given. The image will wrap-around the edges on all sides if the wrap argument is true (the default). Parameters Name Type Argument Default Description x integer The amount of pixels to horizontally shift the canvas by. Use a negative value to shift to the left, positive to the right. y integer The amount of pixels to vertically shift the canvas by. Use a negative value to shift up, posi

BitmapData#load()

load(source) → {Phaser.BitmapData} Takes the given Game Object, resizes this BitmapData to match it and then draws it into this BitmapDatas canvas, ready for further processing.The source game object is not modified by this operation.If the source object uses a texture as part of a Texture Atlas or Sprite Sheet, only the current frame will be used for sizing.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. Parameters Name Typ

BitmapData#line()

line(x1, y1, x2, y2, color, width) → {Phaser.BitmapData} Draws a line between the coordinates given in the color and thickness specified. Parameters Name Type Argument Default Description x1 number The x coordinate to start the line from. y1 number The y coordinate to start the line from. x2 number The x coordinate to draw the line to. y2 number The y coordinate to draw the line to. color string <optional> '#fff' The stroke color that the line will be drawn

BitmapData#key

key : string The key of the BitmapData in the Cache, if stored there. Source code: gameobjects/BitmapData.js (Line 38)