Phaser API Documentation

  Version: 
SnapshotState
Properties:
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 image/png or image/jpeg.

encoderOptions number <optional> 0.92

The image quality, between 0 and 1. Used for image formats with lossy compression, such as image/jpeg.

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.

Type:
object
Since: 3.16.1