Text On Screen
Adds text anywhere on the screen, at the size, angle and color you choose. Anyone who opens the Lens can edit the words, if you ask for that.
Stickers, speech bubbles, frames, and on-screen text and graphics.
Made with this blockInputs
textstringthe text content of the object. Avoid literal descriptions or names, e.g. for a star wars lens, do not write "Darth Vader", instead write "May the force be with you". You can include dynamic placeholders that will be replaced with real user data: - {name} -> user's display name - {location} -> user's current location - {date} -> current date - {time} -> current time For example: "My name is {name}"
fontintAn integer value between 0 and 11 where each font is a style according to this list:
12 values
- -1
- Custom - set ONLY when user provided asset of font exists.
- 0
- Regular - A basic classic font
- 1
- Casual - Informal and relaxed; use for easygoing, conversational contexts.
- 2
- Headline - Bold and attention-grabbing; ideal for titles or headers.
- 3
- Comic - Fun and playful; suitable for light-hearted prompts.
- 4
- Bold - Strong and impactful; use for emphasis and importance.
- 5
- Playful – Rounded and warm; creates a friendly, cheerful tone.
- 6
- Retro – Bold and narrow; evokes a vintage poster style.
- 7
- Handwritten – Loose and expressive; adds a personal, creative touch.
- 8
- Grand, Elegant - Sophisticated and classy; suited for formal or luxurious prompts.
- 9
- Art Deco - Stylish and geometric; ideal for chic, artistic prompts.
- 10
- Quirky – Whimsical and artistic; adds personality and charm. Consistency: when a lens contains more than one Text On Screen block, use the same font value for all of them unless the user explicitly asks for different fonts.
colorvec4the color of the text.
positionvec2sizefloatrotationfloatthe rotation of the text in degrees (min - 0, max - 360)
outlineEnabledbooleanwhether to enable the outline of the text.
outlineColorvec4the color of the outline.
outlineThicknessfloatthe thickness of the outline. 0 is no outline, 1 is maximum outline.
alignmentintAn integer from 0 to 2 specifying text horizontal alignment: 0 – Left 1 – Center 2 – Right Use Center by default.
editablebooleanSet to true to allow the lens' users to change the value string of the Text On Screen. editable should be set to true ONLY when the user is asking for the editable option, otherwise set to false or leave default.
backgroundEnabledbooleanwhether to enable the background of the text.
backgroundColorvec4the color of the text's background.
backgroundScalefloatthe scale of background. min - 0, max - 1. when 0 - the background is the same size as text, when 1 - the background is about half bigger than text.
backgroundRoundnessfloatthe roundness of text's background. min - 0 (no roundness), max - 1 (full roundness)
shadowEnabledbooleanwhether to enable the shadow of the text.
shadowColorvec4the color of the shadow.
shadowOffsetXfloatthe offset of the drop shadow in x direction. min value is -1, max value is 1. when shadowOffsetX is 0, the shadow is aligned with the text by X axis.
shadowOffsetYfloatthe offset of the drop shadow in y direction. min value is -1, max value is 1. when shadowOffsetY is 0, the shadow is aligned with the text by Y axis.
textWrapbooleanwhether text is wrapped
customFontfontUse this if user explicitly provided font to use
boundsvec4Normalized screen-space bounding box [left, top, right, bottom]. [0,0] is top-left, [1,1] is bottom-right. Use this for all placement and layout sizing. Text wraps inside this box and is truncated if it exceeds the box height. Keep left < right and top < bottom.
textSizefloatFont size in Lens Studio text points. This controls glyph size only; bounds controls where the text box is and how much space it has. Use 24-36 for normal captions, 40-56 for short titles, and 16-24 for compact HUD text.
Functions
forceSafeRegionvoidForces text to stay in the screen if text content is set dynamically. Should only be used if text is not meant to have an animated position, rotation or scale as part of the experience and if the text content itself (.text) is changed in code.
More in Text, Stickers & 2D Graphics
- Comic StripStacks your pictures into a vertical comic strip that you scroll through. Add your own images, or say what each panel shows, for example a short story about a lost dog.
- Decorative Camera OverlayAdds a decorative layer on top of the camera picture, such as sparkles, confetti or falling snow. Pick from a set of ready-made effects, for example a night sky of stars.
- Lens Frame 2DAdds a flat border around the edge of the screen. Say what the border should look like, for example a film strip or a ring of flowers.
- Sprite ManagerMoves the flat pictures in a 2D game and tells you when two of them touch. Use it with Sprite Store, which holds the pictures it shows.
- Sticker On FacePuts one flat sticker on your forehead or cheek, and it follows your face as you move. Say what the sticker shows, for example a heart or a banana.
- Sticker On ScreenPuts one sticker on the screen at the position, size and angle you choose. Say what the sticker shows and where it sits, for example a heart in the top corner.
- Text On HeadAdds text that floats above your head and follows it as you move. Choose the words, the font, the color and whether the text has an outline, a shadow or a background.
