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?
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.
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.
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.
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.
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?
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?
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.