2D Toolkit Forum
2D Toolkit => Support => Topic started by: soulareus on April 03, 2014, 05:54:38 am
-
I think the new UILayout Container Sizer is a great idea! However I am having trouble figuring out how to do two things:
1) I want to use it to dynamically add objects and remove them and have it collapse properly.
2) I want a horizontally aligned list of objects to center when I add or remove items.
I could not find any script reference for this container sizer, and parenting a UILayout does not seem to center the container sizer. Could someone please let me know if this is possible? It has implications for a couple of projects I am working on.
Thanks!
-Nic
-
1. That just works. Check ui demo 5 - The function that adds stuff into a layout is in tk2dUIDemo5Controller.AddSomeItemsAuto, the relevant function is - "autoScrollableArea.ContentLayoutContainer.AddLayoutAtIndex" which adds an item. Similarly there is a RemoveLayout which removes an item from a layout, but you are still responsible for deleting the game object.
2. There isn't, after removing an item, you can force scroll to the centre of the scrollable area.