2D Toolkit Forum
2D Toolkit => Support => Topic started by: DemiGoth on May 23, 2015, 03:26:34 pm
-
I'm looking for a way to calculate the size in pixels of a TextMesh. I know that fonts like Courier have a fixed width, but others like Times New Roman don't. It's for those fonts that I need to know the length in pixels of the text written...
-
Nvm, got it figured out -> GetEstimatedMeshBoundsForString(string str). And from the looks of it, it's quite accurate as well. Now it's time to get building the ticker I want to make ;-)
-
Yup thats it. Its not 100% accurate as the name suggests but its very very close :)
-
Yup thats it. Its not 100% accurate as the name suggests but its very very close :)
Close enough for me. Just add an extra 10px and it should be fine (I hope ;) )