2D Toolkit Forum

2D Toolkit => Support => Topic started by: porters25 on August 05, 2014, 05:39:05 pm

Title: UILayoutContainerSizer at Runtime
Post by: porters25 on August 05, 2014, 05:39:05 pm
Hi,
I'm adding buttons to a UI element at runtime, and i'm using the Tk2dUILayoutContainerSizer to layout my buttons.  I cant seem to figure out how to have the UILayoutContainerSizer rearrage my buttons are runtime.  When I add a button at design time, 2 buttons (i.e. 'Fixed Size' and 'Proportional') appear in Unity Inspector for UILayoutContainerSizer.  I can then click one of these, and my buttons get rearraged correctly.  I do not get these buttons at runtime however, and I would like to know how to rearrange my buttons using the UILayoutContainerSizer at runtime.

What can I do here?  Thanks.
Title: Re: UILayoutContainerSizer at Runtime
Post by: unikronsoftware on August 05, 2014, 06:44:38 pm
Check tk2dUIDemo5Controller.cs, that example adds things to a layouted list from code. Hope that helps.
Title: Re: UILayoutContainerSizer at Runtime
Post by: porters25 on August 06, 2014, 05:30:38 am
Thanks.  Worked it out from that code.  :)