Registering when OptionButton items are hovered over?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MOSN

I’m using an OptionButton for selecting equipment and would like the relevant stats to update when you hover over an item on the list with your mouse. Problem is there doesn’t seem to be a build in signal for hovering over an item, as the item_focused() signal only triggers if you use the ui-up or ui-down to switch between them.

Since the items do light up when you hover over them, Godot is clearly already registering and doing something when it happens, but is there currently any way to trigger a function when it does?

:bust_in_silhouette: Reply From: Ertain

I think the OptionButton has a mouse_entered() signal. If that’s true, then maybe that signal could be used (and also related mouse filtering options are set appropriately).

Hmm but wouldn’t that just trigger when you mouse over the button itself, rather than the options that come up after you click it?

MOSN | 2022-04-03 06:56

I was confused. I thought you wanted just the “hover” option.

Ertain | 2022-04-03 17:58