Small GUI problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nophlock
:warning: Old Version Published before Godot 3 was released.

Hi,

as the title says I have a hopefully small GUI tutorial that can’t I solve by myself.

So currently my scene looks like this:

And as you can see from the image the focus_enter signal was connected to the main_menu node, which contains the following script:

   
extends Control
func _ready():
	print("created")

func buttonWasPressed():
	print("pressed")

func buttonWasFocused():
	print("focus")

But for some reason, the focus function never get’s triggered In my script and I don’t know why. Also the button node in the hierachy(“entry”) never get any focus and with that, doesn’t change his appearance to the hover image or throwing the “pressed” signal. Any idea why?

Here are the settings for the main_menu_size node which basicly are the settings for the other nodes too:

PS: What exactly does the “Stop Mouse” function do? Prevent that the mouse signal goes to the child nodes?

:bust_in_silhouette: Reply From: Zylann

You made a typo.
The focus function never gets called because the node connection is trying to call main_menu :: buttonWasFocued, while your script contains buttonWasFocused.

Oh wow, how couldn’t I saw this … Okay changed it but the function still don’t get called for some reason. But shouldn’t the debugger also throw an error, if the connected signal doesn’t exist? Or only if he tries call the signal, which then would also indicate why I didnt’t see the typo.

The signal now looks like this:

Nophlock | 2016-09-08 19:15

:bust_in_silhouette: Reply From: supaiku

Make sure to call

	set_focus_mode(Control.FOCUS_ALL)
:bust_in_silhouette: Reply From: Nophlock

Okay nevermind found the problem.

The Node “fade_screen” had also the size of 1920x1080 and it seems with that it has “eaten” the focus of the top nodes, but thanks for the help :slight_smile: