Author Topic: Tween Position doesn't work correctly  (Read 3976 times)

mkgame

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Tween Position doesn't work correctly
« on: November 24, 2014, 07:35:07 AM »
NGUI version: 3.7.6p2

UIRoot:
  scaling style: Constrained
  content width: 1920, not fit
  content heigh: 1080, fit

UICamera:
  event type: 3D UI
  event mask: everything (i guess this is not important in this case)
  events go to...: Rigidbodies

Camera:
  projection: perspective

Tween Position on a game object, which has an UIWidget and Box Collider.

(Probably a dump settings options would be nice, when we report our problems.)

Hello,

first at all, thank you for this GUI solution, it works and it is stable in comparism of lot of another assets in the asset store. However, i have a problem with the Twenn Position. The widget (directly under the root) itself i move has an Unified Anchor, which is moved right side out of the view. After reversing the Tween Position tween, the base position of my widget is somewhere else. It depends on the resolution where the widget position is after reversing the tween. I control the tween with a button with the UIPlay Tween script, which is in toggle mode.

Thanks in advance
« Last Edit: November 24, 2014, 07:41:28 AM by mkgame »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween Position doesn't work correctly
« Reply #1 on: November 25, 2014, 01:23:40 AM »
Tween position works with fixed values, and moves widgets by adjusting the position of the item. Anchors also adjust the position. If you use one, don't use the other.

mkgame

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Tween Position doesn't work correctly
« Reply #2 on: December 22, 2014, 08:21:30 AM »
Tween position works with fixed values, and moves widgets by adjusting the position of the item. Anchors also adjust the position. If you use one, don't use the other.

Thanks for your answer!

I try to move from the right side a window in the screen, if i select a building and reverse it (hide it), if i do not select anymore the building. The rotating tween works correctly because the pivot point doesn't change. I believe that what i want to do is quite simple, i just don't know how can i solve it in a good way. How would you do it? (Probably an invisible widget on the top of the widget without collider, just for anchoring. And then i just move the content on the widget - without anchoring - outside of the screen?)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween Position doesn't work correctly
« Reply #3 on: December 22, 2014, 10:37:29 AM »
I don't understand your last post. This in particular: "I try to move from the right side a window in the screen, if i select a building and reverse it (hide it), if i do not select anymore the building."