Take a Picture and Add/Generate a Billboard
Is there a way to have the user take a picture that generates a billboard to the screen? Does the Fullscreen feature have the ability to do this?
I have a interactive path template set up. I want the ability to generate a billboard on top of a picture that is taken. Are there any Take Picture events that can be scripted out?
Any help would be awesome!
Hi Nicolas! This is definitely possible. First, we'll create a new camera and camera texture that will represent our photo taking. Then, we'll create a billboard that utilizes this camera's texture. We'll then show the billboard when the "photo is taken". And this is very similar to how the freeze camera textures work in the Fullscreen template. I'll walk through how to set this up.
Then, to take a photo, you need to create a simple script to turn off the camera (which freezes the camera texture) and turn on the billboard. Here's a quick script to do that which I bound to the tapped event so that when you take the screen, it takes the picture and shows the billboard. Note, this script assumes you've turned off the billboard (unchecked) in the objects panel.
Hello Travis!
Wow! Thank you so much. I am going through this right now and am wondering what tapped event you are referring to. Are you referring to a tapped event inside of one the provided scripts in Interactive tap?
Also, when you're assigning the billboard's texture to your newly created camera texture, are you assigning it to the Orthographic camera set up with the billboard? Or are you using a sprite with your new camera?
https://www.reddit.com/r/SnapLenses/comments/7qrp7j/tutorial_how_to_add_freeze_frame_works_on_all/
This might also lead to the right direction. I am thinking that you want me to assign the script to the sprite within the Billboard setup. I just need clarification. :)
Also, I can't really seem to find a script that activates events when you take a picture with the camera. Is there a piece of script that I can set Events with taking pictures with the camera?
For example, If the user takes picture then activate Billboard. The user is going to be using "Tapped" to trigger the Tapped Event the Character plays in the Interactive Play. I want to trigger the Billboard when the user takes a picture, not by tapping once on the screen because I need that function to play animation.
Hey Nick! I went ahead and created a sample project of this. You can download it here:
https://storage.googleapis.com/snapchat-lens-assets/f1a09194-f02d-43ed-92b8-62e843179ff0/lensStudio/Forum-Helpers/TakePhotoOnTap.zip
Hope that helps!
Travis - is there any way that I can lock the shape of the billboard? I need my snapshot billboard (which I've resized to a square using the aligner width and height) to line up on top of a graphic on the billboard behind it, but when switching devices in the preview it is making the snapshot billboard stretch (the shape is still filled, but it is a horizontal rectangle, for example, instead of the original square).
iPhone8 Preview (Correct):
Galaxy 8 Preview (incorrect):
Settings:
Thanks!
Hi Jessie!
That's awesome that you're checking device resolutions! It's definitely important for a good user experience.
The issue is that because our billboard is in Fill mode, parts of the image is cropped out of the screen when the resolution changes. As a result the corresponding binding point of our sprite would be different!
The Face in Sprite template actually solves this problem by doing math to account for this. We can modify the script to allow us to reposition sprites instead of just face insets.
Take a look at this example project which contains the modified script.
All you have to do is use the script, and add your sprite visuals and billboard to it:
Let me know if you need any clarification!
Thanks,
Jonathan
You can see the result below:
On iPhone8
on Blackberry KEYone without the script:
on Blackberry KEYone WITH the script: