Picture in Picture
Puts a frame with the live camera on the screen, with or without a border. Tap the frame to swap in a photo from your device.
Camera feed, hand and face tracking, touch, tilt, haptics, and sound.
Made with this blockInputs
positionvec2Position of photo. vec2 Center: [0, 0] Positions for placing photo in the corner calculate by next formula pos.x = ±(1 - scale.x/2) pos.y = ±(1 - scale.y/2) The sign depends on the corner: plus for right/top, minus for left/bottom.
scalevec2Scale of photo. vec2 [2.0,2.0] - fullscreen [1.0,1.0] - half screen Full width of screen = 2 Full height of screen = 2
rotationfloatPhoto rotation in degrees
frameModeintSelects which type of frame will be used. Values are: None = 0, Texture = 1, Color = 2
solidFrameColorvec4Use for color of frame. Use only vec4. This input relevant ONLY when input "frameMode" == 2
solidFrameWidthfloatUse for thickness of solid frame. Use max 0.2. 0 - no frame, 0.2 - maximum frame width This input relevant ONLY when input "frameMode" == 2
frameTexturetextureThe frameTexture is a decorative 2D border drawn AROUND the photo — it binds to the frame overlay, not the photo content. Put a border/frame graphic here: normally from the "Lens Frame 2D" generator, though a user-supplied 2D frame image is also fine. Relevant ONLY when frameMode == 1. It is NOT the displayed photo — this block has no build-time input for the content image (the photo is the live camera by default, or one the viewer picks from their device at runtime), so do not wire the main subject/content photo here expecting it to appear as the picture.
More in Camera, Audio & Sensors
- Device CameraGives your Lens the camera picture, live or frozen as a still. Your Lens can show that picture on a surface, or keep the still to use later.
- Face EventsMakes your Lens react when you open your mouth, smile, kiss, raise your eyebrows or tilt your head. It also tells the Lens where your eyes, nose and mouth are on screen.
- Face MLChanges your face with one ready-made effect, for example an anime look, a meme grin or a skull. Say the look you want, and your Lens keeps that one effect.
- FaceLandmarksFollows where your eyes, nose, mouth and forehead are, so a sticker or text can sit on them and move with you. Ask for hearts on your eyes.
- GyroscopeTurns tilting and shaking your phone into a control for your Lens. Ask for a tilt game, for example a maze where you roll a ball to the exit.
- Hand TrackingFollows your hands and reads gestures like a fist, a pinch, a thumbs up or a peace sign. Ask for something your hand controls, for example drawing with a pinch.
- HapticsMakes your phone vibrate at the moments you choose. Ask for a buzz when you tap the screen or score a point.
- Selfie WidgetShows a small live camera view on the screen, as a circle or a rectangle. Choose where it sits and how big it is, for example in the corner of a game.
- SoundPlays a sound in the Lens. Add the sound you want, and the Lens can start it, pause it and resume it.
- Touch EventsAdds tap, drag and swipe controls, so you touch the screen to control the Lens. Say what each touch does, for example tap to drop a coin.
- Voice ChangerChanges your voice while you speak. Ask for the effect you want, for example a deep voice, a robot, an alien or an echo.
- ZoomZooms the view in on any point of the screen, smoothly or held in place the whole time. Say where to zoom, how close, and whether it repeats back and forth.
