![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Freeman |
I have the button (control). The button uses the custom style, making it highlighted when pressed (the highlight is created by the Focus texture option of the Custom Styles in the Inspector of the button node).
It works when I physically press the button. It gets highlighted and highlighting lasts until another button is pressed.
But I wanted it to be/look already highlighted when the scene starts - before anything is pressed.
So far I tried to put in the func _ready():
$Control/Button.emit_signal("pressed")
$Control/Button.emit_signal("focus_entered")
$Control/Button.set_pressed(true)
$Control/Button.pressed = true
but at the start of the scene the button always stays in his default, non-highlighted appearance. However
func _on_button_pressed():
print("Button pressed")
seams to execute at the scene start, as there is “Button pressed” message in the output console - at least with $Control/Button.emit_signal("pressed")
in func _ready():
Any idea how to be/make it look according to settings in Focus Custom Style at the very start of the scene?