Namespace: Snapshot

Phaser.Renderer. Snapshot

Methods


<static> Canvas(canvas [, type] [, encoderOptions])

[description]

Parameters:
Name Type Argument Default Description
canvas HTMLCanvasElement

[description]

type string <optional>
'image/png'

[description]

encoderOptions number <optional>
0.92

[description]

Since: 3.0.0
Source: src/renderer/snapshot/CanvasSnapshot.js (Line 7)
Returns:

[description]

Type
HTMLImageElement

<static> WebGL(sourceCanvas [, type] [, encoderOptions])

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

Parameters:
Name Type Argument Default Description
sourceCanvas HTMLCanvasElement

The canvas to take a snapshot of.

type string <optional>
'image/png'

The format of the returned image.

encoderOptions number <optional>
0.92

The image quality, between 0 and 1, for image formats which use lossy compression (such as image/jpeg).

Since: 3.0.0
Source: src/renderer/snapshot/WebGLSnapshot.js (Line 7)
Returns:

A new image which contains a snapshot of the canvas's contents.

Type
HTMLImageElement