You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/scripting/gdscript/gdscript_basics.rst
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2866,6 +2866,30 @@ This also means that returning a signal from a function that isn't a coroutine w
2866
2866
With this type safety in place, a function cannot say that it returns an ``int`` while it actually returns a function state object
2867
2867
during runtime.
2868
2868
2869
+
You can store the arguments passed to the signal's parameters. If there is only one parameter, the awaited value will have the same type as the argument:
2870
+
2871
+
::
2872
+
2873
+
func toggled():
2874
+
var signal_args = await $Button.toggled
2875
+
assert(typeof(signal_args) == TYPE_BOOL)
2876
+
2877
+
If there is more than one parameter, the awaited value will be of type ``Array``:
2878
+
2879
+
::
2880
+
2881
+
func request_completed():
2882
+
var signal_args = await $HTTPRequest.request_completed
0 commit comments