Catch the moment when user takes a snap
I must hide some UI elements the frame before the user takes a snap. To achieve this I need a sort of event firing and register a listener (or any other mechanisms). I was expecting this to be available as a SceneEvent among the ones listed here or as a Camera callback but it isn't?
So is there a way to catch the moment when the user takes a snap to execute some code just before the snap is actually taken?
This is possible using one of the global methods.
global.scene has an isRecording() method that returns true when the user takes/is taking a video or a picture. If you put it in an update event it will fire the moment they take the picture.
https://lensstudio.snapchat.com/api/classes/ScriptScene/
```
```
This is possible using one of the global methods.
global.scene has an isRecording() method that returns true when the user takes/is taking a video or a picture. If you put it in an update event it will fire the moment they take the picture.
https://lensstudio.snapchat.com/api/classes/ScriptScene/
Hi Steaq,
Yep, you can do this by checking global.scene.isRecording() on update and calling your functions if it's true.
For example:
Let me know if you need any clarification! Can't wait to see what you come up with.
Cheers,
Jon