Scaleform Studio Lua API Reference: Browse by namespace

Browse by namespace
Namespaces | Objects | Functions
expand all | collapse all

This page lists all members of the global namespace.

Related help topics +

Editor Guide > Add components > Add a sound component

Player Guide > Run player from command line

Programming Guide > Scripting with Lua > Lua language features > Expressions > Implicit type conversion

Programming Guide > Scripting with Lua > Lua language features > Statements > Scope

Programming Guide > Scripting with Lua > Lua language features > Statements > Control structures

Programming Guide > Scripting with Lua > Lua language features > Tables > Array access style

Programming Guide > Scripting with Lua > Lua language features > Functions > Declaration

Programming Guide > Scripting with Lua > Lua language features > Functions > Calling style

Programming Guide > Scripting with Lua > Lua language features > Functions > Arguments

Programming Guide > Scripting with Lua > Lua language features > Variable scope

Programming Guide > Scripting with Lua > Scaleform Studio API basic concepts > Event listeners > Disconnecting

Programming Guide > Scripting with Lua > Scaleform Studio API advanced concepts > Project script

Programming Guide > Scripting with Lua > Scaleform Studio API advanced concepts > Script component sandboxing

Programming Guide > Scripting with Lua > Scaleform Studio API advanced concepts > Hot loading

Programming Guide > Scripting with Lua > Scaleform Studio API object types > Actors

Namespaces

bit
Provided for bitwise manipulations.
coroutine
Provided for independent thread of execution.
debug
Used for debugging and all functions are provided inside the debug table.
io
Input/output namespace - Provides functions to create, read and write to files.
math
Math namespace
os
Operating System namespace - Provides functions for dealing with system time and date and other OS-related functions.
package
Package namespace.
scaleform
The core classes used in the Scaleform Studio.
string
String namespace
table
Table namespace

Objects

Matrix2F
A two-dimensional matrix in row-major order.
Matrix3F
A three-dimensional matrix in row-major order.

Functions

assert ( v, message )
Issues an error and aborts the program when the value of its first argument is false( i.e false or nil).
Parameters

v :

any

Issues an error when this value is false.

message :

string?

The error message to display. If absent, this defaults to "assertion failed".

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.

Otherwise, it returns all the arguments.

collectgarbage ( options, arg ) : any?
A generic interface to the garbage collector.
Parameters

options :

string?

The various options that can be set for the garbage collector. The possible options are:

  • "collect": Performs a full garbage-collection cycle. This is the default option.
  • "stop": Stops the garbage collector.
  • "restart": Restarts the garbage collector.
  • "count": Returns the total memory in use by Lua.
  • "step": Performs a garbage-collection step. The step "size" is controlled by arg (larger values would mean more steps) in a non-specified way. Returns true if the step finished a collection cycle.
  • "setpause": Sets the value of arg as the new value for the pause of the collector, which controls how long the collector waits before starting a new cycle. Returns the previous value for pause.
  • "setstepmul": Sets the value of arg as the new value for the step multiplier of the collector, which controls the relative speed of the collector relative to memory allocation. Returns the previous value for pause.
The ? notation indicates that this type is optional: there may be zero or one instances of it.

arg :

any?

The values passed depending on the option set. Many options do not need arguments to be passed.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

any?

The result of the function performed according to the options set.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

This performs different functions according to the specified options.

dofile ( filename ) : any?
Executes the contents of the specified file as a Lua chunk.
Parameters

filename :

string?

The name of the file to execute.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

any?

Returns the result of the execution.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

When called without arguments, dofile executes the contents of the standard input (stdin). Returns all values returned by the chunk. In case of errors, dofile propagates the error to its caller (i.e, dofile does not run in protected mode).

error ( message, level )
Terminates the last protected function called and returns the message as the error message.
Parameters

message :

string

The error messsage to display.

level :

integer?

Specifies the error position. With level 1 (the default), the error position is where the error function was called. Level 2 points the error to where the function that called error was called; and so on. Passing a level 0 avoids the addition of error position information to the message.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.

Usually, error adds some information about the error position at the beginning of the message.

