Forum Discussion
Hexapuss_Steve
5 years agoHeroic Explorer
In game photo booth?
Is it possible via Unity script to trigger the Oculus save screenshot function so the player can save pictures with an in game button? Ideally the saved image will be from a separate pre-framed cam...
- 5 years agoI dont think oculus has an API for this but you can just do it through unity
it would look something like this
Then to save itRenderTexture rt = new RenderTexture(RES_WIDTH, RES_HEIGHT, 24);
RenderTextureCamera.targetTexture = rt;
Texture2D screenShot = new Texture2D(RES_WIDTH, RES_HEIGHT, TextureFormat.RGB24, false);
RenderTextureCamera.Render();
RenderTexture.active = rt;
screenShot.ReadPixels(new Rect(0, 0, RES_WIDTH, RES_HEIGHT), 0, 0);
screenShot.Apply();byte[] bytes = screenShot.EncodeToJPG();
System.IO.File.WriteAllBytes(filename, bytes));
Hexapuss_Steve
5 years agoHeroic Explorer
Thanks @MikeF , I will give your solution a go!
DM me if you'd like a free game code for my game Metal Multiball.
Cheers!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 7 years ago
- 1 year ago