Hello.
I was making a func process(delta) in which whether a button or another held focus, a label would display a different text. However, I have no clue on how to detect which node is holding focus. How can I do that?
Hello.
I was making a func process(delta) in which whether a button or another held focus, a label would display a different text. However, I have no clue on how to detect which node is holding focus. How can I do that?
oobiekanoobie One thing you could do is connect a signal from all the nodes to tell another "master" node which one is currently focused. I think there's a signal called on focused.
Hello.
I tried making the signal. However, there is no "on_focused" signal (in Godot 4). Should I create it? Or is that overcomplicating the system?
A Control node has focus_entered and focus_exited signals:
https://docs.godotengine.org/en/4.0/classes/class_control.html#signals
and a has_focus method:
https://docs.godotengine.org/en/4.0/classes/class_control.html#class-control-method-has-focus