mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 02:53:27 +00:00
1 line
No EOL
51 KiB
JSON
1 line
No EOL
51 KiB
JSON
{"class":{"name":"Phaser.BitmapData","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"key","type":["string"],"help":"Internal Phaser reference key for the render texture.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the BitmapData in pixels.","optional":true,"default":"256"},{"name":"height","type":["number"],"help":"The height of the BitmapData in pixels.","optional":true,"default":"256"}],"help":"A BitmapData object contains a Canvas element to which you can draw anything you like via normal Canvas context operations.\\nA single BitmapData can be used as the texture for one or many Images\/Sprites.\\nSo if you need to dynamically create a Sprite texture then they are a good choice."},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set.","line":213,"public":true,"protected":false,"private":false,"parameters":[{"name":"object","type":["Phaser.Sprite","array Phaser.Sprite","Phaser.Image","array Phaser.Image"],"help":"Either a single Sprite\/Image or an Array of Sprites\/Images.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addToWorld","static":false,"returns":{"types":["Phaser.Image"],"help":"The newly added Image object."},"help":"Creates a new Phaser.Image object, assigns this BitmapData to be its texture, adds it to the world then returns it.","line":943,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate to place the Image at.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate to place the Image at.","optional":true,"default":"0"},{"name":"anchorX","type":["number"],"help":"Set the x anchor point of the Image. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.","optional":true,"default":"0"},{"name":"anchorY","type":["number"],"help":"Set the y anchor point of the Image. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.","optional":true,"default":"0"},{"name":"scaleX","type":["number"],"help":"The horizontal scale factor of the Image. A value of 1 means no scaling. 2 would be twice the size, and so on.","optional":true,"default":"1"},{"name":"scaleY","type":["number"],"help":"The vertical scale factor of the Image. A value of 1 means no scaling. 2 would be twice the size, and so on.","optional":true,"default":"1"}],"inherited":false,"inheritedFrom":""},{"name":"alphaMask","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Draws the image onto this BitmapData using an image as an alpha mask.","line":1229,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapData","Image","HTMLCanvasElement","string"],"help":"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.","optional":false,"default":null},{"name":"mask","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapData","Image","HTMLCanvasElement","string"],"help":"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.","optional":true,"default":null},{"name":"sourceRect","type":["Phaser.Rectangle"],"help":"A Rectangle where x\/y define the coordinates to draw the Source image to and width\/height define the size.","optional":true,"default":null},{"name":"maskRect","type":["Phaser.Rectangle"],"help":"A Rectangle where x\/y define the coordinates to draw the Mask image to and width\/height define the size.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"blendAdd","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'lighter'","line":1561,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendColor","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'color'","line":1743,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendColorBurn","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'color-burn'","line":1652,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendColorDodge","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'color-dodge'","line":1639,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDarken","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'darken'","line":1613,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDestinationAtop","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'destination-atop'","line":1535,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDestinationIn","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'destination-in'","line":1509,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDestinationOut","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'destination-out'","line":1522,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDestinationOver","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'destination-over'","line":1496,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendDifference","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'difference'","line":1691,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendExclusion","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'exclusion'","line":1704,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendHardLight","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'hard-light'","line":1665,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendHue","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'hue'","line":1717,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendLighten","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'lighten'","line":1626,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendLuminosity","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'luminosity'","line":1756,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendMultiply","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'multiply'","line":1574,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendOverlay","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'overlay'","line":1600,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendReset","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Resets the blend mode (effectively sets it to 'source-over')","line":1431,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSaturation","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'saturation'","line":1730,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendScreen","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'screen'","line":1587,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSoftLight","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'soft-light'","line":1678,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSourceAtop","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'source-atop'","line":1483,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSourceIn","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'source-in'","line":1457,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSourceOut","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'source-out'","line":1470,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendSourceOver","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'source-over'","line":1444,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"blendXor","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the blend mode to 'xor'","line":1548,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"circle","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Draws a filled Circle to the BitmapData at the given x, y coordinates and radius in size.","line":1340,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate to draw the Circle at. This is the center of the circle.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate to draw the Circle at. This is the center of the circle.","optional":false,"default":null},{"name":"radius","type":["number"],"help":"The radius of the Circle in pixels. The radius is half the diameter.","optional":false,"default":null},{"name":"fillStyle","type":["string"],"help":"If set the context fillStyle will be set to this value before the circle is drawn.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clear","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Clears the BitmapData context using a clearRect.","line":281,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"cls","static":false,"returns":null,"help":"Clears the BitmapData context using a clearRect.","line":274,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"copy","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Copies a rectangular area from the source object to this BitmapData. If you give `null` as the source it will copy from itself.\\nYou can optionally resize, translate, rotate, scale, alpha or blend as it's drawn.\\nAll rotation, scaling and drawing takes place around the regions center point by default, but can be changed with the anchor parameters.\\nNote that the source image can also be this BitmapData, which can create some interesting effects.\\n\\nThis method has a lot of parameters for maximum control.\\nYou can use the more friendly methods like `copyRect` and `draw` to avoid having to remember them all.","line":986,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapData","Image","HTMLCanvasElement","string"],"help":"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.","optional":true,"default":null},{"name":"x","type":["number"],"help":"The x coordinate representing the top-left of the region to copy from the source image.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate representing the top-left of the region to copy from the source image.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The width of the region to copy from the source image. If not specified it will use the full source image width.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The height of the region to copy from the source image. If not specified it will use the full source image height.","optional":true,"default":null},{"name":"tx","type":["number"],"help":"The x coordinate to translate to before drawing. If not specified it will default to the `x` parameter.","optional":true,"default":null},{"name":"ty","type":["number"],"help":"The y coordinate to translate to before drawing. If not specified it will default to the `y` parameter.","optional":true,"default":null},{"name":"newWidth","type":["number"],"help":"The new width of the block being copied. If not specified it will default to the `width` parameter.","optional":true,"default":null},{"name":"newHeight","type":["number"],"help":"The new height of the block being copied. If not specified it will default to the `height` parameter.","optional":true,"default":null},{"name":"rotate","type":["number"],"help":"The angle in radians to rotate the block to before drawing. Rotation takes place around the center by default, but can be changed with the `anchor` parameters.","optional":true,"default":"0"},{"name":"anchorX","type":["number"],"help":"The anchor point around which the block is rotated and scaled. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.","optional":true,"default":"0"},{"name":"anchorY","type":["number"],"help":"The anchor point around which the block is rotated and scaled. A value between 0 and 1, where 0 is the top-left and 1 is bottom-right.","optional":true,"default":"0"},{"name":"scaleX","type":["number"],"help":"The horizontal scale factor of the block. A value of 1 means no scaling. 2 would be twice the size, and so on.","optional":true,"default":"1"},{"name":"scaleY","type":["number"],"help":"The vertical scale factor of the block. A value of 1 means no scaling. 2 would be twice the size, and so on.","optional":true,"default":"1"},{"name":"alpha","type":["number"],"help":"The alpha that will be set on the context before drawing. A value between 0 (fully transparent) and 1, opaque.","optional":true,"default":"1"},{"name":"blendMode","type":["number"],"help":"The composite blend mode that will be used when drawing. The default is no blend mode at all.","optional":true,"default":"null"},{"name":"roundPx","type":["boolean"],"help":"Should the x and y values be rounded to integers before drawing? This prevents anti-aliasing in some instances.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"copyRect","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Copies the area defined by the Rectangle parameter from the source image to this BitmapData at the given location.","line":1163,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapData","Image","string"],"help":"The Image to copy from. If you give a string it will try and find the Image in the Game.Cache.","optional":false,"default":null},{"name":"area","type":["Phaser.Rectangle"],"help":"The Rectangle region to copy from the source image.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The destination x coordinate to copy the image to.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The destination y coordinate to copy the image to.","optional":false,"default":null},{"name":"alpha","type":["number"],"help":"The alpha that will be set on the context before drawing. A value between 0 (fully transparent) and 1, opaque.","optional":true,"default":"1"},{"name":"blendMode","type":["number"],"help":"The composite blend mode that will be used when drawing. The default is no blend mode at all.","optional":true,"default":"null"},{"name":"roundPx","type":["boolean"],"help":"Should the x and y values be rounded to integers before drawing? This prevents anti-aliasing in some instances.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"draw","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Draws the given Phaser.Sprite, Phaser.Image or Phaser.Text to this BitmapData at the coordinates specified.\\nYou can use the optional width and height values to 'stretch' the sprite as it is drawn. This uses drawImage stretching, not scaling.\\nWhen drawing it will take into account the Sprites rotation, scale and alpha values.","line":1184,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Image","Phaser.Text"],"help":"The Sprite, Image or Text object to draw onto this BitmapData.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate to translate to before drawing. If not specified it will default to `source.x`.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate to translate to before drawing. If not specified it will default to `source.y`.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The new width of the Sprite being copied. If not specified it will default to `source.width`.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The new height of the Sprite being copied. If not specified it will default to `source.height`.","optional":true,"default":null},{"name":"blendMode","type":["number"],"help":"The composite blend mode that will be used when drawing the Sprite. The default is no blend mode at all.","optional":true,"default":"null"},{"name":"roundPx","type":["boolean"],"help":"Should the x and y values be rounded to integers before drawing? This prevents anti-aliasing in some instances.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"extract","static":false,"returns":null,"help":"Scans this BitmapData for all pixels matching the given r,g,b values and then draws them into the given destination BitmapData.\\nThe original BitmapData remains unchanged.\\nThe destination BitmapData must be large enough to receive all of the pixels that are scanned unless the 'resize' parameter is true.\\nAlthough the destination BitmapData is returned from this method, it's actually modified directly in place, meaning this call is perfectly valid:\\n`picture.extract(mask, r, g, b)`\\nYou can specify optional r2, g2, b2 color values. If given the pixel written to the destination bitmap will be of the r2, g2, b2 color.\\nIf not given it will be written as the same color it was extracted. You can provide one or more alternative colors, allowing you to tint\\nthe color during extraction.","line":1275,"public":true,"protected":false,"private":false,"parameters":[{"name":"destination","type":["Phaser.BitmapData"],"help":"The BitmapData that the extracted pixels will be drawn to.","optional":false,"default":null},{"name":"r","type":["number"],"help":"The red color component, in the range 0 - 255.","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color component, in the range 0 - 255.","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color component, in the range 0 - 255.","optional":false,"default":null},{"name":"a","type":["number"],"help":"The alpha color component, in the range 0 - 255 that the new pixel will be drawn at.","optional":true,"default":"255"},{"name":"resize","type":["boolean"],"help":"Should the destination BitmapData be resized to match this one before the pixels are copied?","optional":true,"default":"false"},{"name":"r2","type":["number"],"help":"An alternative red color component to be written to the destination, in the range 0 - 255.","optional":true,"default":null},{"name":"g2","type":["number"],"help":"An alternative green color component to be written to the destination, in the range 0 - 255.","optional":true,"default":null},{"name":"b2","type":["number"],"help":"An alternative blue color component to be written to the destination, in the range 0 - 255.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"fill","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Fills the BitmapData with the given color.","line":301,"public":true,"protected":false,"private":false,"parameters":[{"name":"r","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"g","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"b","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"a","type":["number"],"help":"The alpha color value, between 0 and 1.","optional":true,"default":"1"}],"inherited":false,"inheritedFrom":""},{"name":"getBounds","static":false,"returns":{"types":["Phaser.Rectangle"],"help":"A Rectangle whose dimensions encompass the full extent of non-transparent pixels in this BitmapData."},"help":"Scans the BitmapData and calculates the bounds. This is a rectangle that defines the extent of all non-transparent pixels.\\nThe rectangle returned will extend from the top-left of the image to the bottom-right, exluding transparent pixels.","line":911,"public":true,"protected":false,"private":false,"parameters":[{"name":"rect","type":["Phaser.Rectangle"],"help":"If provided this Rectangle object will be populated with the bounds, otherwise a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getFirstPixel","static":false,"returns":{"types":["object"],"help":"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."},"help":"Scans the BitmapData, pixel by pixel, until it encounters a pixel that isn't transparent (i.e. has an alpha value > 0).\\nIt 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.\\n\\nThe direction parameter controls from which direction it should start the scan:\\n\\n0 = top to bottom\\n1 = bottom to top\\n2 = left to right\\n3 = right to left","line":835,"public":true,"protected":false,"private":false,"parameters":[{"name":"direction","type":["number"],"help":"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.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"getPixel","static":false,"returns":{"types":["object"],"help":"An object with the red, green, blue and alpha values set in the r, g, b and a properties."},"help":"Get the color of a specific pixel in the context into a color object.\\nIf you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,\\notherwise 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.","line":748,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 4 properties will be created: r, g, b and a. If not provided a new object will be created.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getPixel32","static":false,"returns":{"types":["number"],"help":"A native color value integer (format: 0xAARRGGBB)"},"help":"Get the color of a specific pixel including its alpha value.\\nIf you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,\\notherwise 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.\\nNote that on little-endian systems the format is 0xAABBGGRR and on big-endian the format is 0xRRGGBBAA.","line":779,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getPixelRGB","static":false,"returns":{"types":["object"],"help":"An object with the red, green and blue values set in the r, g and b properties."},"help":"Get the color of a specific pixel including its alpha value as a color object containing r,g,b,a and rgba properties.\\nIf you have drawn anything to the BitmapData since it was created you must call BitmapData.update to refresh the array buffer,\\notherwise 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.","line":801,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"out","type":["object"],"help":"An object into which 3 properties will be created: r, g and b. If not provided a new object will be created.","optional":true,"default":null},{"name":"hsl","type":["boolean"],"help":"Also convert the rgb values into hsl?","optional":true,"default":"false"},{"name":"hsv","type":["boolean"],"help":"Also convert the rgb values into hsv?","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"getPixels","static":false,"returns":{"types":["ImageData"],"help":"Returns a ImageData object containing a Uint8ClampedArray data property."},"help":"Gets all the pixels from the region specified by the given Rectangle object.","line":814,"public":true,"protected":false,"private":false,"parameters":[{"name":"rect","type":["Phaser.Rectangle"],"help":"The Rectangle region to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTransform","static":false,"returns":{"types":["object"],"help":"A JavaScript object containing all of the properties BitmapData needs for transforms."},"help":"Gets a JavaScript object that has 6 properties set that are used by BitmapData in a transform.","line":1797,"public":true,"protected":false,"private":false,"parameters":[{"name":"translateX","type":["number"],"help":"The x translate value.","optional":false,"default":null},{"name":"translateY","type":["number"],"help":"The y translate value.","optional":false,"default":null},{"name":"scaleX","type":["number"],"help":"The scale x value.","optional":false,"default":null},{"name":"scaleY","type":["number"],"help":"The scale y value.","optional":false,"default":null},{"name":"skewX","type":["number"],"help":"The skew x value.","optional":false,"default":null},{"name":"skewY","type":["number"],"help":"The skew y value.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"load","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Takes the given Game Object, resizes this BitmapData to match it and then draws it into this BitmapDatas canvas, ready for further processing.\\nThe source game object is not modified by this operation.\\nIf the source object uses a texture as part of a Texture Atlas or Sprite Sheet, only the current frame will be used for sizing.\\nIf a string is given it will assume it's a cache key and look in Phaser.Cache for an image key matching the string.","line":244,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapData","Image","HTMLCanvasElement","string"],"help":"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.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"processPixel","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"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.\\nWhatever 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.\\nNote that the format of the color received will be different depending on if the system is big or little endian.\\nIt is expected that your callback will deal with endianess. If you'd rather Phaser did it then use processPixelRGB instead.\\nThe callback will also be sent the pixels x and y coordinates respectively.","line":467,"public":true,"protected":false,"private":false,"parameters":[{"name":"callback","type":["function"],"help":"The callback that will be sent each pixel color to be processed.","optional":false,"default":null},{"name":"callbackContext","type":["object"],"help":"The context under which the callback will be called.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate of the top-left of the region to process from.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate of the top-left of the region to process from.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The width of the region to process.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The height of the region to process.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"processPixelRGB","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Scans through the area specified in this BitmapData and sends a color object for every pixel to the given callback.\\nThe callback will be sent a color object with 6 properties: `{ r: number, g: number, b: number, a: number, color: number, rgba: string }`.\\nWhere r, g, b and a are integers between 0 and 255 representing the color component values for red, green, blue and alpha.\\nThe `color` property is an Int32 of the full color. Note the endianess of this will change per system.\\nThe `rgba` property is a CSS style rgba() string which can be used with context.fillStyle calls, among others.\\nThe callback will also be sent the pixels x and y coordinates respectively.\\nThe callback must return either `false`, in which case no change will be made to the pixel, or a new color object.\\nIf a new color object is returned the pixel will be set to the r, g, b and a color values given within it.","line":412,"public":true,"protected":false,"private":false,"parameters":[{"name":"callback","type":["function"],"help":"The callback that will be sent each pixel color object to be processed.","optional":false,"default":null},{"name":"callbackContext","type":["object"],"help":"The context under which the callback will be called.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate of the top-left of the region to process from.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate of the top-left of the region to process from.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The width of the region to process.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The height of the region to process.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"rect","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Draws a filled Rectangle to the BitmapData at the given x, y coordinates and width \/ height in size.","line":1317,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the top-left of the Rectangle.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the top-left of the Rectangle.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the Rectangle.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the Rectangle.","optional":false,"default":null},{"name":"fillStyle","type":["string"],"help":"If set the context fillStyle will be set to this value before the rect is drawn.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"render","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"If the game is running in WebGL this will push the texture up to the GPU if it's dirty.\\nThis is called automatically if the BitmapData is being used by a Sprite, otherwise you need to remember to call it in your render function.\\nIf you wish to suppress this functionality set BitmapData.disableTextureUpload to `true`.","line":1413,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"replaceRGB","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Replaces all pixels matching one color with another. The color values are given as two sets of RGBA values.\\nAn optional region parameter controls if the replacement happens in just a specific area of the BitmapData or the entire thing.","line":521,"public":true,"protected":false,"private":false,"parameters":[{"name":"r1","type":["number"],"help":"The red color value to be replaced. Between 0 and 255.","optional":false,"default":null},{"name":"g1","type":["number"],"help":"The green color value to be replaced. Between 0 and 255.","optional":false,"default":null},{"name":"b1","type":["number"],"help":"The blue color value to be replaced. Between 0 and 255.","optional":false,"default":null},{"name":"a1","type":["number"],"help":"The alpha color value to be replaced. Between 0 and 255.","optional":false,"default":null},{"name":"r2","type":["number"],"help":"The red color value that is the replacement color. Between 0 and 255.","optional":false,"default":null},{"name":"g2","type":["number"],"help":"The green color value that is the replacement color. Between 0 and 255.","optional":false,"default":null},{"name":"b2","type":["number"],"help":"The blue color value that is the replacement color. Between 0 and 255.","optional":false,"default":null},{"name":"a2","type":["number"],"help":"The alpha color value that is the replacement color. Between 0 and 255.","optional":false,"default":null},{"name":"region","type":["Phaser.Rectangle"],"help":"The area to perform the search over. If not given it will replace over the whole BitmapData.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"resize","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Resizes the BitmapData. This changes the size of the underlying canvas and refreshes the buffer.","line":319,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setHSL","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the hue, saturation and lightness values on every pixel in the given region, or the whole BitmapData if no region was specified.","line":565,"public":true,"protected":false,"private":false,"parameters":[{"name":"h","type":["number"],"help":"The hue, in the range 0 - 1.","optional":true,"default":"null"},{"name":"s","type":["number"],"help":"The saturation, in the range 0 - 1.","optional":true,"default":"null"},{"name":"l","type":["number"],"help":"The lightness, in the range 0 - 1.","optional":true,"default":"null"},{"name":"region","type":["Phaser.Rectangle"],"help":"The area to perform the operation on. If not given it will run over the whole BitmapData.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setPixel","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the color of the given pixel to the specified red, green and blue values.","line":731,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"red","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"green","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"blue","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"alpha","type":["number"],"help":"The alpha color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"immediate","type":["boolean"],"help":"If `true` the context.putImageData will be called and the dirty flag set.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"setPixel32","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the color of the given pixel to the specified red, green, blue and alpha values.","line":692,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate of the pixel to be set. Must lay within the dimensions of this BitmapData.","optional":false,"default":null},{"name":"red","type":["number"],"help":"The red color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"green","type":["number"],"help":"The green color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"blue","type":["number"],"help":"The blue color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"alpha","type":["number"],"help":"The alpha color value, between 0 and 0xFF (255).","optional":false,"default":null},{"name":"immediate","type":["boolean"],"help":"If `true` the context.putImageData will be called and the dirty flag set.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"shadow","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Sets the shadow properties of this BitmapDatas context which will affect all draw operations made to it.\\nYou can cancel an existing shadow by calling this method and passing no parameters.\\nNote: At the time of writing (October 2014) Chrome still doesn't support shadowBlur used with drawImage.","line":1203,"public":true,"protected":false,"private":false,"parameters":[{"name":"color","type":["string"],"help":"The color of the shadow, given in a CSS format, i.e. `#000000` or `rgba(0,0,0,1)`. If `null` or `undefined` the shadow will be reset.","optional":false,"default":null},{"name":"blur","type":["number"],"help":"The amount the shadow will be blurred by. Low values = a crisp shadow, high values = a softer shadow.","optional":true,"default":"5"},{"name":"x","type":["number"],"help":"The horizontal offset of the shadow in pixels.","optional":true,"default":"10"},{"name":"y","type":["number"],"help":"The vertical offset of the shadow in pixels.","optional":true,"default":"10"}],"inherited":false,"inheritedFrom":""},{"name":"shiftHSL","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Shifts any or all of the hue, saturation and lightness values on every pixel in the given region, or the whole BitmapData if no region was specified.\\nShifting will add the given value onto the current h, s and l values, not replace them.\\nThe hue is wrapped to keep it within the range 0 to 1. Saturation and lightness are clamped to not exceed 1.","line":628,"public":true,"protected":false,"private":false,"parameters":[{"name":"h","type":["number"],"help":"The amount to shift the hue by.","optional":true,"default":"null"},{"name":"s","type":["number"],"help":"The amount to shift the saturation by.","optional":true,"default":"null"},{"name":"l","type":["number"],"help":"The amount to shift the lightness by.","optional":true,"default":"null"},{"name":"region","type":["Phaser.Rectangle"],"help":"The area to perform the operation on. If not given it will run over the whole BitmapData.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"textureLine","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"Takes the given Line object and image and renders it to this BitmapData as a repeating texture line.","line":1366,"public":true,"protected":false,"private":false,"parameters":[{"name":"line","type":["Phaser.Line"],"help":"A Phaser.Line object that will be used to plot the start and end of the line.","optional":false,"default":null},{"name":"image","type":["string","Image"],"help":"The key of an image in the Phaser.Cache to use as the texture for this line, or an actual Image.","optional":false,"default":null},{"name":"repeat","type":["string"],"help":"The pattern repeat mode to use when drawing the line. Either `repeat`, `repeat-x` or `no-repeat`.","optional":true,"default":"'repeat-x'"}],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"This BitmapData object for method chaining."},"help":"This re-creates the BitmapData.imageData from the current context.\\nIt then re-builds the ArrayBuffer, the data Uint8ClampedArray reference and the pixels Int32Array.\\nIf not given the dimensions defaults to the full size of the context.","line":361,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate of the top-left of the image data area to grab from.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate of the top-left of the image data area to grab from.","optional":true,"default":"0"},{"name":"width","type":["number"],"help":"The width of the image data area.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The height of the image data area.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"baseTexture","type":["PIXI.BaseTexture"],"help":"","inlineHelp":"The PIXI.BaseTexture.","line":101,"default":"new PIXI.BaseTexture(this.canvas)","public":true,"protected":false,"private":false,"readOnly":false},{"name":"buffer","type":["array"],"help":"","inlineHelp":"An ArrayBuffer the same size as the context ImageData.","line":79,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"canvas","type":["HTMLCanvasElement"],"help":"","inlineHelp":"The canvas to which this BitmapData draws.","line":48,"default":"Phaser.Canvas.create(width, height, '', true)","public":true,"protected":false,"private":false,"readOnly":false},{"name":"context","type":["CanvasRenderingContext2D"],"help":"","inlineHelp":"The 2d context of the canvas.","line":54,"default":"this.canvas.getContext('2d')","public":true,"protected":false,"private":false,"readOnly":false},{"name":"ctx","type":["CanvasRenderingContext2D"],"help":"","inlineHelp":"A reference to BitmapData.context.","line":59,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"data","type":["Uint8ClampedArray"],"help":"","inlineHelp":"A Uint8ClampedArray view into BitmapData.buffer.","line":69,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"dirty","type":["boolean"],"help":"","inlineHelp":"If dirty this BitmapData will be re-rendered.","line":131,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"disableTextureUpload","type":["boolean"],"help":"","inlineHelp":"If disableTextureUpload is true this BitmapData will never send its image data to the GPU when its dirty flag is true.","line":126,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running game.","line":27,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"","inlineHelp":"The height of the BitmapData in pixels.","line":42,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"imageData","type":["ImageData"],"help":"","inlineHelp":"The context image data.","line":64,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"key","type":["string"],"help":"","inlineHelp":"The key of the BitmapData in the Cache, if stored there.","line":32,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pixels","type":["Uint32Array"],"help":"","inlineHelp":"An Uint32Array view into BitmapData.buffer.","line":74,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"smoothed","type":["boolean"],"help":"","inlineHelp":"Gets or sets this BitmapData.contexts smoothing enabled value.","line":1769,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"texture","type":["PIXI.Texture"],"help":"","inlineHelp":"The PIXI.Texture.","line":107,"default":"new PIXI.Texture(this.baseTexture)","public":true,"protected":false,"private":false,"readOnly":false},{"name":"textureFrame","type":["Phaser.Frame"],"help":"","inlineHelp":"The Frame this BitmapData uses for rendering.","line":113,"default":"new Phaser.Frame(0, 0, 0, width, height, 'bitmapData', game.rnd.uuid())","public":true,"protected":false,"private":false,"readOnly":false},{"name":"type","type":["number"],"help":"","inlineHelp":"The const type of this object.","line":121,"default":"Phaser.BITMAPDATA","public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"","inlineHelp":"The width of the BitmapData in pixels.","line":37,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_alpha","type":["object"],"help":"","inlineHelp":"Internal cache var.","line":170,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_anchor","type":["Phaser.Point"],"help":"","inlineHelp":"Internal cache var.","line":176,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_circle","type":["Phaser.Circle"],"help":"","inlineHelp":"Internal cache var.","line":200,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_image","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":140,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pos","type":["Phaser.Point"],"help":"","inlineHelp":"Internal cache var.","line":146,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_rotate","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":164,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_scale","type":["Phaser.Point"],"help":"","inlineHelp":"Internal cache var.","line":158,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_size","type":["Phaser.Point"],"help":"","inlineHelp":"Internal cache var.","line":152,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_tempB","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":194,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_tempG","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":188,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_tempR","type":["number"],"help":"","inlineHelp":"Internal cache var.","line":182,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |