Is it possible to create a "grid" with elements of different size? #481
-
|
Like shown in this post. I could position my elements "manually" via code just with rect transforms, but I'd love to actually have some kind of "builtin layout support" as well, otherwise I'll basically need to build my own "2d game engine collision" :P. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Unity’s built-in Option A — “Good enough” flow (no gap-packing)
Option B — True Masonry (shortest-column packing)Drop this minimal Usage
UIToolkit alternativeIf you’re on UIToolkit, its Masonry view (App UI package) gives packed columns + virtualized scrolling out of the box. If this helped, please consider marking the answer as Accepted so others can find it quickly. |
Beta Was this translation helpful? Give feedback.

Unity’s built-in
GridLayoutGroupuses one cell size, so it can’t do a Pinterest-style layout. In UI Extensions the closest “drop-in” isFlowLayoutGroup/TableLayoutGroup(handles mixed sizes but won’t tightly pack gaps). For a true masonry you’ll need a small customLayoutGroup(sample below) or switch to UIToolkit’s Masonry.Option A — “Good enough” flow (no gap-packing)
ContentSizeFitter).Option B — True Masonry (shortest-column packing)
Drop this minimal
LayoutGroupon your contain…