Horizontal Layout Group with element scaling.

I would like to distribute UI elements horizontally while making them as large as possible (with small gaps in between). Is that possible?

Here is what I’m getting:

Here is what I would like to get:

Here is the parent Panel inspector:

anyone?

If I understand your problem correctly, do the following:

  • Also Check the “Child Controls Size” check-boxes (I actually also don’t know why this is required)
  • Add a Padding for Top and Bottom (maybe 10, maybe a different value)
  • Add an AspectRatioFitter to all the child objects and set it to “Height Controls Width” with a value of 1

This works for one resolution. If you want to work it for any resolution you may want to use my Asset Better UI (see signature).

1 Like

Thank you so much for your response! I looked at Better UI and it seems very promising. I’m sure it would have saved me a lot of time and frustration. Just to clarify, will it do all the adjustments by itself, or would I still need to add AspectRatioFitter to all the child objects?

Also Better UI doesn’t know what you want to achieve :wink:
So, you would also need to add AspectRatioFitters to the child objects.
However, maybe you could achieve the same goal with a (Better)GridLayoutGroup. With that you wouldn’t need the aspect ratio fitters.

Sounds great. Thank you!