system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
Chain |
|
Old Version |
Published before Godot 3 was released. |
Is there a way to check if a button is being hovered over? Because has_focus() and hover are not the same.
Thanks in advance!
system
4
|
|
|
|
Reply From: |
Zylann |
If you want to check this every frame or just query the state:
button.is_hovered()
If you want to get notified when the button is hovered, you can use the signals mouse_enter
and mouse_exit
.
That did the trick. Thanks
It is much better to access the signals.
Put the signal in the func _ready()
$MarginContainer/Menu/btn_NAME.connect("mouse_entered", self, "FUNCTION_NAME")
^ this will connect a signal to an action
$MarginContainer/Menu/btn_NAME is the path to button in the scene.
Speart | 2020-11-12 16:21