Author Topic: Buttons size and alignment  (Read 4404 times)

jytu12

  • Guest
Buttons size and alignment
« on: August 14, 2012, 11:21:04 AM »
1) Is it possible to set right or left alignment for buttons?
See the picture: The target is to set the "Settings" button to the right of the screen and all other buttons should be relatively positioned to the right.

2) The second problem is a dynamic Button Collider size.
For example: I create a simple button and change the label text, now it's twice as longer, but the Box Collider is still the same. Is it possible to refresh the button somehow?

It looks like NGUI is designed for static content which is frustrating :(

« Last Edit: August 14, 2012, 11:54:45 AM by jytu12 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Buttons size and alignment
« Reply #1 on: August 14, 2012, 03:28:00 PM »
You can use UIAnchor to attach any object to the side of another.

NGUITools.AddWidgetCollider will update the collider size for you. All you need to do is call it after updating your text.