Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Grid,Horziontal Layouts

Discussion in 'UGUI & TextMesh Pro' started by rickw, Aug 27, 2014.

  1. rickw

    rickw

    Joined:
    Jul 7, 2013
    Posts:
    15
    Hi,

    So, I'd like to create my own type of layout.

    Essentially this will act like a Horizontal Layout, but when items contained within the layout are hidden, then the items within the layout will not be scaled and will collapse to either the left or the right i.e.

    A B C D

    Hide B and you'll get

    A C D

    Are there an interfaces etc or abstract classes that I should be implementing/extending?

    There doesnt seem to be an easy way to find what tools are available in the new UI toolkit!

    Cheers
     
  2. rickw

    rickw

    Joined:
    Jul 7, 2013
    Posts:
    15
    Scratch that.

    You can achieve this using Grid layout and using the alignment settings!
     
  3. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Right. You can probably also achieve it with the Horizontal Layout Group if you add Layout Elements to the children and set the flexible width to be 0 on them.