Skip to main content
Version: Phaser v3.88.2

Types.Renderer.Snapshot

SnapshotCallback

<static> SnapshotCallback

Type: function

Member of: Phaser.Types.Renderer.Snapshot

Source: src/renderer/snapshot/typedefs/SnapshotCallback.js#L1
Since: 3.16.1


SnapshotState

<static> SnapshotState

nametypeoptionaldefaultdescription
callbackPhaser.Types.Renderer.Snapshot.SnapshotCallbackNoThe function to call after the snapshot is taken.
typestringYes"'image/png'"The format of the image to create, usually image/png or image/jpeg.
encoderOptionsnumberYes0.92The image quality, between 0 and 1. Used for image formats with lossy compression, such as image/jpeg.
xnumberYes0The x coordinate to start the snapshot from.
ynumberYes0The y coordinate to start the snapshot from.
widthnumberYesThe width of the snapshot.
heightnumberYesThe height of the snapshot.
getPixelbooleanYesfalseIs this a snapshot to get a single pixel, or an area?
isFramebufferbooleanYesfalseIs this snapshot grabbing from a frame buffer or a canvas?
bufferWidthnumberYesThe width of the frame buffer, if a frame buffer grab.
bufferHeightnumberYesThe height of the frame buffer, if a frame buffer grab.

Type: object

Member of: Phaser.Types.Renderer.Snapshot

Source: src/renderer/snapshot/typedefs/SnapshotState.js#L1
Since: 3.16.1