How to get mouse position in screen space?

No matter which way I try I can’t seem to do it. It’s always offcenter or straight up incorrect. I’m just trying to drop a widget at the screen space position but it seems to only work if I’m not full screened.

Can you shed some extra light on this? What exactly are you trying to do? Asking questions because I can’t wrap my head around what’s needed.


You have this tag ‘project world location to widget position’ - is this a case of a mixed 2d / 3d interface? I’ve been fiddling recently with widget component quads vs regular canvas in widget and it can be a bit daunting at times. I may be able to chip in providing I understand the problem.

But then you say:

I’m just trying to drop a widget at
the screen space position

If this is for a standard drag & drop, why use controller in the first place? The drag operation is what would spit out the cursor data here. You may need to use widget geometry (if you’re dealing with things like draggable windows, for example) - it can help translating to/from local/absolute screen coordinates. And it will account for viewport size.


One big hiccup UMG has is the way it handles widgets once the viewport has been resized duing run-time. Can’t recommend dealing with that in bluerprints.

I think you’re confused as to what I’m asking…

It’s a hud widget that is telling you an inventory items info when you put your cursor over it. I’m just trying to create the widget at mouse location in screen space. It doesn’t seem to work right though, any way I try.

It seems to never account for the fullscreen but will only work when not fullscreened.

It’s a hud widget that is telling you
an inventory items info when you put
your cursor over it.

For something like that I’d just use the built-in tooltips:

298815-widgettooltip.png

Image from Gyazo

You can then easily pipe in data from the item’s widget into the tooltip widget.

If you must retain manual control over the position of the cursor-tracked widget (I could easily name a handful of reasons!), consider the stuff I suggested in my opening comment:

Image from Gyazo

Hmm for some reason if I use a tooltip widget it creates a s*** ton at once(every frame?) off center and they don’t disappear

Share a screenshot of the bound function maybe? The pure GetToolTipWidget.

I figured it out!

The custom tooltip widget needed its content visible but not hit testable.

The mouse was “leaving” when the widget got created in it’s spot and then it was created another since it was still hovered. Thanks for the help!