From 9b3ee31e827c860339cd5032fd396db971cb7d57 Mon Sep 17 00:00:00 2001 From: jayd Date: Sat, 27 Apr 2019 14:16:20 +0700 Subject: [PATCH] Add the font filepath option in BehaviorText --- public/js/primitives/BehaviorText.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/js/primitives/BehaviorText.js b/public/js/primitives/BehaviorText.js index 6c53536..3c8c36c 100644 --- a/public/js/primitives/BehaviorText.js +++ b/public/js/primitives/BehaviorText.js @@ -15,7 +15,8 @@ export class BehaviorText extends BehaviorMesh { super(props,blox) this.props = props var loader = new THREE.FontLoader(); - loader.load( 'fonts/helvetiker_bold.typeface.json', this.attachText.bind(this) ) + let font = props && props.font ? props.font : 'fonts/helvetiker_bold.typeface.json' + loader.load( font, this.attachText.bind(this) ) } attachText(font) {