getfenv ( f ) : table
Returns the currently used environment by the function.
Parameters

f :

fun(any*:any*)

Specifies either a Lua function or a number that specifies the function at that stack level; Level 1 is the function calling getfenv. The default for f is 1.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
Returns

table

The current environment or global environment if f is 0, or if the passed function is not a Lua function.

If the given function is not a Lua function, or if f is 0, getfenv returns the global environment.

getmetatable ( object ) : table?
Returns the metatable of the given object.
Parameters

object :

table

The object whose metatable is retrieved.

Returns

table?

Returns the metatable of the object, if the object's metatable has a "__metatable" field, then the associated value is returned. Returns nil if the given object does not have a metatable.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
ipairs ( t ) : fun(any:any?), table, integer
Returns three values: an iterator function, the table t, and 0, so that the construction for i,v in ipairs(t) do body end will iterate over the pairs (1,t[1]), (2,t[2]), ..., up to the first integer key absent from the table.
Parameters

t :

table

The table to be iterated.

Returns

fun(any:any?)

The iterator function.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

table

The table with the arguments set.

integer

The value 0.

Other related reference items +

next()
load ( func, chunkname ) : fun(any:any), nil, string
Loads a chunk using function func to get its pieces.
Parameters

func :

fun(any:any)

The loader function.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

chunkname :

string?

The chunk to load.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

fun(any:any)

Returns the compiled chunk, if the operation was successful.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

string

The error message for failure.

Each call to func must return a string that concatenates with previous results. A return of an empty string, nil, or no value signals the end of the chunk. If successful, returns the compiled chunk as a function; otherwise, returns nil plus the error message. The environment of the returned function is the global environment. chunkname is used as the chunk name for error messages and debug information. When absent, it defaults to "=(load)".

loadfile ( filename ) : fun(any:any), nil, string
Loads the filename, parses it and returns the compiled chunk as a function.
Parameters

filename :

string?

The name of the file to load.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

fun(any:any)

Returns the compiled chunk, if the operation was successful.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

string

The error message for failure.

Does not execute it. This function is similar to load, but gets the chunk from filename or from the standard input, if no file name is given.

loadstring ( stringarg, chunkname ) : fun(any:any), nil, string
Loads the string, parses it and returns the compiled chunk as a function.
Parameters

stringarg :

string

The string to load.

chunkname :

string?

The chunk to load.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

fun(any:any)

Returns the compiled chunk, if the operation was successful.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

string

The error message for failure.

Does not execute it. This function is similar to load, but gets the chunk from the given string. To load and run a given string, use the idiom assert(loadstring(s))() When absent, chunkname defaults to the given string.

Other related reference items +

string.dump()
module ( name, options ) : table
Creates a module.
Parameters

name :

string

The name for the module.

options :

fun(any*:any*)?

The options for the module.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

table

The created module.

If there is a table in package.loaded[name], this table is the module. Otherwise, if there is a global table t with the given name, this table is the module. Otherwise creates a new table t and sets it as the value of the global name and the value of package.loaded[name]. This function also initializes t._NAME with the given name, t._M with the module (t itself), and t._PACKAGE with the package name (the full module name minus last component; see below). Finally, module sets t as the new environment of the current function and the new value of package.loaded[name], so that require returns t.

If name is a compound name (that is, one with components separated by dots), module creates (or reuses, if they already exist) tables for each component. For instance, if name is a.b.c, then module stores the module table in field c of field b of global a.

This function can receive optional options after the module name, where each option is a function to be applied over the module.

newproxy ( control, data1 ) : userdata
Creates a zero-length userdata with an optional metatable..
Parameters

control :

boolean

Controls if the returned userdata should have a metatable or not.

data1 :

userdata

Needs to be a proxy. The metatable will be shared between the proxies.

Returns

userdata

A zero-length user-data object.

newproxy is a experimental, undocumented and unsupported function in the Lua base library. It can be used to create a zero-length userdata, with a optional proxy.

next ( t, index ) : any?, any?
Traverse all fields of a table and returns the next index of the table and its associated value.
Parameters

t :

table

The table which is iterated over.

