TextComponent

TextComponent

Stores a font and handles the text mesh on an entity
Depends on opentype.js

Constructor

new TextComponent()

Methods

setFont(font) → {TextComponent}

Set the font of this component

Parameters:
Name Type Description
font

The font loaded through opentype.js

setText(text, optionsopt) → {TextComponent}

Set the text to generate the mesh for; recomputes the mesh

Parameters:
Name Type Attributes Description
text string
options Object <optional>
Properties
Name Type Attributes Default Description
extrusion number <optional>
4

Extrusion amount

fontSize number <optional>
48
stepLength number <optional>
1

Lower values result in a more detailed mesh