Phaser API Documentation

  Version: 
snapshotArea([x], [y], [srcWidth], [srcHeight], [destWidth], [destHeight])

Description:

Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, which is then returned. You can optionally resize the grab by passing a different destWidth and destHeight.

This method returns a reference to the Video.snapshotTexture object. Calling this method multiple times will overwrite the previous snapshot with the most recent one.

Parameters:

name type arguments description
x number <optional>

The horizontal location of the top-left of the area to grab from.

y number <optional>

The vertical location of the top-left of the area to grab from.

srcWidth number <optional>

The width of area to grab from the video. If not given it will grab the full video dimensions.

srcHeight number <optional>

The height of area to grab from the video. If not given it will grab the full video dimensions.

destWidth number <optional>

The destination width of the grab, allowing you to resize it.

destHeight number <optional>

The destination height of the grab, allowing you to resize it.

Since: 3.20.0