How to get text from Textgeometry

Hii,
can we get text that we enter from textgeometry which we have added in scene.as shown in code below.I want the HELLO text from textgeometry.

textGeo = new THREE.TextGeometry( “HELLO”,
{
font: font,
size: size,
height: height,
curveSegments: curveSegments,
bevelThickness: bevelThickness,
bevelSize: bevelSize,
bevelEnabled: bevelEnabled,
material: 0,
extrudeMaterial: 1
});

second question is that can we dynamically change the Text .I had seen the examples of three.js Text where we can dynamically add text but every time we have to add and remove the textmesh again and again.Is there any other way to do this.

Thanks & Regards
Akshay.

The best way to figure this kind of thing out, if it’s not obvious from the documentation, is to log your object to the console.

If you do console.log( textGeo ), you’ll be able to investigate the object and see how you can access the parameters.

In this case, it looks like you should be able to get the text from textGeo.parameters.text.

1 Like