Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Snapshot
Phaser.Renderer.Snapshot

Methods

<static> Canvas(sourceCanvas, config)
Focus
Focus

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:

name type description
sourceCanvas HTMLCanvasElement

The canvas to take a snapshot of.

config Phaser.Types.Renderer.Snapshot.SnapshotState

The snapshot configuration object.

Examples:
Since: 3.0.0
Focus
Focus
<static> WebGL(sourceCanvas, config)
Focus
Focus

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:

name type description
sourceCanvas HTMLCanvasElement

The canvas to take a snapshot of.

config Phaser.Types.Renderer.Snapshot.SnapshotState

The snapshot configuration object.

Examples:
Since: 3.0.0
Focus
Focus