mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fixed signal connection examples to use new callable syntax in the docs
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
func _ready():
|
||||
var button = Button.new()
|
||||
button.text = "Click me"
|
||||
button.connect("pressed", self, "_button_pressed")
|
||||
button.pressed.connect(self._button_pressed)
|
||||
add_child(button)
|
||||
|
||||
func _button_pressed():
|
||||
@@ -22,7 +22,7 @@
|
||||
{
|
||||
var button = new Button();
|
||||
button.Text = "Click me";
|
||||
button.Connect("pressed", this, nameof(ButtonPressed));
|
||||
button.Pressed += ButtonPressed;
|
||||
AddChild(button);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user