I’m having an issue with a Button Widget that I want to call when the player R+Clicks on an occupied item slot within the inventory. I’ve been doing a bit of research and it seems like a Menu Anchor Widget is the way to go with this, so I created a MenuAnchor in my Slot widget and Bound to “OnGetUserMenuContent” as so:
The problem I run into is I expect that the Menu would appear to the right of any inventory slot I click on……but the result I always get is the button menu widget always draws in the upper left of my viewport, nowhere near the inventory. Any ideas?
Small update……I ended up reconnecting an old placeholder Set Position node at the end of the chain, and used the position of the Menu Anchor as the In Position input. This, at least behaved somewhat as I would expect (moving the Menu Anchor in the designer corresponded to the position in the game window). However, I was under the impression that the Anchor would appear relative to the widget it was placed inside of. In this case, it seems more like it’s indexing off of some absolute screen position and I don’t know why.
Here’s a demo of what was actually happening. Prior to attempting to set up Menu Anchors within the Slot Widget, I was using the following snippit of logic to get the location of the Slot on screen and offsetting from it. The issue was that resizing the screen would wreak havoc on the position of the R+Click Button Menu, as below:
On the left is when I F11 full screen mode it and R+Click on an item. Things appear ok, but the moment I return to current viewport mode the widget shifts position. When I started trying to use the Menu Anchors, the widget would just shift to the upper left of the screen. I don’t have a canvas panel in my slot widget (only a single one in the HUD widget class). I’m not sure what the fix for this would be.