mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Adds underscore before on_Button_pressed()
so it matches the default name generated by the editor.
This commit is contained in:
@@ -119,7 +119,7 @@ Select the ``pressed()`` signal and click the ``Connect`` button (you can also
|
||||
double-click the ``pressed()`` signal instead). In the window that opened,
|
||||
select the Panel node (we will centralize all behaviors in its attached
|
||||
script). Keep the default function name, make sure that the ``Make function``
|
||||
toggle is ON and hit ``Connect``. This creates an ``on_Button_pressed()``
|
||||
toggle is ON and hit ``Connect``. This creates an ``_on_Button_pressed()``
|
||||
function in the ``main_panel.gd`` script, that will be called every time the
|
||||
button is pressed.
|
||||
|
||||
@@ -136,7 +136,7 @@ script:
|
||||
|
||||
signal main_button_pressed(value)
|
||||
|
||||
func on_Button_pressed():
|
||||
func _on_Button_pressed():
|
||||
emit_signal("main_button_pressed", "Hello from main screen!")
|
||||
|
||||
In the same way, this main scene's Label node has to show a value when it
|
||||
@@ -168,7 +168,7 @@ Here is the script's full content:
|
||||
|
||||
signal side_button_pressed(value)
|
||||
|
||||
func on_Button_pressed():
|
||||
func _on_Button_pressed():
|
||||
emit_signal("side_button_pressed", "Hello from side panel!")
|
||||
|
||||
func _on_main_button_pressed(text_to_show):
|
||||
|
||||
Reference in New Issue
Block a user