I'm having trouble adding text in three.js. Whenever I try to use this code, it gives me an error saying
Uncaught TypeError: Cannot read property 'offsetX' of undefined
. Any suggestions on how to resolve this issue?
Feel free to check out my .json file.
var loader = new THREE.FontLoader();
loader.load( 'https://thefortcity.dev/build/fonts/FontAwesome_Regular.json', function (font) {
var textGeometry = new THREE.TextGeometry( "text", {
font: font,
size: 50,
height: 10,
curveSegments: 12,
bevelThickness: 1,
bevelSize: 1,
bevelEnabled: true
});
var textMaterial = new THREE.MeshPhongMaterial(
{ color: 0xff0000, specular: 0xffffff }
);
var mesh = new THREE.Mesh(textGeometry, textMaterial);
scene.add(mesh);
});