Difference between revisions of "Coroutine.create"

From GiderosMobile
Line 4: Line 4:
  
 
=== Description ===
 
=== Description ===
Creates a new coroutine, with body f. f must be a Lua function. Returns this new coroutine, an object with type "thread".
+
Creates a new coroutine, with body f. f must be a Lua function.
 
<source lang="lua">
 
<source lang="lua">
(coroutine) = coroutine.create(f)
+
(thread) = coroutine.create(f)
 
</source>
 
</source>
  
 
=== Parameters ===
 
=== Parameters ===
'''f''': (function) lua function<br/>
+
'''f''': (function) Lua function<br/>
  
 
=== Return values ===
 
=== Return values ===
'''Returns''' (coroutine) created coroutine<br/>
+
'''Returns''' (thread) created coroutine<br/>
  
 
{{Coroutine}}
 
{{Coroutine}}

Revision as of 22:39, 22 January 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