Skip to main content

<text>

Displays text.

Props

PropTypeDescriptionDefault
valueStringText to display.
colorStringText color.black
fontStringURL to woff font, eg from Google Fonts CDN.Roboto
fontSizeNumberFont size.0.1
lineHeightStringText line height.1.4
maxWidthNumberMaximum width of the block before text wraps. Default is none.
whiteSpaceStringSet to nowrap if you don't want text to wrap.
alignStringAlignment of text. left, center or rightleft
anchorXStringThe horizontal anchor origin.center
bgColorStringWhen set, a plane is rendered behind the text.
bgRadiusNumberThe background plane radius. Similar to CSS border-radius.
paddingNumberThe background padding/inset. Can be a single number or array of numbers. works the same as CSS shorthand.
positionArrayPosition of the text.[0,0,0]
rotationArrayRotation of the text.[0,0,0]
scaleNumber|ArrayScale of the text. Use an array for non-scalar scale.1
onPointerDownFunctionCalled when avatar presses the pointer down over this object.
onPointerDownHintStringText displayed when hovering over this object when onPointerDown is defined.
onPointerUpFunctionCalled when avatar releases the pointer over this object.
onPointerUpHintStringText displayed when hovering over this object with the pointer down and onPointerUp is defined.
hitDistanceNumberMaximum distance to interact with this node.3

Notes

None