mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 11:03:23 +00:00
1 line
51 KiB
JSON
1 line
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 Recta
|