UMG getting the screen position of a child widget

I am trying to create a floating tooltip the will contain information about the item icon you are hovering over.
All the item icons are widgets that are in a uniform grid panel.
I need to be able to get the position of the item icon to know where I should display the tooltip.

I checked the documentation and it says the only setter’s are exposed.
How can I get the correct position to place the tooltip?

1 Like

Hello,

I had this issue a few days ago. I have submitted a feature request (UE-5497) to the development team for further consideration. Thank you for your time and information. I will provide updates with any pertinent information as it becomes available.

Make it a great day

Any knowledge on this? 4.6? Having trouble with this as well!

Hello ,

There exists no new information on this topic at this time. I will provide updates with any pertinent information as it becomes available.

Hello ,

I double checked again today and found that this issue has been fixed on an internal build and should be available in a later release.

Well, I guess I follow this page and wait… =(

Hello DesertEagle_PWN,

This feature has already be implemented in to the engine. This feature should be available in the 4.7 and higher versions on the engine. I hope that his helps.

Example:

46428-getwidgetpositionhelp.png

Make it a great day

2 Likes

Thank you very much Rudy, these nodes had slipped under my radar. Thanks for sharing and hopefuly this page will be useful to others looking to accomplish the same thing.

I have buttons laid out in a Grid Panel and when I use “Slot as Canvas Slot”, it returns 0,0 for the location and 0,0 for the size.

I can’t tell if the size and location really are only available for content laid out in Canvas Panels or if the “casting” to a Canvas Panel will allow the developer to reveal the location and size of the component.

Can you clarify?

Are you using Slot as Canvas Slot on the buttons inside Grid Panel or on the Grid Panel itself?

If you want to get position of the buttons inside Grid Panel then you should use Slot as Grid Slot. You can see what slot it belongs to if you select the widget inside UMG Designer and check the details tab.

89646-example.png

Hi Rudy, I’m currently using 4.14. The GetPosition node will give you a relative position to the containing widget and not the exact screen pixel position. So if you place a widget inside a ScrollBoxPanel, and then scroll it, the GetPosition will give you a fixed value and not a dynamic value due to changes in the screen pixel position. Are you sure it is the one?

Hello Pelangi,

Slot as canvas slot will not work if the widget is not a child of the canvas slot. I hope that this information helps.

Make it a great day

1 Like

Hi Rudy, thanks for the info. But the topic of this post is about screen position right? And not the relative position of a widget to its container widget. Slot canvas will work if the container is a canvas. But it does not give the screen position of a widget inside it. Try making a ScrollBoxPanel, and then add CanvasPanel inside it, and then add any widget inside that CanvasPanel, and then scroll it. The position of the innermost widget will be constant. So it does not reflect screen position. Is there any other function which is required here?

Hello Pelangi,

If you are using 4.15 you could use the “Get cached Geometry” node in combination with the “Local to Viewport” node. I have provided an example below. I hope this information helps.

Example:

Make it a great day

7 Likes

I’m using 4.16 and I’m having the same problem.

Get Cached Geometry will not work if my widget is a child widget of a scrollList and call this function while scrolling.

1 Like

(Posting to 6 years ago) You can also get the (relative) possition of a child widget With “Get Chached Geometry” and then “Get Local Top Left”.
widgetpos

2 Likes