I've been attempting to utilize a loaded typeface.js font, sourced from Three.js examples. However, I keep encountering the following error:
Uncaught TypeError: this.addShapeList is not a function
Upon inspecting the Three.js file, I'm using the build version from the three.js master branch. The cause of the error appears to be that THREE.ExtrudeGeometry
scoped this
does not include all previously declared prototype methods.
When trying to adjust the code to use
THREE.ExtrudeGeometry.addShapeList
instead of this.addShapeList
, it failed when reaching the THREE.ExtrudeGeometry.prototype.addShape
method as it couldn't recognize the vertices array within the scope.
Something must be amiss in my creation of the TextGeometry, but I can't seem to pinpoint the issue.
Below is the code snippet used to load the font, create the TextGeometry object, and add it to the scene:
loader.load('./fonts/gentilis_bold.typeface.js', function(response){
font = response;
var text = THREE.TextGeometry('Some Text', {
font: font,
size: 70
});
scene.add(text);
});
For further reference, here is a link to showcase the problem on JSFiddle.