2
\$\begingroup\$

I want to change the size X of my 'Horizontal Box' widget's through blueprints but cannot figure out how to do that... the properties that I want to be able to control from blueprints are marked red below:

enter image description here

To give you some context, I need this to instantiate my widget dynamically. I first add a bunch of child widgets which works just great, but I also need to kinda resize the quad in the background to fit in size the child widgets that I am 'spawning'. Isn't there really any way to do this? Because this seems a super-basic thing to do as from my point of view but can't find it anywhere...

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

To change the X and Y values, you need to click the "Size To Content" box under them which will do this for you.

There is a function called "Set ZOrder" as well. Get a reference to Self, get the Slot As Canvas Slot then call it.

Unreal Engine UE4 Set ZOrder

\$\endgroup\$
3
  • \$\begingroup\$ aaaah… slot as canvas slot is the key... thanks a lot. that you are invalidating layout afterwards - is this something I should pay attention to as well or? \$\endgroup\$
    – Serhii
    Commented Jun 19, 2020 at 14:38
  • \$\begingroup\$ No, this image is something I found on the Unreal Engine forums where a similar question was asked. You can just ignore it. \$\endgroup\$
    – Stephen
    Commented Jun 19, 2020 at 14:39
  • \$\begingroup\$ understood, thanks again \$\endgroup\$
    – Serhii
    Commented Jun 19, 2020 at 14:41

You must log in to answer this question.

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