Skip to content

NgtsText3D

Credits: Text3D Alignment

NgtsText3D renders 3D text using TextGeometry

Usage

import { NgtsText3D } from 'angular-three-soba/abstractions';
<ngts-text-3d text="hello\nworld" [font]="fontUrl" />

Custom Material

NgtsText3D can accept custom material(s) via content projection.

<ngts-text-3d text="hello world" [font]="fontUrl">
<ngt-mesh-basic-material [color]="color()" />
</ngts-text-3d>

Alignment

You can align NgtsText3D by wrapping it with NgtsCenter component.

<ngts-center [options]="{ top: true, left: true }">
<ngts-text-3d text="hello\nworld" [font]="fontUrl" />
</ngts-center>

Inputs

name type description required
text string text to render yes
font string url of the font yes

Options

options input accepts any properties from THREE.Mesh and TextGeometryParameters in addition to the following:

Properties

name type description
bevelSegments number The number of vertical/horizontal segments that make up each glyph's rectangular plane. Default: 4
smooth number Merges vertices with a tolerance and calls computeVertexNormals()