index :

any?

An index to the table t.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

any?

The next index of the table.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

any?

The value associated with the returned index.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

When called with nil as its second argument, next returns an initial index and its associated value. When called with the last index, or with nil in an empty table, next returns nil. If the second argument is absent, then it is interpreted as nil. In particular, next(t) can be used to check whether a table is empty.

The order in which the indices are enumerated is not specified, even for numeric indices. (To traverse a table in numeric order, use a numerical for loop or the ipairs function.) The behavior of next is undefined if, during the traversal, you assign any value to a non-existent field in the table. You may however modify existing fields. In particular, you may clear existing fields.

Other related reference items +

pairs()
pairs ( t ) : fun(any*:any*), table, nil
Returns three values: the next function, the table t, and nil, so that the construction for k,v in pairs(t) do body end will iterate over the all key-value pairs of table t.
Parameters

t :

table

A table to iterate over for the key-value pairs.

Returns

fun(any*:any*)

The iterator function.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

table

The table t with the arguments set.

See function next for the caveats of modifying the table during its traversal.

pcall ( f, arg1 ) : boolean, any*
Calls function f with the given arguments in protected mode.
Parameters

f :

fun(any*:any*)

A function that is called in protected mode.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

arg1 :

any*

The arguments that is passed to the function.

The * notation indicates that there may be zero or more instances of the specified type.
Returns

boolean

A status code reporting the status of the function call. If true, the call has succeeded without errors. In such case, pcall also returns all results from the call, after this first result. In case of any error, pcall returns false and the error message.

any*

The result of the function call if successful or an error message if function call resulted in a failure.

The * notation indicates that there may be zero or more instances of the specified type.

This means that any error inside f is not propagated; instead, pcall catches the error and returns a status code (a boolean).

Other related reference items +

xpcall()
print ( arg1 )
Receives any number of arguments, and prints their values to stdout, using the tostring function to convert them to strings.
Parameters

arg1 :

any*

The text to output.

The * notation indicates that there may be zero or more instances of the specified type.
Returns
This function does not return any values.

print is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted output, use string.format.

rawequal ( v1, v2 ) : boolean
Checks whether the two values, v1 and v2 are equal, without invoking any metamethod.
Parameters

v1 :

any

The first value to compare.

v2 :

any

The second value to compare.

Returns

boolean

Returns true if the values are equal and false otherwise.

rawget ( t, index ) : any?
Returns the value of the index in the table, t[index], without invoking any metamethod.
Parameters

t :

table

The table whose values are retrieved.

index :

any

The index to the specified table.

Returns

any?

The value corresponding to the specified index in the table.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
rawset ( t, index, value )
Sets the value for the specified index in the table t[index], without invoking any metamethod.
Parameters

t :

table

The table to modify.

index :

any

The index to the specified table, any value different from nil.

value :

any?

The value (any Lua value) to set for the specified index in the table.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.
require ( modname ) : any
Loads the given module.
Parameters

modname :

string

The name of the module.

Returns

any

The value returned by the loader or an error meassage if a loader is not found.

The function starts by looking into the package.loaded table to determine whether modname is already loaded. If it is, then require returns the value stored at package.loaded[modname]. Otherwise, it tries to find a loader for the module.

To find a loader, require is guided by the package.loaders array. By changing this array, we can change how require looks for a module. The following explanation is based on the default configuration for package.loaders.

First require queries package.preload[modname]. If it has a value, this value (which should be a function) is the loader. Otherwise require searches for a Lua loader using the path stored in package.path. If that also fails, it searches for a C loader using the path stored in package.cpath. If that also fails, it tries an all-in-one loader (see package.loaders).

Once a loader is found, require calls the loader with a single argument, modname. If the loader returns any value, require assigns the returned value to package.loaded[modname]. If the loader returns no value and has not assigned any value to package.loaded[modname], then require assigns true to this entry. In any case, require returns the final value of package.loaded[modname].

If there is any error loading or running the module, or if it cannot find any loader for the module, then require signals an error.

Other related reference items +

