Author Topic: UI with Tween Problems  (Read 1800 times)

Tomleung

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
UI with Tween Problems
« on: January 09, 2015, 08:28:24 AM »
Suppose I use some UI elements with anchors (or constrained), which means the transform of these UI elements would change base on some conditions.

So if I want to use Tween Scripts provided on NGUI with these UI elements, would it be the problems because I can't write the exact transform position on the inspector?

How should I suppose to do?

Sorry for my poor English! Thank you!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI with Tween Problems
« Reply #1 on: January 10, 2015, 12:24:34 PM »
Anchored elements can be animated using NGUI's tweens, but you may want to anchor a container instead, then animate actual widgets that are children of that container.

Tomleung

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: UI with Tween Problems
« Reply #2 on: January 11, 2015, 10:48:21 AM »
Anchored elements can be animated using NGUI's tweens, but you may want to anchor a container instead, then animate actual widgets that are children of that container.

If I understand correctly of your advice, I have to make a container and anchor it, and then make the UI elements  be the childs of the container then I could solve the tween problems? The container would have the exact transform position so that I can use Tween Script on it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI with Tween Problems
« Reply #3 on: January 12, 2015, 01:15:32 AM »
The problem would be solved because all children would be automatically moved due to the parent being anchored. You can put tweens on the children without worrying about the anchoring this way.