three-spritetext
three-spritetext copied to clipboard
How to offset a text?
The text is always in the center of the node. How can I put it a little lower? Thanks
@benderlidze the module doesn't currently support offsets. But I'll gladly take a PR if you wish to upgrade it.
The offset value would be used to manipulate the fillText
position parameters at https://github.com/vasturiano/three-spritetext/blob/master/src/index.js#L63
Current behavior should remain the default to prevent any regression.
Sprite#center may be of assistance, though I don't know if it supports numbers out of [0;1] range.
wouldn't this be possible by manipulating the center
of the sprite? i get this when i set it to:
myText.position.set(x, y, z) // x, y, z is the top-center of the rectangle
myText.material.rotation = Math.PI / 8
myText.center = new THREE.Vector2(0, 0)

Couldnt you just use the position property to do the offset? Example here, https://github.com/protectwise/troika/tree/main/packages/troika-three-text#usage