Cafu Engine
globals Class Reference

The functions in this group are globals, and are used exactly like the functions from the basic Lua library. More...

Public Member Functions

 thread (function f)
 This function registers the given Lua function as a new thread (a Lua coroutine). More...
 
 wait (number t)
 This is an alias for coroutine.yield() from the Lua standard library. More...
 
 waitFrame (number t)
 This is another alias for coroutine.yield() from the Lua standard library. More...
 

Detailed Description

The functions in this group are globals, and are used exactly like the functions from the basic Lua library.

Member Function Documentation

thread ( function  f)

This function registers the given Lua function as a new thread (a Lua coroutine).

Also see wait() for a closely related function.

wait ( number  t)

This is an alias for coroutine.yield() from the Lua standard library.

It is used in threads (Lua coroutines) in order to suspend the execution of the thread. When called, control is given back to other parts of the program, and the thread will automatically be resumed later.

Note that the parameter t is optional: calling wait() is the same as calling wait(0).

Parameters
tThe time in seconds to wait before the thread is resumed. If omitted or 0, the thread is resumed in the next frame.
waitFrame ( number  t)

This is another alias for coroutine.yield() from the Lua standard library.

See wait() for details.