Link Search Menu Expand Document

text

Display text. More properties at A-Frame Text.

This is the schema for Text, the properties of wire object type text.

All wire objects have a set of basic attributes {object_id, action, type, persist, data}. The data attribute defines the object-specific attributes

Text Properties

Attribute Type Default Description Required
object_type string; Must be: text text 3D object type. Yes
align string; One of: ['left', 'center', 'right'] 'left' Multi-line text alignment. No
alphaTest number 0.5 Discard text pixels if alpha is less than this value. No
anchor string; One of: ['left', 'right', 'center', 'align'] 'center' Horizontal positioning. No
baseline string; One of: ['top', 'center', 'bottom'] 'center' Vertical positioning. No
color string '#000000' Text color. Yes
font string; One of: ['aileronsemibold', 'dejavu', 'exo2bold', 'exo2semibold', 'kelsonsans', 'monoid', 'mozillavr', 'roboto', 'sourcecodepro'] 'roboto' Font to render text, either the name of one of A-Frame’s stock fonts or a URL to a font file. Yes
letterSpacing number 0 Letter spacing in pixels. No
opacity number 1 Opacity, on a scale from 0 to 1, where 0 means fully transparent and 1 means fully opaque. No
shader string; One of: ['portal', 'flat', 'standard', 'sdf', 'msdf', 'ios10hls', 'skyshader', 'gradientshader'] 'sdf' Shader used to render text. No
side string; One of: ['front', 'back', 'double'] 'double' Side to render. Yes
tabSize number 4 Tab size in spaces. No
text string ~~~~ DEPRECATED: data.text is deprecated for object_type: text, use data.value instead. No
transparent boolean True Whether text is transparent. No
value string 'Default Text' The actual content of the text. Line breaks and tabs are supported with \n and \t. Yes
whiteSpace string; One of: ['normal', 'pre', 'nowrap'] 'normal' How whitespace should be handled. No
wrapCount number 40 Number of characters before wrapping text (more or less). No
xOffset number 0 X-offset to apply to add padding. No
zOffset number 0.001 Z-offset to apply to avoid Z-fighting if using with a geometry as a background. No

Entity Properties

Attribute Type Default Description Required
parent string   Parent’s object_id. Child objects inherit attributes of their parent, for example scale and translation. No
position Position   3D object position. Yes
rotation Rotation   3D object rotation in quaternion representation; Right-handed coordinate system. Euler degrees are deprecated in wire message format. Yes
scale Scale   3D object scale. No
visible boolean True Whether object is visible. Property is inherited. No