Namespace: Snapshot

Phaser.Types.Renderer. Snapshot

Type Definitions


SnapshotCallback(snapshot)

Parameters:
Name Type Description
snapshot Phaser.Display.Color | HTMLImageElement

Either a Color object if a single pixel is being grabbed, or a new Image which contains a snapshot of the canvas contents.

Since: 3.16.1
Source: src/renderer/snapshot/typedefs/SnapshotCallback.js (Line 1)

SnapshotState

Type:
  • object
Properties:
Name Type Argument 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.

Since: 3.16.1
Source: src/renderer/snapshot/typedefs/SnapshotState.js (Line 1)