Last active
September 5, 2020 13:58
-
-
Save fenix-hub/8b22d832abb5b73a8db2e395637e279a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This example uses a simple scene with a Control node as the root and a single Button as a child, | |
but could be applied to any case scenario. | |
""" | |
extends Control | |
func _ready(): | |
$Button.connect("pressed", self, "on_pressed", [$Button.name, $Button.text, $Button.CUSTOM_VAR]) | |
# @CUSTOM_VAR if the button has its own script | |
func on_pressed(_button_name : String, _button_text : String, _button_custom_var : Variant): | |
print("The button named %s was pressed, containing '%s' in its text and with a custom variant: %s"%[_button_name, _button_text, _buttom_custom_var]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New Gdscript file! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment