Author Topic: Generating NGUI from Code - How to align labels?  (Read 3495 times)

Vaei

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Generating NGUI from Code - How to align labels?
« on: January 18, 2014, 04:12:00 AM »
Hi,

I have started to create a script that generates labels & (soon) buttons based on how many inputs I have setup in a custom input manager, it is a screen to allow users to change their inputs.

Unfortunately since I can't tell the text to align to the left of the box they are all centred and it looks UGLY. I need them all aligned to the left.

How can I achieve this?

And also, why are dynamic fonts blurry/pixelated?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Generating NGUI from Code - How to align labels?
« Reply #1 on: January 18, 2014, 10:27:52 PM »
UITable can do that, or just use math yourself. If you know the dimensions of the widget, positioning the next one with an offset should be a trivial matter.

As for blurry/pixelated -- by default labels are set to shrink their content. You might want to change that to something else, such as "resize freely".