From 9ceedcdaded0b43fb451ef90ca9aea532e2ce46c Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Thu, 17 Sep 2020 22:47:32 +0200 Subject: [PATCH] text align --- src/meshes/Text.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/meshes/Text.js b/src/meshes/Text.js index a96b723..3a5611b 100644 --- a/src/meshes/Text.js +++ b/src/meshes/Text.js @@ -15,6 +15,7 @@ export default { bevelSize: { type: Number, default: 8 }, bevelOffset: { type: Number, default: 0 }, bevelSegments: { type: Number, default: 5 }, + align: { type: [Boolean, String], default: false }, }, created() { const loader = new FontLoader(); @@ -32,6 +33,11 @@ export default { bevelOffset: this.bevelOffset, bevelSegments: this.bevelSegments, }); + + if (this.align === 'center') { + this.geometry.center(); + } + this.initMesh(); }); },