2D Toolkit Forum

2D Toolkit => Support => Topic started by: flowzaz on January 10, 2014, 07:07:55 am

Title: About TextMesh
Post by: flowzaz on January 10, 2014, 07:07:55 am
how to make the background picture's size fit with the input word ?
Title: Re: About TextMesh
Post by: unikronsoftware on January 10, 2014, 11:13:42 am
Get the size of the text mesh using textMesh.GetEstimatedMeshBoundsForString
Once you get the bounds, you can rescale the sprite / sliced sprite to match the bounds. Eg. by getting the bounds, then setting scale to the ratio between the two.