Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: badawe on May 27, 2013, 04:58:54 PM
-
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:
(http://fs01.androidpit.info/userfiles/689923/image/drawsomethingapp.jpg)
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:
(https://www.evernote.com/shard/s37/sh/7094ce4b-4302-4862-bac1-7f7bc930bce8/fd4c5d2b309805d713344ee793977905/deep/0/Screenshot%2027/05/13%2018:53.png)
So we have:
[-10][3,0] Home UIPanel
UIPanel (Clipped View) UIPanel + UIDraggable Panel
UIGrid UIGrid
And the UIPanel (Clipped View) have this configurations:
(https://www.evernote.com/shard/s37/sh/ea879b1e-428a-47a4-b29f-914c42096be5/72fadb085917d6838931c0569e508941/deep/0/Screenshot%2027/05/13%2018:58.png)
But this don't really work, anyone have any other way of doing that?
-
Watch this, http://www.youtube.com/watch?v=XAeRXckXMMw
...then use UIAnchor.
-
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:
(https://www.evernote.com/shard/s37/sh/d3fc32bd-2b0d-400d-b827-ea417db9ce2f/c097a4297394fa5b045bd19de1fcb723/deep/0/Screenshot%2029/05/13%2015:40.png)
And let the panel like this:
(https://www.evernote.com/shard/s37/sh/ed795aac-0f3a-41d1-95e5-b2dae0dc0ed9/88d767c3a172cd7ad86b62e5439309d3/deep/0/Screenshot%2029/05/13%2015:40.png)
don't work, the content of draggable pannel still like the TOP is the center of the object:
(https://www.evernote.com/shard/s37/sh/f2975ef0-bae3-4583-9bb5-b4c88d0071b1/9748c6e825ae72510496a79c134e59f8/deep/0/Screenshot%2029/05/13%2015:41.png)
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?
(https://www.evernote.com/shard/s37/sh/af76c214-f4fe-49f6-8bd3-c5484cfda122/b920ff6703cf59fd56ceac1c5205bf05/deep/0/Screenshot%2029/05/13%2015:44.png)
-
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.