Author Topic: why,popuplist postion error  (Read 11568 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: why,popuplist postion error
« Reply #15 on: November 20, 2014, 06:43:48 PM »
Yeah, just flip the y.
  1.                         min = t.localPosition;
  2.                         max.x = min.x + mBackground.width;
  3.                         max.y = min.y - mBackground.height; // <-- minus instead of plus
  4.                         max.z = min.z;
  5.                         Vector3 offset = mPanel.CalculateConstrainOffset(min, max);
  6.                         t.localPosition += offset;

slumtrimpet

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 13
    • View Profile
Re: why,popuplist postion error
« Reply #16 on: November 21, 2014, 10:18:18 AM »
Thanks!  That fixed it for me.

sunfremont

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: why,popuplist postion error
« Reply #17 on: November 26, 2014, 07:56:36 AM »
I have modify code as below , But seems not really fixed.
It only fix Y problem but X still have some problem  when place popup list in left side or right side

It could be reproduce as below:

UIRoot : Scaling Style = ConstainedOnMobiles
Content With = 1280
Content Height =720

And put Popup list in right side or left side   (reference as attach image)


Unity 4.5.5f1
NGUI 3.7.6p2




Yeah, just flip the y.
  1.                         min = t.localPosition;
  2.                         max.x = min.x + mBackground.width;
  3.                         max.y = min.y - mBackground.height; // <-- minus instead of plus
  4.                         max.z = min.z;
  5.                         Vector3 offset = mPanel.CalculateConstrainOffset(min, max);
  6.                         t.localPosition += offset;

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: why,popuplist postion error
« Reply #18 on: November 26, 2014, 08:27:23 PM »
Works fine here?

1. New scene.
2. Dragged in a Popup List from the prefab toolbar and placed it in the top-left corner.
3. Changed UIRoot to Constrained.
4. Hit Play, works as expected.
5. Changed the UIRoot's size, works as expected.
6. Changed the game view's size, works as expected.

sunfremont

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: why,popuplist postion error
« Reply #19 on: November 27, 2014, 05:44:18 AM »
Changed UIRoot to Constrained work well. I know .

So I mean in this case
UIRoot : Scaling Style = ConstainedOnMobiles
Content With = 1280
Content Height =720

And put Popup list in right side or left side  will not working well . 

I attach the package .
You can import and open popup scene the see the result .
(the file is over 1024k )
I have put it in www
please download here 
« Last Edit: November 27, 2014, 08:52:04 PM by ArenMook »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: why,popuplist postion error
« Reply #20 on: November 27, 2014, 08:52:20 PM »

pstpetrov

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: why,popuplist postion error
« Reply #21 on: November 28, 2014, 09:48:29 PM »
I am seeing the same error.

I have a UI Root with UIRoot.ContentWidth = 1536 and UIRoot.ContentHeight.Height = 2048.

When I put the PopUp control there, the resulting popup list is showing in the middle of the screen instead of right above or below the PopUp control. Also the resulting popup is the same small size regardless of the size of the PopUp control.


When I drop the control and view it under the auto generated UI Root, it looks fine.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: why,popuplist postion error
« Reply #22 on: November 30, 2014, 05:44:39 AM »
Whatever the issue, I am not seeing it on my end, so either it's already fixed in the Pro version, or you guys are using some older version of NGUI.

sunfremont

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: why,popuplist postion error
« Reply #23 on: November 30, 2014, 09:26:17 AM »
I use Unity 4.6 Free
NGUI 3.7.6p2
it still have this issue .
 I don't have pro version to verify .


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: why,popuplist postion error
« Reply #24 on: December 02, 2014, 11:14:09 AM »
I'll put up 3.7.7 later this week.