name | type | description |
---|---|---|
snapshot | HTMLImageElement | Phaser.Display.Color |
Either a Color object if a single pixel is being grabbed, or a new Image which contains a snapshot of the canvas contents. |
name | type | arguments | Default | description |
---|---|---|---|---|
callback | Phaser.Types.Renderer.Snapshot.SnapshotCallback |
The function to call after the snapshot is taken. |
||
type | string | <optional> | 'image/png' |
The format of the image to create, usually |
encoderOptions | number | <optional> | 0.92 |
The image quality, between 0 and 1. Used for image formats with lossy compression, such as |
x | number | <optional> | 0 |
The x coordinate to start the snapshot from. |
y | number | <optional> | 0 |
The y coordinate to start the snapshot from. |
width | number | <optional> |
The width of the snapshot. |
|
height | number | <optional> |
The height of the snapshot. |
|
getPixel | boolean | <optional> | false |
Is this a snapshot to get a single pixel, or an area? |
isFramebuffer | boolean | <optional> | false |
Is this snapshot grabbing from a frame buffer or a canvas? |
bufferWidth | number | <optional> |
The width of the frame buffer, if a frame buffer grab. |
|
bufferHeight | number | <optional> |
The height of the frame buffer, if a frame buffer grab. |