diff options
| author | Gubolin <gubolin@fantasymail.de> | 2015-02-06 19:45:38 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2015-02-06 19:45:38 +0100 |
| commit | 4a6ed44ba71870add781a6c3588f8adf4e2e4eec (patch) | |
| tree | c4908b21cd37734ef195d6fa74d97ddfceb279b1 | |
| parent | 4c9b2d4cee327b4af9201d76a12108d04a99ed50 (diff) | |
| download | snap-wiki-4a6ed44ba71870add781a6c3588f8adf4e2e4eec.tar.gz snap-wiki-4a6ed44ba71870add781a6c3588f8adf4e2e4eec.zip | |
small note on reporters in threads.js
| -rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -41,7 +41,7 @@ If you want to do your action continuously, use a `threads.js` function. There y this.pushContext('doYield'); this.pushContext(); ``` -and your function will be called on every tick. You can save something inside the context (`this.context.test = "Hello World!"`) and it will therefore be available in the following executions. +and your function will be called on every tick. You can save something inside the context (`this.context.test = "Hello World!"`) and it will therefore be available in the following executions. A reporter can return something with `return`, this can even happen after multiple cycles. The advantage of adding your function to a `SpriteMorph` or `StageMorph` is that you can access the stage/sprite directly with `this` and the functions for either of them can variate. Drawing something on the stage |
