Difference between revisions of "Coroutine.create"
From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 4: | Line 4: | ||
=== Description === | === Description === | ||
| − | Creates a new coroutine, with body f. f must be a Lua function | + | Creates a new coroutine, with body f. f must be a Lua function. |
| − | < | + | <syntaxhighlight lang="lua"> |
| − | ( | + | (thread) = coroutine.create(f) |
| − | </ | + | </syntaxhighlight> |
=== Parameters === | === Parameters === | ||
| − | '''f''': (function) | + | '''f''': (function) Lua function<br/> |
=== Return values === | === Return values === | ||
| − | '''Returns''' ( | + | '''Returns''' (thread) created coroutine<br/> |
{{Coroutine}} | {{Coroutine}} | ||
Latest revision as of 14:26, 13 July 2023
Available since: Gideros 2011.6
Class: coroutine
Description
Creates a new coroutine, with body f. f must be a Lua function.
(thread) = coroutine.create(f)
Parameters
f: (function) Lua function
Return values
Returns (thread) created coroutine