Im trying to create a minimap, in which you can hover over a unit on the map with your mouse to produce a tooltip.
I need the tooltip to be at the position of the widget representing the unit on the minimap.
I tried placing the tooltip on the same canvas of the widget representing the unit on the minimap, but the tooltip needs to be big and is clipped by the bounds of the minimap’s canvas.
So I then tried placing the tooltip on the parent canvas since it encompasses the entire screen.
But now I need to get it to match the position of the widget representing the unit on the minimap’s canvas.
Any help or even just clues would be greatly appreciated.
Ive been trying “widget representing the unit on the minimap” -> Slot as Canvas Slot.
But it was returning None for the Canvas Slot…
When you say “Try Child Widget” are you refering to my “widget representing the unit on the minimap”, or do you mean to create a new widget as a child of “widget representing the unit on the minimap”?
EDIT:
Ok I got it to return a canvas panel.
Apparently you cant get a canvas panel if there is a Scale Box between the Widget your calling Slot as Canvas Slot from and the actual canvas it is on.
So I just called Slot as Canvas Slot on the Scal Box and it returned the canvas slot.
But now the Position it returns is 0,0.
EDIT2:
Solved.
I used the Tick of the “widget representing the unit on the minimap” to get the geometry and used that call a Local To Viewport Node and set a Vector2D to the resulting Pixel Position.
That Pixel position gave me an accurate Viewport Position of the Widget I can then use to position any other widget on any other canvas that needs to match that position.