Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered.
To capture the whole game viewport see the
snapshot method. To capture a specific pixel, see
Only one snapshot can be active per frame. If you have already called
snapshotPixel, for example, then
calling this method will override it.
Snapshots work by using the WebGL
readPixels feature to grab every pixel from the frame buffer into an ArrayBufferView.
It then parses this, copying the contents to a temporary Canvas and finally creating an Image object from it,
which is the image returned to the callback provided. All in all, this is a computationally expensive and blocking process,
which gets more expensive the larger the canvas size gets, so please be careful how you employ this in your game.
The x coordinate to grab from.
The y coordinate to grab from.
The width of the area to grab.
The height of the area to grab.
The Function to invoke after the snapshot image is created.
The format of the image to create, usually
The image quality, between 0 and 1. Used for image formats with lossy compression, such as
This WebGL Renderer.