Local to absolute Position in UMG

Hey, there is this nice little Node in UMG:

https://forums.unrealengine.com/attachment.php?attachmentid=33348&d=1428032141

But unfortunately it’s pretty useless since it returns the absolute absolute position, the position in Windows (or whatever Operating System). So it only works fine if the game runs in fullscreen.

The Node itself says “Absolute coordinates could be either desktop or window space depending on what space the root of the widget hierarchy is in.”.

How can I define in which space the root of the widget hierarchy is in? If I can’t, is there any other easy way to convert local (relative to parent) positions to absolute (relative to viewport) positions in UMG? At the moment I am converting this manually, but this only works fine if I know where the anchor points are set, and I would like to have a solution independent from anchor point positions.

Any news on this? I have the same problem; I need to be able to get a widget’s position in the viewport.

Bump, looking for this information as well.

Solution:

There is a node “Local to Viewport” now. It was added in 4.10 I think.

That node takes a FGeometry argument. Where does that come from?

Some methods have the FGeometry fed by the engine. Ex: Tick, OnMouseMove, etc.

For anyone who wants an example of how this should work, here is what I did.

I wanted to set the mouse position a little to the left of a button that is being used to select an option during a dialogue sequence.

The mouse only appears when a dialogue button is created, so setting the mouse position to be close (but not overlapping the button) was something that felt nice to implement.

First I stored the widget’s geometry on tick like this:

Next, I set the position of the mouse by offsetting the position I got from the top left position of the widget:

That should be a little bit more info to help others like myself get started.