[SOLVED] Screenshot and mobile devices

Hi everyone !

Yet another question in the coding section :sweat_smile:

I’ve used this tutorial to add a screenshot feature : Capturing a screenshot | Learn PlayCanvas

This works nice, I managed to link the script to 2 different cameras, and it sends me base64 strings that I can use inside my eShop (to link it to a cart/order, etc.)

These are the 2 resulting screenshots :

But on some mobile devices, when the ratio of the canvas changes, the knife isn’t included entirely in the screenshot :

I tried to understand whats going on in this script and also the orbit-camera.js script, but I’m not yet good enough haha.
How can I make sure that the knife is always framed correctly?
Also is there any way of setting a specific resolution for the screenshots?

You can. Instead of using the device width and height in createNewRenderTexture, you can set the resolution to whatever you need it to be.

1 Like

Thanks :smiley: That did the trick
Also I’ve set a landscape ratio, and that also keeps the knife always framed!