Author Topic: Best way to re-position UIPanel through script?  (Read 2917 times)

legend411

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Best way to re-position UIPanel through script?
« on: May 05, 2012, 11:30:51 PM »
I'm trying to move a UIPanel to the position of a UIButton, plus an offset, when the button is pressed. just setting UIPanel.transform.position to the button position seems to work fine, but when I try to add an offset to the x/y position, it seems to be using world units, not pixels, to position it. How can I add an offset in pixels?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Best way to re-position UIPanel through script?
« Reply #1 on: May 06, 2012, 08:48:18 AM »
If you set transform.position, then you're working in world coordinates. If you set transform.localPosition, then you're working in pixels.