Open tobiasgeissler opened 2 years ago
@tobiasgeissler thanks for reaching out.
I believe you can adjust this sizing using the textHeight
attribute. F.e.:
myText.textHeight = 0.5;
Thanks for the suggestion. This works fine if there is no padding and/or borderWidth applied to the SpriteText but leads to problems in case there is one set:
@tobiasgeissler the size of the whole canvas element depends on the border and padding values, besides the textHeight
, as you can see here:
https://github.com/vasturiano/three-spritetext/blob/9f25aa5b886daec7128e28fffe40d4e06698bfb6/src/index.js#L89-L90
So you can try also decreasing those numbers to something within the range of textHeight
.
I have a use case where I don't want the sprite to change its size when rotating the camera around the scene. There is the sizeAttenuation property on the SpriteMaterial which can be disabled to achieve this. However, when I set the property to false on the SpriteText's material the object gets oversized due to the internal scaling. I get it to work by down-scaling the sprite again after it has been created, but it would be nice if there was a better way to handle this out-of-the-box.
Here is a fiddle to demonstrate the problem: https://jsfiddle.net/utdpc4bo/1/