Stretching a text in geoText COMP using distance between two tracked points

Hi,
i calculated distance between two moving points using blob tracking. When i tried to reference that value in scale in x in Geotext comp for a text, the stretch amount is too small not fitting the entire distance. When I multiply the distance with some integer, its fitting in between the points. but how to find that factor mathematically, so that whenever I edit the table of text for Geotext Comp, the stretching effect will be perfectly updated.?
Adding screenshots with and without the stretch factor:


Thank you

Hi @arunrajan,

you ocan calculate the width of the text using the Geo Text COMP’s .textWidth member. As you already know the distance between the two points, you should now be able to calculate the scaling factor.

cheers
Markus

1 Like

Thanks a lot Markus. Is there a way to know the textWidth, if we take the text via specificationDAT?

Hi @arunrajan

you can make use of the .evalTextSize() method of the Geo Text COMP by passing the string into the Method itself.

Hope this helps
Markus

I tried with .evalTextSize() initially but couldn’t figure out how to take the text from all cells in “text” column. I figured out a way with .evalTextSize() and a little bit of scripting.

Thanks for the help