How do I create a sparsely populated grid-like panel in UMG?

I’m trying to build a simple, grid-based minigame using UMG. This will involve placing objects on a grid. This might mean that on a 10x10 grid, only space 9,9 contains an item.

As far as I can tell, the grid panel doesn’t support this. The max grid size is NxN where N is the number of children in the panel. So if you have 3 things in the panel, you have a 3x3 grid. It doesn’t matter if a child is set to be in space 50/50, if there are only 3 things in the grid, it will appear at 3x3.

Is there any way to get the grid to work as I want or is there a different widget that will behave the way I need? Would I maybe be better off using something like a canvas panel and just manually dealing with transforms?

Place an invisible dummy at 9,9 - like a not hit-testable border with 0 opacity. It should work for Uniform Grid Panel, and probably will not work all too well for the regular Grid Panel due to the row / column spanning rules.

And yes, if you decide to go with the Canvas Panel approach, it would work, allow for more granular control & flexibility, but it’s more upfront work and maintenance later on.

Makes sense. Thanks. :slight_smile:

1 Like