package.loaded
package.loaders
package.preload
module()
package.loadlib()
select ( index ) : any*
Returns all arguments after argument index.
Parameters

index :

integer

A number or string following which next arguments are returned.

Returns

any*

The arguments following the index.

The * notation indicates that there may be zero or more instances of the specified type.

If index is a number, this returns all arguments after index. Otherwise index is a string "#", and this function returns the total number of extra arguments it received.

setfenv ( f, t )
Sets the environment to be used by the function f.
Parameters

f :

fun(any*:any*)

A Lua function or a number that specifies the function at that stack level. Level 1 means that this is the current function calling setfenv. As a special case, if f is 0, setfenv changes the environment of the running thread, in which case nothing is returned by setfenv.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

t :

table

The table with the new environment.

Returns
This function does not return any values.

This function returns the same function that is passed as the argument.

setmetatable ( t, metatable ) : table
Sets the metatable for the specified table.(You cannot change the metatable of other types from Lua, only from C.)
Parameters

t :

table

The table whose metatable is set.

metatable :

table

The table to set as the metatable for the given table. If nil, removes the metatable of the table t. If the original metatable has a "__metatable" field, raises an error.

Returns

table

The table with the metatable set.

tonumber ( e, base ) : number
Tries to convert the function argument to a number.
Parameters

e :

any

The argument to convert to a number.

base :

integer

An argument that specifies the base to interpret the numeral. The base may be any integer between 2 and 36, inclusive. In bases above 10, the letter 'A' (in either upper or lower case) represents 10, 'B' represents 11, and so forth, with 'Z' representing 35. In base 10 (the default), the number can have a decimal part, as well as an optional exponent part. In other bases, only unsigned integers are accepted.

Returns

number

The converted number.

If the argument is already a number or a string convertible to a number, then tonumber returns this number; otherwise, returns nil.

tostring ( e ) : string
Converts an argument of any type to a string in a reasonable format.
Parameters

e :

any

The argument to convert to a string. If the metatable of e has a "__tostring" field, then tostring calls the corresponding value with e as argument, and uses the result of the call as its result.

Returns

string

The converted string.

For complete control of how numbers are converted, use string.format.

Other related reference items +

print()
type ( v ) : string
Returns the type of the argument as a string.
Parameters

v :

any

The argument whose type is returned.

Returns

string

The type as a string, possible values are: "nil", "number", "string", "boolean", "table", "function", "thread", and "userdata".

unpack ( list, i, j ) : any*
Returns the elements from the given table.
Parameters

list :

table

The table whose elements are retrieved.

i :

integer?

The index of the table element at which the function will begin unpacking values. Default value of 1.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

j :

integer?

The index of the table element at which the function will stop unpacking values. Default value is the length of the table, as defined by the length operator #.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

any*

The unpacked elements of the table.

The * notation indicates that there may be zero or more instances of the specified type.

This function is equivalent to

    return list[i], list[i+1], ..., list[j]

except that the above code can be written only for a fixed number of elements.

xpcall ( f, err ) : boolean, any*
This function is similar to pcall, except that a new error handler can be set.
Parameters

f :

fun(any*:any*)

A function that is called in protected mode.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..

err :

fun(any:any)

The error handler.

The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
Returns

boolean

A status code reporting the status of the function call. If true, the call has succeeded without errors. In such case, xpcall also returns all results from the call, after this first result. In case of any error, xpcall returns false and the error message.

any*

The result of the function call if successful or an error message if function call resulted in a failure.

The * notation indicates that there may be zero or more instances of the specified type.

xpcall calls function f in protected mode, using err as the error handler. Any error inside f is not propagated; instead, xpcall catches the error, calls the err function with the original error object, and returns a status code.

 bit
Provided for bitwise manipulations.
 coroutine
Provided for independent thread of execution.
 debug
Used for debugging and all functions are provided inside the debug table.
 io
Input/output namespace - Provides functions to create, read and write to files.
 math
Math namespace
 os
Operating System namespace - Provides functions for dealing with system time and date and other OS-related functions.
 package
Package namespace.
 scaleform
The core classes used in the Scaleform Studio.
 string
String namespace
 table
