How to make tooltip show using a Gamepad?

Hey guys,

Im creating an inventory system and I would like to also make it Gamepad compatible. I have a tooltip widget that shows when I hover over a particular slot with my mouse cursor. But their won’t be a mouse cursor with the Gamepad, could I make the tooltip show when a particular button is pressed?

Thanks in advance.

In the past, I’ve used an input pre processor for this task. I don’t have the code to-hand, but you can look at “IInputProcessor”, and that class will give you the chance to respond to any input events before they are passed to the rest of the game.

The TL;DR is that you create a pre-processor and assign it to the local player (for easier access) - and all of the events simply check if the key was a gamepad key, and broadcast a global event when the type changes. If the player touches the mouse or hits a key, the game switches to KB + Mouse input - if they move an analog stick or press a gamepad key, it switches to gamepad.

I’m not sure how Paragon did this, but that’s what I went with and it seems to work pretty well.

Thanks for the reply guys I will check these out.

@**EntrpriseCustomr **
I am primarilty making the game for PC but will want it to be Gamepad compatible.

Does anyone know a way to get UMG button location on screen? I think I can find a workaround but I need a way to get the buttons on screen location. and obviously Slot As Canvas Slot -> Get Position will not work, so if anyone know a way to get the absolute position,I would really like to hear it.

1 Like

If your UI needs tooltips, then your game UI is not yet streamlined enough to work with a controller.
Designing for a controller isn’t just “add the controller” – it’s a totally different mindset. A bit like designing a house for sleeping in, versus designing an office to work in.

It’s not that the UI “needs” tooltip. Sure, when you hear tooltip you think of one thing…tooltip, but with a little work they can be so much more, which is what im pushing.

Anyway, I got it to work using menu anchor, which is wonderful in and of itself.

1 Like