Author Topic: Draggable Panel - Right way to make a Anchor TOP Draggable Panel  (Read 4744 times)

badawe

  • Jr. Member
  • **
  • Thank You
  • -Given: 8
  • -Receive: 7
  • Posts: 70
    • View Profile
hello :)

Just a doubt that catch me right now. What is the Right way of do a Draggable Panel anchored TOP in NGUI? LIke any games display of any social game, like these:

the left one.


What we do here, is something like these:

Let's say the resolution of the app is 640x960 (iPhone 5)

The hierarchy is like this:


So we have:
[-10][3,0] Home UIPanel
    UIPanel (Clipped View) UIPanel + UIDraggable Panel 
         UIGrid UIGrid


And the UIPanel (Clipped View)   have this configurations:



But this don't really work, anyone have any other way of doing that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel - Right way to make a Anchor TOP Draggable Panel
« Reply #1 on: May 28, 2013, 02:11:54 AM »
Watch this, http://www.youtube.com/watch?v=XAeRXckXMMw

...then use UIAnchor.

badawe

  • Jr. Member
  • **
  • Thank You
  • -Given: 8
  • -Receive: 7
  • Posts: 70
    • View Profile
Re: Draggable Panel - Right way to make a Anchor TOP Draggable Panel
« Reply #2 on: May 29, 2013, 01:46:30 PM »
Yeah, i know how the Anchors work.

But in this case, of the Draggable Panel, don't seen to work this way.

If I make something like that:


And let the panel like this:


don't work, the content of draggable pannel still like the TOP is the center of the object:


But now, and I don't know if this is a bug or not, if i set the size of the UIPanel to the height of my projet, like 960, everythings work fine, so maybe i just need to update that manually? Or is a bug?



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Draggable Panel - Right way to make a Anchor TOP Draggable Panel
« Reply #3 on: May 30, 2013, 12:21:09 AM »
You need to position your draggable panel so that the first item is in the top left corner of the clipped panel. At edit time, add a prefab that you're normally instantiating at run time, adjust the position of the draggabla panel until the first item is where it should be, then delete the item. Then just hit Play.