I'm trying to use a loaded typeface.js font, as provided by Three.js examples, yet I keep on getting the following error:
Uncaught TypeError: this.addShapeList is not a function
I've checked Three.js file, I'm using the build version from the three.js master branch, for the reasoning for the error and it seems that THREE.ExtrudeGeometry
scoped this
is missing all the prototype methods declared previously.
Altering the code to use THREE.ExtrudeGeometry.addShapeList
instead of this.addShapeList
failed later on when reaching method THREE.ExtrudeGeometry.prototype.addShape
by failing to recognize the vertices array of the scope.
I'm of course doing something wrong in creating the TextGeometry yet I'm unable to figure what.
This is the code I use to load the font, creating the TextGeometry object and adding 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);
});
Here is a fiddle to showcase my issue.
You forgot about the new
operator:
var text = new THREE.TextGeometry('Some Text', {
[ https://jsfiddle.net/kmny9gbc/ ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With