From a7e0c78b40fa50d7608e6e43e98407e76112c434 Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Mon, 4 Jun 2018 02:32:27 +0200 Subject: [PATCH] Step-by-step scripting: Reorder functions --- getting_started/step_by_step/scripting.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/getting_started/step_by_step/scripting.rst b/getting_started/step_by_step/scripting.rst index 69bacecd..fa4ac78c 100644 --- a/getting_started/step_by_step/scripting.rst +++ b/getting_started/step_by_step/scripting.rst @@ -284,12 +284,12 @@ The final script should look like this: extends Panel - func _on_button_pressed(): - get_node("Label").text = "HELLO!" - func _ready(): get_node("Button").connect("pressed", self, "_on_button_pressed") + func _on_button_pressed(): + get_node("Label").text = "HELLO!" + .. code-tab:: csharp using Godot; @@ -298,16 +298,16 @@ The final script should look like this: // this is case sensitive! public class sayhello : Panel { + public override void _Ready() + { + GetNode("Button").Connect("pressed", this, nameof(_OnButtonPressed)); + } + public void _OnButtonPressed() { var label = (Label)GetNode("Label"); label.Text = "HELLO!"; } - - public override void _Ready() - { - GetNode("Button").Connect("pressed", this, nameof(_OnButtonPressed)); - } }