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.

Text, Stickers & 2D Graphics

Stickers, speech bubbles, frames, and on-screen text and graphics.

Made with this block

Inputs

textstring

the 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}"

fontint

An 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.
colorvec4

the color of the text.

positionvec2
sizefloat
rotationfloat

the rotation of the text in degrees (min - 0, max - 360)

outlineEnabledboolean

whether to enable the outline of the text.

outlineColorvec4

the color of the outline.

outlineThicknessfloat

the thickness of the outline. 0 is no outline, 1 is maximum outline.

alignmentint

An integer from 0 to 2 specifying text horizontal alignment: 0 – Left 1 – Center 2 – Right Use Center by default.

editableboolean

Set 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.

backgroundEnabledboolean

whether to enable the background of the text.

backgroundColorvec4

the color of the text's background.

backgroundScalefloat

the 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.

backgroundRoundnessfloat

the roundness of text's background. min - 0 (no roundness), max - 1 (full roundness)

shadowEnabledboolean

whether to enable the shadow of the text.

shadowColorvec4

the color of the shadow.

shadowOffsetXfloat

the 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.

shadowOffsetYfloat

the 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.

textWrapboolean

whether text is wrapped

customFontfont

Use this if user explicitly provided font to use

boundsvec4

Normalized 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.

textSizefloat

Font 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

forceSafeRegionvoid

Forces 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.