UMG - Put menu above button position in horizontal box

Hey!

I have a horizontal box that contains dynamically created buttons which should trigger menus which are also dynamically created. The menus should be positioned somewhere above the respective menu button, so you get a different menu above the buttons position with every button. I have tried some things to get the actual position of the widgets inside the horizontal box, but I didn’t manage to get it.

Is there any way to get the widgets position in a horizontal box, or am I just adressing this wrong / do you know some kind of workaround?

Thanks in adance, BitteWenden. :smiley:

Not sure if I am understanding you fully. Could you post some screenshots of what you are trying to do?

I will draw something tomorrow. Basically I want a menu like in prison architect, but dynamically created. The problem is positioning the actual menus.

And you are using widgets right? Are you placing the anchors in the right spot?

Which anchors are you taking about?

There are anchors in widgets which like basically saying where the center of the screen is and the text or button will set up from there. If the anchor is off set the text will be as well. Make sense?

If you have the text and button set with the anchors positioned differently they can be slightly off or more. I would say just mess with that until you find out which way is best to set them.

Huh? No, the buttons are no problem. The positioning of the menu that shows on click is the problem.

I’ve decided to roll my own solution now. How can I get the size of a widget inside a UhorizontalBox child class? None of my attempts worked.

For your original question.
You could use a Menu Anchor attached to the button (in this case they are both in a Vertical Box) and set it with a Menu Class, and the wanted Placement:

PS: in my opinion, it is a very bad practice to ask for help, then find yourself a solution, and not post it.

screenshot_25.png

screenshot_25.png

screenshot_27.png