How To Get Uniform Grid Slot Position (X/Y), Width And Height (blueprint)

I seem to be unable to find any information at all about how to aquire position and/or size information about uniform grid children (slots).

Everything marked as “solution” more or less points to this, which isn’t helpful at all (grid slots do not have a position).
I have no problem getting the row/col of the content. I use it to access the content afterall. However, I can’t find any sizes or positions. I can’t seem to find the col/row-count of the grid either to compute the size/offset/position of the childnodes myself.

Am I missing something? Do I really have to create my own grid widget?

Thanks for your help.

I found a workaround for drawing on top of the grid.

[ScaleBox]

  • [SizeBox]
    • [CanvasPanel]
      • [UniformGrid]

Important Settings:

ScaleBox:

  • Stretch: Scale to Fit
  • Stretch Direction Both

SizeBox:

  • Width Override: Desired Width
  • Height Override: Desired Height

You can now compute position and size of gridslots by assuming the grid size is “Desired Width” x “Desired Height” (you still have to keep track of grid column and row count).

You can now add stuff to the canvas panel on/between gridslots by assuming the canvas size is “Desired Width” x “Desired Height” (again, you have to keep track of grid column and row count to keep positions updated).

The ScaleBox will keep your parent area filled (or at least fill as much as possible without breaking uniform scaling).

This solution is undesirable but the best I could find till now.
Reasons for not being desirable:

  • Fixed aspect ratios (might leave a lot of empty space)
  • A lot of constants (dynamic UI is better)

Resurrect.

The above post gave me a decent idea. The dynamic grid is positioned by column row, so the math is pretty simple.
Top left x = spacing of grid value + default size x of element X row number
Top left y = spacing of grid + default size y of element X col number

You can compute the other corners adding the width and the spacing.
Every item has a default width that’s pre-set and altered during creation.

The only missing piece is if you have the grid it self manually positioned somewhere. You just need the x and y of that measure to add to the formula above.

If you make these calculations from within the specific blueprint you can dynamically add info upon the construction event. You can create and set x/y width height etc. And any other value you want to expose.

Basically just calculate the math from within and save it to a public var so that you can easily access it from the wrapper blueprint dynamically.

Theoretically with that setup, you should be able to read the values that are getting applied instead of calculating them in the blueprint with the grid that spawns the dynamic content.