Hello Guest

Author Topic: About TextMesh  (Read 3333 times)

flowzaz

  • Newbie
  • *
  • Posts: 4
    • View Profile
About TextMesh
« on: January 10, 2014, 07:07:55 am »
how to make the background picture's size fit with the input word ?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About TextMesh
« Reply #1 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.