Hide UI when taking Snapshot


#1

Hello!

I’ve implemented a Snapshot button for the player to save and share pics with the AR content we’ll be using. But for some reason I’m unable to hide UI buttons (including the one to take the photo) on the picture.

Is it possible to do so?
Does anyone have any suggestion?


#2

Put all your UI in a group and make a state controller with a “hidden” and “visible” state. Set the ‘visible’ property of your UI group to enabled and disabled respectively. Now activate the hidden state before you take the snapshot and activate the visible state after the screenshot has been taken (maybe you need to do this after a delay, since it takes a moment for the device to take the screenshot? In that case you can use Z.after()).
An easy way to do this is by dragging the controller state into the correct place in the screenshot script (the script for the UI button), this will automatically generate the code.

Hope this helps!


#3

Thanks for your reply!

That’s exactly what I was trying to do, although I didn’t know about the Z.after (that was what was missing!)

I will try to implement this solution later on.

Appreciate your help!


#4

No worries :wink: