See the demo page here, using Three.js version r107.
Inspired by https://stemkoski.github.io/Three.js/Sprite-Text-Labels.html
Download and include threejs-text-sprite.js
in your page after three.js
<script src="path/to/three.min.js"></script>
<script src="path/to/threejs-text-sprite.js"></script>
then call generateTextSprite
function to generate the sprite
var textSprite = generateTextSprite(myText, myConfig);
property | default value |
---|---|
fontFace | 'Ariel' |
fontSize | 18 |
fontColor | 'rgba(0, 0, 0, 1)' |
fontBold | false |
fontItalic | false |
textAlign | 'left' |
borderThickness | 4 |
borderColor | 'rgba(0, 0, 0, 1)' |
borderRadius | 0 |
backgroundColor | 'rgba(255, 255, 255, 1)' |