Unity: Grid Layout Group component realizes automatic layout Image with one click

Unity: Grid Layout Group component to realize automatic layout Image

1. First, create an Image to use as the background we want to set.

Insert picture description here

Second, we add multiple grid images to the background image

Insert picture description here

3. Add the Grid Layout Group component to the background image of the parent node to find that it will automatically help us typesetting.

Insert picture description here
Note: We can also manage this component as a grid by creating an empty component, that is, instead of adding a Grid Layout Group in the background Image, but adding a Grid Layout Group component to the empty component that serves as the grid management. Of course, we must remember to use the Grid Layout Group component as a child node of the background Image.

Guess you like

Origin blog.csdn.net/qq_43801020/article/details/108243736