Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: e-tip on July 02, 2014, 08:46:33 AM

Title: [SOLVED] two scrollviews position tween problem
Post by: e-tip on July 02, 2014, 08:46:33 AM
Solved : maybe not the better way but i've created a widget as parent of the two scrollviews and i tween that widget instead of animating the scrollviews
Hi everyone.
I've just bought ngui and i'm in the middle of rebuild the gui of a game i've already made with unity using OnGUI functions.
I'm having a strange issue when tweening Scrollviews.
i've got a uiPanel that contains two scrollviews one on the side of the other.
both scrollviews contains buttons added via code dynamically.
(http://i62.tinypic.com/2mhvv6e.jpg)
I've added a code that handle the button click that calls this function
  1.        
  2.                 if (!showingSubMaterialMenu) {
  3.                         showingSubMaterialMenu = true;
  4.                         materialScrollView.GetComponentInChildren<TweenPosition>().PlayForward();
  5.                         subMaterialScrollView.GetComponentInChildren<TweenPosition>().PlayForward();
  6.                 } else {
  7.                         showingSubMaterialMenu = false;
  8.                         materialScrollView.GetComponentInChildren<TweenPosition>().PlayReverse();
  9.                         subMaterialScrollView.GetComponentInChildren<TweenPosition>().PlayReverse();
  10.                 }
  11.         }
materialScrollView is the first scrollview and subMaterialScrollView is the second.
if this function is called by the click on the button i get strange scrollview positioning as you can see from this image
(http://i60.tinypic.com/10i9y8n.png)
For testing purposes i've adedd to OnStart
  1. Invoke("toggleMenuSection",2);Invoke("toggleMenuSection",4);Invoke("toggleMenuSection",6);Invoke("toggleMenuSection",8);

and i can see that the scrollviews moves as i expect.
(http://i58.tinypic.com/rixhsm.png)
Does anyone have any suggestions ?

Thank you very much

Edit : after i've investigated a little deeper seems that is something related to the drag of the scroll view and the tween