Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: P15Studios on November 15, 2013, 10:53:44 AM
-
I'm trying to create a scrolling menu where the user can click on an object in my draggable panel and it expands, pushing the other objects below it downwards while maintaining the correct spacing between the objects.
I have the draggable panel working correctly now but I am unsure the best way to get this effect.
Thanks again!
-
Sounds like the provided Quest Log example is exactly what you need to look at.
-
I see the example but they are using a tween scale on the object to know the height of the object. I'm using a tween position so it doesn't know the distance to space things. Also all of my sizes are all based on .something and not actual pixels so it's very hard to determine actual layouts.
I have a card that has a header, body and footer. This is stored in a prefab. In this prefab, the header is a button. On press, I tween the position of the body and the footer in the y. This moves it down and back up as I want. I have multiple of these objects in the UITable but the table doesn't react as the size of the object never changes, the elements inside just move.
Does this make sense?
I attached an Image
-
Sounds like you're just missing the notification sent to the table when something changes: UITable.repositionNow = true
-
So far, I've done my entire UI in NGUI without touching the code. I've just been setting things up in prep for data. I looked at the TweenScale which has the UITable.repositionNow function but the TweenPosition does not. I'll go ahead and create my own mods to the position script unless I'm somehow missing it.
I've attached screens of my TweenPosition and my TweenScale. If this functionality is not in there now, I wonder if it would be a good update or if there are inherent reasons that this is bad?
-
So what I did is a bit of a kluge but I added an sprite that is totally transparent and put it in the back of my element and added the TweenScale script to that. Then I had that update the UITable and all works as expected. Would be nice to be able to update the table based on the position though.
Thanks for your help ArenMook and UncleAcid!