Table namespace
 Matrix2F
A two-dimensional matrix in row-major order.
 Matrix3F
A three-dimensional matrix in row-major order.
 assert (v, message)
Issues an error and aborts the program when the value of its first argument is false( i.e false or nil).
 v : any
Issues an error when this value is false.
 message : string?
The error message to display. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
This value may be an instance of any type.A string of characters.  collectgarbage (options, arg) : any?
A generic interface to the garbage collector.
 options : string?
The various options that can be set for the garbage collector. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 arg : any?
The values passed depending on the option set. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 any?
The result of the function performed according to the options set.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 dofile (filename) : any?
Executes the contents of the specified file as a Lua chunk.
 filename : string?
The name of the file to execute.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 any?
Returns the result of the execution.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 error (message, level)
Terminates the last protected function called and returns the message as the error message.
 message : string
The error messsage to display.
 level : integer?
Specifies the error position. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
A strictly integral numeric value, with no decimal component.  getfenv (f) : table
Returns the currently used environment by the function.
 f : fun(any*:any*)
Specifies either a Lua function or a number that specifies the function at that stack level; Level 1 is the function calling getfenv. [more...]
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 table
The current environment or global environment if f is 0, or if the passed function is not a Lua function.
A Lua table consisting of paired keys and values.  getmetatable (object) : table?
Returns the metatable of the given object.
 object : table
The object whose metatable is retrieved.
 table?
Returns the metatable of the object, if the object's metatable has a "__metatable" field, then the associated value is returned. [more ...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 ipairs (t) : fun(any:any?), table, integer
Returns three values: an iterator function, the table t, and 0, so that the construction for i,v in ipairs(t) do body end will iterate over the pairs (1,t[1]), (2,t[2]), ..., up to the first integer key absent from the table.
 t : table
The table to be iterated.
 fun(any:any?)
The iterator function.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 table
The table with the arguments set.
 integer
The value 0.
 next (t, index) : any?, any?
Traverse all fields of a table and returns the next index of the table and its associated value.
 load (func, chunkname) : fun(any:any), nil, string
Loads a chunk using function func to get its pieces.
 func : fun(any:any)
The loader function.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 chunkname : string?
The chunk to load.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 fun(any:any)
Returns the compiled chunk, if the operation was successful.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 nil  string
The error message for failure.
 loadfile (filename) : fun(any:any), nil, string
Loads the filename, parses it and returns the compiled chunk as a function.
 filename : string?
The name of the file to load.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 fun(any:any)
Returns the compiled chunk, if the operation was successful.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 nil  string
The error message for failure.
 loadstring (stringarg, chunkname) : fun(any:any), nil, string
Loads the string, parses it and returns the compiled chunk as a function.
 stringarg : string
The string to load.
 chunkname : string?
The chunk to load.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 fun(any:any)
Returns the compiled chunk, if the operation was successful.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 nil  string
The error message for failure.
 string.dump (f) : string
Returns a string containing a binary representation of the given function, so that a later loadstring on this string returns a copy of the function.
 module (name, options) : table
Creates a module.
 name : string
The name for the module.
 options : fun(any*:any*)?
The options for the module.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 table
The created module.
 require (modname) : any
Loads the given module.
 newproxy (control, data1) : userdata
Creates a zero-length userdata with an optional metatable..
 control : boolean
Controls if the returned userdata should have a metatable or not.
 data1 : userdata
Needs to be a proxy. [more...]
 userdata
A zero-length user-data object.
true or false.A raw memory buffer that is allocated and maintained in the Lua environment.  t : table
The table which is iterated over.
 index : any?
An index to the table t.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 any?
The next index of the table.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 any?
The value associated with the returned index.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 pairs (t) : fun(any*:any*), table, nil
Returns three values: the next function, the table t, and nil, so that the construction for k,v in pairs(t) do body end will iterate over the all key-value pairs of table t.
 t : table
A table to iterate over for the key-value pairs.
 fun(any*:any*)
The iterator function.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 table
The table t with the arguments set.
 nil  pcall (f, arg1) : boolean, any*
Calls function f with the given arguments in protected mode.
 f : fun(any*:any*)
