Difference between revisions of "love.thread.newThread"

m (Added new variant for 0.9.2)
(See Also)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{newin|[[0.7.0]]|070|type=function}}
 
{{newin|[[0.7.0]]|070|type=function}}
Creates a new Thread from a Lua file or [[FileData]] object.
+
Creates a new Thread from a filename, string or [[FileData]] object containing Lua code.
  
 
== Function==
 
== Function==
Line 31: Line 31:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|string|codestring|A string containing the Lua code to use as the source.}}
+
{{param|string|codestring|A string containing the Lua code to use as the source. It needs to either be at least 1024 characters long, or contain at least one newline.}}
 
=== Returns ===
 
=== Returns ===
 
{{param|Thread|thread|A new Thread that has yet to be started.}}
 
{{param|Thread|thread|A new Thread that has yet to be started.}}
Line 75: Line 75:
 
* [[Constructs::Thread]]
 
* [[Constructs::Thread]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Creates a new Thread from a Lua file or [[FileData]] object.}}
+
{{#set:Description=Creates a new Thread from a filename, string or [[FileData]] object containing Lua code.}}
 +
{{#set:Since=070}}
 +
 
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.thread.newThread}}
 
{{i18n|love.thread.newThread}}

Latest revision as of 12:08, 24 September 2021

Available since LÖVE 0.7.0
This function is not supported in earlier versions.

Creates a new Thread from a filename, string or FileData object containing Lua code.

Function

Available since LÖVE 0.9.0
This variant is not supported in earlier versions.

Synopsis

thread = love.thread.newThread( filename )

Arguments

string filename
The name of the Lua file to use as the source.

Returns

Thread thread
A new Thread that has yet to be started.

Function

Available since LÖVE 0.9.0
This variant is not supported in earlier versions.

Synopsis

thread = love.thread.newThread( fileData )

Arguments

FileData fileData
The FileData containing the Lua code to use as the source.

Returns

Thread thread
A new Thread that has yet to be started.

Function

Available since LÖVE 0.9.2
This variant is not supported in earlier versions.

Synopsis

thread = love.thread.newThread( codestring )

Arguments

string codestring
A string containing the Lua code to use as the source. It needs to either be at least 1024 characters long, or contain at least one newline.

Returns

Thread thread
A new Thread that has yet to be started.

Function

Removed in LÖVE 0.9.0
This variant is not supported in that and later versions.

Synopsis

thread = love.thread.newThread( name, filename )

Arguments

string name
The name of the thread.
string filename
The name of the File to use as source.

Returns

Thread thread
A new Thread that has yet to be started.

Function

Removed in LÖVE 0.9.0
This variant is not supported in that and later versions.

Synopsis

thread = love.thread.newThread( name, file )

Arguments

string name
The name of the thread.
File file
The file to use as source.

Returns

Thread thread
A new Thread that has yet to be started.

Function

Removed in LÖVE 0.9.0
This variant is not supported in that and later versions.

Synopsis

thread = love.thread.newThread( name, data )

Arguments

string name
The name of the thread.
Data data
The data to use as source.

Returns

Thread thread
A new Thread that has yet to be started.

See Also


Other Languages