Author Topic: Adjust UIPanel clipping center  (Read 3850 times)

Altaf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Adjust UIPanel clipping center
« on: March 18, 2014, 07:40:56 AM »
Hello,
I have a menu, I add items to this menu by parsing a xml file. I read height & width of the widgets form the xml & set them accordingly. I am having trouble with UIPanel clipRange.
When I add the items dynamically I need to adjust the baseClipRegion. Because of this, the UIPanel`s clipping center changes. I have set my menu such that only one item is visible at a time.
When I set the UIPanel.baseClipRegion, center changes & the widget gets clipped on either side. How do I calculate this?


Thanks,
  Altaf

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adjust UIPanel clipping center
« Reply #1 on: March 18, 2014, 07:05:40 PM »
NGUIMath.ResizeWidget can be used to gently adjust the size of any widget or panel. You can also have a panel be anchored to a widget, and just change the size of the widget.

Altaf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Adjust UIPanel clipping center
« Reply #2 on: March 20, 2014, 03:42:09 PM »
Thank you so much. Setting the anchor fixed my problem.

Thanks again,
   Altaf