Hello Guest

Author Topic: UILayoutContainerSizer at Runtime  (Read 4128 times)

porters25

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
UILayoutContainerSizer at Runtime
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UILayoutContainerSizer at Runtime
« Reply #1 on: August 05, 2014, 06:44:38 pm »
Check tk2dUIDemo5Controller.cs, that example adds things to a layouted list from code. Hope that helps.

porters25

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: UILayoutContainerSizer at Runtime
« Reply #2 on: August 06, 2014, 05:30:38 am »
Thanks.  Worked it out from that code.  :)