Author Topic: UIInput Issue with clamp content  (Read 2142 times)

justinISO

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 52
    • View Profile
UIInput Issue with clamp content
« on: February 03, 2014, 11:15:55 AM »
Hello,

I have an issue with UIInput giving me some strange behavior. I am building for iPad, both Retina and Standard and I have a log in page that takes a username and password. I have a UIInput on a UILabel for both username and password and I clamp the content of the username to the width of 190.

Everything works fine on the SD version. However, when I switch to Retina, and switch to the HD font that is twice the size with the atlas pixel size set to 0.5 the label clamps at about half way through. So it is like the width is not taking in to account that the pixel size of the font is at 0.5. Is there a way I can fix this?

Thanks,
Justin

justinISO

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 52
    • View Profile
Re: UIInput Issue with clamp content
« Reply #1 on: February 03, 2014, 11:24:06 AM »
Sorry I fixed it. In UIInput.UpdateLabel I just modded this section to calculate different for HD and it seems to be working fine.

  1. int retscale = 1;
  2. if(Screen.width > 1024){
  3.         retscale = 2;
  4. }
  5. string fit = label.font.GetEndOfLineThatFits (processed, label.width*retscale, false, UIFont.SymbolStyle.None);
  6.