Phaser API Documentation

  Version: 
snapshotPixel(x, y, callback)

Description:

Takes a snapshot of the given pixel from this Render Texture.

The snapshot is taken immediately.

To capture the whole Render Texture see the snapshot method. To capture a specific portion, see snapshotArea.

Unlike the other two snapshot methods, this one will send your callback a Color object containing the color data for the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, using less memory, than the other snapshot methods.

Parameters:

name type description
x number

The x coordinate of the pixel to get.

y number

The y coordinate of the pixel to get.

callback Phaser.Types.Renderer.Snapshot.SnapshotCallback

The Function to invoke after the snapshot pixel data is extracted.

Returns:
Description:

This Render Texture instance.