Isometric arrangement of Unity UI

To arrange the five images equidistantly, you can use Unity's layout components and layout tricks. Here's one possible implementation:

  1. Create an empty GameObject and use it as a container to hold the five Images.

  2. Add a HorizontalLayoutGroup component to the container object. HorizontalLayoutGroup will help us achieve horizontal equidistant arrangement.

  3. Make the five Images children of the container object and add them to the HorizontalLayoutGroup.

  4. For each Image, you can set the width, height and other related properties to suit your needs.

  5. Make appropriate settings on the HorizontalLayoutGroup component to achieve equidistant arrangement. You can adjust the Spacing property to control the spacing between sub-objects.

In this way, when you adjust the size of the container object, the HorizontalLayoutGroup component will automatically adjust the position of the child objects according to the number and spacing of the child objects, so as to achieve equidistant arrangement.

Guess you like

Origin blog.csdn.net/qq_51245392/article/details/130938045