Author Topic: move widget with anchor without using tween  (Read 7098 times)

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
move widget with anchor without using tween
« on: November 03, 2014, 04:42:35 PM »
Hi I'm having trouble on how to find the correct solution, I want to move using transform.localPosition, an anchored widget, but without success. The only way I found that this was possible is with tween position, but I think that is too much to just move a widget to a desired position.

With the old stretch system I can do this without trouble because it just stretch and doesn't anchor the widget, but with this new system I can't do what I need.

Any ideas?

Rajken

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 12
    • View Profile
Re: move widget with anchor without using tween
« Reply #1 on: November 04, 2014, 03:59:10 AM »
You could use the same function that the TweenPosition uses.
NGUIMath.MoveRect. So you will need to calculate the different from current localPosition to new localPosition