1
NGUI 3 Support / UIGird, UIScrollView and dragging
« on: January 26, 2015, 02:42:41 PM »
Hello
Im having hard times trying tring to solve some problems in making a UI for mobile using UIGrid and UIScrollView. (and UIDragScrollView,UIDragDropItem)
I tries some approaches, each time came close to solve...anyway I will explain the UI:
-I have 8 items inside UIGrid ordered horizontally.
-The UIGrid is inside a UIScrolView to enable dragging them left and right.
-order of item should not be changed
-I need also to have the option to remove items by dragging them up or down
-a very small drag(defined) should return them to their position, a larger removes them
-there is a button -when pressed it return all the removed items (with original order)
Well I already managed putting the items in the grid,scrolling them and being able drag up and down each item .
the problems I encountered are :
1.When being dragged each item is temporary removed from the grid by the UIDragDropItem code ,than if it returned to the grid its being moved to the end- by the UIGrid.
2.To remove item from the grid mean - to loose its order , I tried remove by disabling it and using the HideInactive feature, still it removes to the end
3.If i want to show all removed items there is no add method with position, I can remove them all and read them, however The GetChildList method which is commented to be used for removing some items is not so useful - after I change the list, How do I set it?
4.The UIScrollView stop working after some dragging item up and down - It might be because i saw the UIDragScrollView is being disabled by the UIDragDropItem (and the colider too) , and sometimes its stayed disabled but I'm not sure
5.The UIGrid itslef is re positioned sometimes (like when all items are removed) - becoming invisible because its Y is out of the screen
I didn't figure which component re position it because its not my code
6.The UIGrid become disabled in runtime, this is OK?
7.dragging fast to the right returns the items back which is great, but to the left if there are less items than 8 (after being removed) ,its not always returns - I tried changing positions and Pivot of both the grid and the scroll.
Thank you
Tsahi
Im having hard times trying tring to solve some problems in making a UI for mobile using UIGrid and UIScrollView. (and UIDragScrollView,UIDragDropItem)
I tries some approaches, each time came close to solve...anyway I will explain the UI:
-I have 8 items inside UIGrid ordered horizontally.
-The UIGrid is inside a UIScrolView to enable dragging them left and right.
-order of item should not be changed
-I need also to have the option to remove items by dragging them up or down
-a very small drag(defined) should return them to their position, a larger removes them
-there is a button -when pressed it return all the removed items (with original order)
Well I already managed putting the items in the grid,scrolling them and being able drag up and down each item .
the problems I encountered are :
1.When being dragged each item is temporary removed from the grid by the UIDragDropItem code ,than if it returned to the grid its being moved to the end- by the UIGrid.
2.To remove item from the grid mean - to loose its order , I tried remove by disabling it and using the HideInactive feature, still it removes to the end
3.If i want to show all removed items there is no add method with position, I can remove them all and read them, however The GetChildList method which is commented to be used for removing some items is not so useful - after I change the list, How do I set it?
4.The UIScrollView stop working after some dragging item up and down - It might be because i saw the UIDragScrollView is being disabled by the UIDragDropItem (and the colider too) , and sometimes its stayed disabled but I'm not sure
5.The UIGrid itslef is re positioned sometimes (like when all items are removed) - becoming invisible because its Y is out of the screen
I didn't figure which component re position it because its not my code
6.The UIGrid become disabled in runtime, this is OK?
7.dragging fast to the right returns the items back which is great, but to the left if there are less items than 8 (after being removed) ,its not always returns - I tried changing positions and Pivot of both the grid and the scroll.
Thank you
Tsahi
