Skip to main content
Version: Phaser v4.0.0-rc.6

Phaser.Renderer.Snapshot

Scope: static

Source: src/renderer/snapshot/index.js#L7

Static functions

Canvas

<static> Canvas(sourceCanvas, config)

Description:

Takes a snapshot of an area from the current frame displayed by a canvas.

This is then copied to an Image object. When this loads, the results are sent

to the callback provided in the Snapshot Configuration object.

Parameters:

nametypeoptionaldescription
sourceCanvasHTMLCanvasElementNoThe canvas to take a snapshot of.
configPhaser.Types.Renderer.Snapshot.SnapshotStateNoThe snapshot configuration object.

Source: src/renderer/snapshot/CanvasSnapshot.js#L11
Since: 3.0.0


WebGL

<static> WebGL(sourceContext, config)

Description:

Takes a snapshot of an area from the current frame displayed by a WebGL canvas.

This is then copied to an Image object. When this loads, the results are sent

to the callback provided in the Snapshot Configuration object.

Parameters:

nametypeoptionaldescription
sourceContextWebGLRenderingContextNoThe WebGL context to take a snapshot of.
configPhaser.Types.Renderer.Snapshot.SnapshotStateNoThe snapshot configuration object.

Source: src/renderer/snapshot/WebGLSnapshot.js#L11
Since: 3.0.0