lovr.thread.newThread
Creates a new Thread from Lua code.
thread = lovr.thread.newThread(code)
Arguments
Name | Type | Description |
code | string | The code to run in the Thread.
|
Returns
Name | Type | Description |
thread | Thread | The new Thread.
|
thread = lovr.thread.newThread(filename)
Arguments
Name | Type | Description |
filename | string | A file containing code to run in the Thread.
|
Returns
Name | Type | Description |
thread | Thread | The new Thread.
|
thread = lovr.thread.newThread(blob)
Arguments
Name | Type | Description |
blob | Blob | The code to run in the Thread.
|
Returns
Name | Type | Description |
thread | Thread | The new Thread.
|
Notes
The Thread won't start running immediately. Use Thread:start
to start it.
The string argument is assumed to be a filename if there isn't a newline in the first 1024 characters. For really short thread code, an extra newline can be added to trick LÖVR into loading it properly.
See also
Thread:start
lovr.threaderror
lovr.thread