A function that is called in protected mode.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 arg1 : any*
The arguments that is passed to the function.
The * notation indicates that there may be zero or more instances of the specified type.
 boolean
A status code reporting the status of the function call. [more ...]
 any*
The result of the function call if successful or an error message if function call resulted in a failure.
The * notation indicates that there may be zero or more instances of the specified type.
 xpcall (f, err) : boolean, any*
This function is similar to pcall, except that a new error handler can be set.
 print (arg1)
Receives any number of arguments, and prints their values to stdout, using the tostring function to convert them to strings.
 arg1 : any*
The text to output.
The * notation indicates that there may be zero or more instances of the specified type.
 tostring (e) : string
Converts an argument of any type to a string in a reasonable format.
 rawequal (v1, v2) : boolean
Checks whether the two values, v1 and v2 are equal, without invoking any metamethod.
 v1 : any
The first value to compare.
 v2 : any
The second value to compare.
 boolean
Returns true if the values are equal and false otherwise.
 rawget (t, index) : any?
Returns the value of the index in the table, t[index], without invoking any metamethod.
 t : table
The table whose values are retrieved.
 index : any
The index to the specified table.
 any?
The value corresponding to the specified index in the table.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 rawset (t, index, value)
Sets the value for the specified index in the table t[index], without invoking any metamethod.
 t : table
The table to modify.
 index : any
The index to the specified table, any value different from nil.
 value : any?
The value (any Lua value) to set for the specified index in the table.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 modname : string
The name of the module.
 any
The value returned by the loader or an error meassage if a loader is not found.
 package.loaded
A table used by require to control which modules are already loaded.
 package.loaders
A table used by require to control how to load modules.
 package.preload
A table to store loaders for specific modules (see require).
 package.loadlib (libname, funcname)
Dynamically links the host program with the C library libname.
 select (index) : any*
Returns all arguments after argument index.
 index : integer
A number or string following which next arguments are returned.
 any*
The arguments following the index.
The * notation indicates that there may be zero or more instances of the specified type.
 setfenv (f, t)
Sets the environment to be used by the function f.
 f : fun(any*:any*)
A Lua function or a number that specifies the function at that stack level. [more...]
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 t : table
The table with the new environment.
 setmetatable (t, metatable) : table
Sets the metatable for the specified table.(You cannot change the metatable of other types from Lua, only from C.)
 t : table
The table whose metatable is set.
 metatable : table
The table to set as the metatable for the given table. [more...]
 table
The table with the metatable set.
 tonumber (e, base) : number
Tries to convert the function argument to a number.
 e : any
The argument to convert to a number.
 base : integer
An argument that specifies the base to interpret the numeral. [more...]
 number
The converted number.
A numeric value.  e : any
The argument to convert to a string. [more...]
 string
The converted string.
 type (v) : string
Returns the type of the argument as a string.
 v : any
The argument whose type is returned.
 string
The type as a string, possible values are: "nil", "number", "string", "boolean", "table", "function", "thread", and "userdata".
 unpack (list, i, j) : any*
Returns the elements from the given table.
 list : table
The table whose elements are retrieved.
 i : integer?
The index of the table element at which the function will begin unpacking values. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 j : integer?
The index of the table element at which the function will stop unpacking values. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 any*
The unpacked elements of the table.
The * notation indicates that there may be zero or more instances of the specified type.
 f : fun(any*:any*)
A function that is called in protected mode.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 err : fun(any:any)
The error handler.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 boolean
A status code reporting the status of the function call. [more ...]
 any*
The result of the function call if successful or an error message if function call resulted in a failure.
The * notation indicates that there may be zero or more instances of the specified type.
Nothing; the absence of a value.  f : fun(any*:any*)
A Lua function with no upvalues.
The fun(...) notation indicates that this is a function that accepts parameters of the types shown to the left of the colon :, and that returns the types shown to the right of the colon..
 string
A string containing the binary representation of the function.
 libname : string
The name of the library to link.
 funcname : string
The name of the function to search for.
Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.
Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.
Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.
Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.
Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.
Please send us your comment about this page