0
\$\begingroup\$

Have no idea how to align/realign uwidgets via c++. I have a following widget structure: UButton->UOverlay->UImage. Have to make UOverlay to HFill and VFill the UButton

\$\endgroup\$
1
  • \$\begingroup\$ I think there are two ways to do this. In straight c++ code like you are doing or using Slate with macros \$\endgroup\$
    – Jay
    Nov 8, 2021 at 23:08

2 Answers 2

0
\$\begingroup\$

Figured out the solution. Add child returns a panel slot, which we can then cast to a button slot and use it to set alignment.

Edit: This solution crashes the engine. Still can't figure out why

\$\endgroup\$
0
\$\begingroup\$

You can use a SizeBox element as holder of your widget enter image description here.

Then you can add your widget as a child, cast returned slot to SizeBoxSlot and then use SetAlignment functions. enter image description here It works for me.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .