Author Topic: NGUIText.CalculatePrintedSize  (Read 1962 times)

tinken

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
NGUIText.CalculatePrintedSize
« on: April 20, 2016, 08:54:03 AM »
Hi,

I use NGUIText.CalculatePrintedSize and I have an wrong return in this case:
using bitmapFont
overflow is ClampContent
alignment : center
multi lines enable.
If width is shorter than a long word, the long word will return to the next line. But when getting NGUIText.CalculatePrintedSize("MySuperMegaLongWord").y it give y as if the long word were on one line.
So when I remove some end letters to display ..., it does not because y is not correct.
Do you know how to fix this?

Thanks
Tinken

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUIText.CalculatePrintedSize
« Reply #1 on: April 20, 2016, 04:56:38 PM »
Before calling that function you need to actually set all the properties first using the label you want to use: UILabel's UpdateNGUIText() function.