You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…DPI size (#2208)
Closes#2203Closes#1528
This PR fixes an issue where screenshots did not work in the WebGL implementation, this is because internally the draw buffer is cleared when compositing is finished. One possible solution was to add `preserveDrawingBuffer: true` to the webgl context but this forces the browser to copy instead of swap internally which can negatively impact performance on certain platforms.
In order to grab the draw buffer while intact before the browser clears it, you must `await screenshot()` which will grab the next frame as an image.
In addition the default behavior is to have the screenshot pixel perfect match the display canvas resolution, optionally you can request the full scaled image on a HiDPI display with `screenshot(true)`
## Changes:
- Smallish breaking change to `screenshot()` making it async
- Default behavior is now to match the image screen shot to the game resolution in the hidpi case by default
Steps to Reproduce
To take a screenshot, I did the following:
Expected Result
A screenshot should be returned.
Actual Result
Returns an blank image.
Environment
Current Workaround
Use
useCanvasGraphicsContext
.The text was updated successfully, but these errors were encountered: