Snapshot

.Renderer. Snapshot

Type Definitions

SnapshotCallback(snapshot)

Since:
  • 3.16.1
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.

SnapshotState

Since:
  • 3.16.1
Properties:
Name Type Attributes Default Description
callback Phaser.Types.Renderer.Snapshot.SnapshotCallback 拍摄快照后要调用的函数.
type string <optional>
'image/png' 要创建的图像的格式,通常为 `i image/png` 或 `i image/jpeg` .
encoderOptions number <optional>
0.92 图像质量,介于0和1之间.用于有损压缩的图像格式,如 `i image/jpeg` .
x number <optional>
0 开始快照的x坐标.
y number <optional>
0 开始快照的y坐标.
width number <optional>
快照的宽度.
height number <optional>
快照的高度.
getPixel boolean <optional>
false 这是获取单个像素的快照,还是一个区域?
isFramebuffer boolean <optional>
false 这是从帧缓冲区还是画布中抓取快照?
bufferWidth number <optional>
帧缓冲区的宽度,如果是帧缓冲区抓取.
bufferHeight number <optional>
框架缓冲区的高度,如果框架缓冲区抓取.
Type:
  • object