Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2019.1 Vertical Layout Group documentation needs updated

Discussion in 'Documentation' started by mrzappit, Jun 4, 2019.

  1. mrzappit

    mrzappit

    Joined:
    Jan 10, 2019
    Posts:
    5
    An option was added to the Child scaling options for the Vertical Layout Group in 2019.1, but the documentation was not updated accordingly.

    This is the documentation as it stands: https://docs.unity3d.com/Manual/script-VerticalLayoutGroup.html
    upload_2019-6-4_10-4-9.png

    Note the options are: "Child Controls Size" and "Child Force Expand"

    But in my Unity right now, I have: "Control Child Size", "Use Child Scale", and "Child Force Expand"

    upload_2019-6-4_10-3-43.png

    I'm not sure why the documentation is so wrong for a major release upgrade, but any guidance as to what the new option(s) do would be greatly appreciated.
     
  2. jamal_unity

    jamal_unity

    Unity Technologies

    Joined:
    Sep 14, 2018
    Posts:
    3
    Hi mrzappit, thanks for the feedback!

    I'm part of the Unity Documentation team, and I’ve added this to our backlog to correct in the next version of the manual. In the meantime, here's a short explanation.

    First, the Child Controls Size options in the Vertical Layout Group Inspector were relabeled to Control Child Size. The new label more accurately reflects what the options do, which is to make the Layout Group set the width and/or height of child elements automatically.

    Second, the Use Child Scale options are currently not documented in the manual. These options make the Layout Group consider child objects' X and/or Y scaling values when setting element sizes.

    Let's say you have three buttons arranged on a Canvas using a Vertical Layout Group, like this:

    image.png

    If you scale the middle button vertically, it starts to overlap the other two buttons because the layout group considers its original size rather than its scaled size when laying out the buttons.

    image.png

    With Use Child Scale > Height toggled on in the Vertical Layout Group Inspector, the Layout Group considers the button's scaled size. This means the button is laid out the same way as the other unscaled buttons. For example, the the space between the scaled button and an unscaled button is the same as the spacing between two unscaled buttons.

    Screen Shot 2019-06-10 at 1.39.00 PM.png

    That being said, scaling a Layout Group's child elements is generally not recommended. Instead, use Layout Element components attached to individual child objects to control/override automatic sizing.

    Hope that helps.

    J
     
    joshcamas, Baste and mrzappit like this.
  3. mrzappit

    mrzappit

    Joined:
    Jan 10, 2019
    Posts:
    5
    Yes...that helps a ton. Thanks!
     
  4. jamal_unity

    jamal_unity

    Unity Technologies

    Joined:
    Sep 14, 2018
    Posts:
    3
    No problem, I've updated the manual and the changes should appear the next time we publish the documentation.

    Thanks again for the heads-up!
     
    mrzappit likes this.