summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-07-03 15:22:04 +0200
committerGitHub <noreply@github.com>2018-07-03 15:22:04 +0200
commitf8200d020a5604171c4461be9352c1846a03bde9 (patch)
treee4eab768de94337d12e1553541971b43ba0cda40
parent8ce6444f595839d6c0128427d17100b6f361e26c (diff)
parent117c666fcea1067c0fcefe4414fd1e530a65d622 (diff)
Merge pull request #19921 from ttencate/yield_docs
Document return value of yield() with signals
-rw-r--r--doc/classes/@GDScript.xml5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index a4ca830d4d..b5f5fed3f9 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -1145,8 +1145,9 @@
<argument index="1" name="signal" type="String" default="&quot;&quot;">
</argument>
<description>
- Stops the function execution and returns the current state. Call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state.
- Returns anything that was passed to the resume function call. If passed an object and a signal, the execution is resumed when the object's signal is emitted.
+ Stops the function execution and returns the current suspended state to the calling function.
+ From the caller, call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state. Within the resumed function, [code]yield()[/code] returns whatever was passed to the [code]resume()[/code] function call.
+ If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, [code]yield()[/code] returns the argument passed to [code]emit_signal()[/code] if the signal takes only one argument, or an array containing all the arguments passed to [code]emit_signal()[/code] if the signal takes multiple arguments.
</description>
</method>
</methods>