Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How to position a left-justified text object?

Is there any way to position the left edge of a text object's bounding box to a certain coordinate, regardless of the length of the text string?  I originally figured I'd just create the text object, then read its width and calculate the left-side coordinates accordingly... but this 3-year-old (!) bug report suggests it's not possible to do this. Short of creating a lookup table for the pixel-widths of every letter in the alphabet for the variable-width fonts, have there been any creative developments on how to left-align text objects?
1495470686
The Aaron
Pro
API Scripter
So, there is one work around you can use.  Checkout the Dungeon Buddies inspired chat bubble script.  It sets the font to an unknown value, which causes the font to be a fixed width font which you can predict the spacing for. On a side note, I wrote a script one time to try and build a width estimator based on the size of 3-letter strings... didn't really work out well, too many factors to get a good estimate...