This build of the Mhatxotic Engine API consists of 822 functions (387 members, 435 methods) and 27 consts in 29 namespaces with 83 commands and 207 cvars.
The archive class allows the programmer to load 7-zip archives into the engine in which any file loaded by the engine may exist in these archives as well. Although those files that exist on disk will always override any archive based file which is configured by the 'ast_override' cvar. Archives with the extension specified in the cvar 'ast_bundles' in the current working directory will automatically be loaded at startup which is ".adb" by default (not .7z). The executable file on Win32 systems is automatically loaded at startup in addition so that a programmer can store all assets inside the executable for portable distribution. Of course the LZMA library handles the opening of such files so any such format of .7z file will work fine. Although it is recommended not to use solid archives as reading these archives will be extremely slow. Also note that encrypted or split archives are not supported yet as these features are not handled by the LZMA library.
The Asset class allows the programmer to load files from disk for personal use and manipulation of that data with codecs or manually by the programmer.
The audio class allows control of audio subsystem.
The core class allows manipulation of and retrieve information from the game engine itself.
The window class contains functions for manipulating the Window.
The fbo class allows the programmer to create an OpenGL frame-buffer object which they can use to create seperate drawing canvases which they can apply special effects to without modifying other canvases.
The file class allows the programmer to read and write files from the game directory.
The font class allows dynamic creation from font files using the FREETYPE library.
This allows the programmer to manipulate images asynchronously and send the objects to the OpenGL if needed. The list and order of supported formats can is subject to change without notice. Type 'imgfmts' in the console to see the most up to date list of formats supported.
The input class allows the programmer to query the state of the keyboard, mouse and game controllers.
The mask class is a pixel-perfect 1-bit bitmask processing API which allows the programmer to create destructable terrain and collision testing whether the test maybe between two sprites or actual terrain background. You can create bitmasks as big as the system will allow.
The palette class allows creating and modifying palettes and uploading them to the GPU for use with 8-bit paletted textures. Only one palette can be active at once and textures marked with LF_PALETTE are affected by the palette.
This allows the programmer to load pcm wave forms or decompress encoded pcm waveforms and send the objects to the OpenAL if needed. You can use the command 'pcmfmts' to see what formats are usable which are WAV (WaveForm Audio Format) PCM/INT/FLOAT/LE, CAF (CoreAudio Format), PCM/INT/FLOAT/LE/BE, OGG (OGG Vorbis) and MP3 (MPEG-Layer III).
The socket class allows the programmer to connect to a remote network using OpenSSL encryption or unencrypted connection. There is also basic support for HTTP connections, or you can write your own routines for that or any other protocol in Lua!
The source is a sound channel in OpenAL that can be manipulated such as */ changing volume, pitch, position and other things. It can only be */ created by the Sample:Play() function.
Allows creating of tables with properly justified and proportioned data. Useful for the neat display of debug data to the console or logging to a file.
The stream class allows loading of large audio files such as ambience or music fuiles which are streamed into and played back from multiple buffers. Only .OGG file format is supported at the moment. The entire file will be loaded into memory in it's compressed form. It will be decompressed into multiple buffers during playback. The 'aud_strbufcount' cvar controls how many buffers are used to stream. The 'aud_strbufsiz' cvar controls the size of each buffers. Since playback is done in separate threads, there is not much need to modify any of the above settings.
The texture class allows the programmer to draw textures on the screen which also includes font management.
This contains miscellaneous utility functions such as crypto, string, number integer and time manipulation functions.
The video class allows loading of video streams using the Theora video codec, vorbis audio codec and ogg format container (.OGV) which will playback into a frame buffer object.
Console commands that can see and manipulate all the data in the engine.
Variables that change the behaviour of the engine.
Handle = Archive.Load(Filename)
Filename (string) = The filename of the archive to load
Handle (Archive) = A handle to the loaded archive
Loads the specified 7-zip archive. All subsequent top-level assets operations will operate with this archive included as well and all files in this archive will override any previously loaded archives.
Files on disk will always override any archived files. Please note that you should NOT use solid archives or there could be extreme performance issues while extracting files from it, this is by LZMA design.
Archive.LoadAsync(Filename, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the archive to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the file is laoded
Loads a 7-zip archive ogg file off the main thread. The callback functions send an argument to the archive object that was created. See Asset.Archive' for more notes about loading 7-zip files.
Archive.WaitAsync()
Halts main-thread execution until all async archive events have completed
Archive:Destroy()
Destroys the archive and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Name, UId = Archive:Dir(Id)
Id (integer) = Zero-index id of the directory
Name (string) = The filename of the directory inside the archive
UId (integer) = The unique id of the directory inside the archive
Returns the name and unique id of the directory in the archive
Directories = Archive:DirList()
Directories (Table) = A list of directories inside the archive
Returns all the directories inside the archive.
Directories = Archive:Dirs()
Directories (integer) = Total number of directories inside the archive
Returns total number of the directories inside the archive.
Total = Archive:File(Name, Id)
Name (string) = The filename of the file inside the archive
Id (integer) = The unique id of the file inside the archive
Total (integer) = Zero-index id of the file
Returns the name and unique id of the file in the archive
Directories = Archive:FileList()
Directories (Table) = A list of files inside the archive
Returns all the files inside the archive.
Files = Archive:Files()
Files (integer) = Total number of files inside the archive
Returns total number of the files inside the archive.
Id = Archive:Id()
Id (integer) = The id number of the Archive object.
Returns the unique id of the Archive object.
Name = Archive:Name()
Name (string) = Name of the archive.
Returns the name of the archive which was loaded.
Size = Archive:Size(Id)
Id (integer) = The zero-index unique-id of the file/dir in archive
Size (integer) = The uncompressed size of the file/dir in the archive
Returns the uncompressed size of the file
Total = Archive:Total()
Total (integer) = Total number of files and directories in archive
Returns the total number of files and directories in archive
Object = Asset.Asset(Id, Data, Flags)
Id (string) = The filename of the file load
Data (Asset) = The array to duplicate
Flags (integer) = Special operations to perform during load
Object (Asset) = The new duplicated data array
Copies, decompresses or decrypts the specified asset on the main thread.
Asset.AssetAsync(Id, Data, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Id (string) = The user specified identifier of the asset.
Data (Asset) = The asset class to process.
Flags (integer) = Special operations to perform during load.
ErrorFunc (function(Reason:string)) = Error callback.
ProgressFunc (function(Cmd:integer,...)) = In-progress callback.
SuccessFunc (function(Data:Asset)) = Succession callback.
Consumes, copies, decompresses or decrypts a the specified asset off the main thread.
Params... = Asset.Compile(Filename)
Filename (string) = The name of the file to parse
Params... (*) = The parameters the function returned
Compiles the specified file and returns the function
Function = Asset.CompileBlock(Name, Data)
Name (string) = The name of the block to help identify the the source.
Data (Asset) = The data to execute.
Function (function) = The function.
Compiles the specified asset and returns the function.
Binary = Asset.CompileFunction(Debug, Function)
Debug (boolean) = Include debug data?
Function (function) = The function to compile.
Binary (Asset) = The asset containing the compiled data.
Compiles the specified Lua function and returns the binary compiled data.
Function = Asset.CompileString(Name, Code)
Name (string) = The name of the string to help identify the the source.
Code (string) = The block of LUA code to compile.
Function (function) = The function
Compiles the specified string and returns the function
Handle = Asset.Create(Id, Size)
Id (string) = The user specified identifier of the asset.
Size (integer) = Number of bytes of memory to allocate.
Handle (Asset) = Handle to the array cless.
Allocates the specified amount of system memory for you to read and write to. The memory is zero'd out after allocation for security reasons.
Entries = Asset.Enumerate(Directory, OnlyDir)
Directory (string) = The directory to scan (can only be exedir or below).
OnlyDir (string) = Only enumerate directories.
Entries (table) = The files or directories enumerated.
Enumerates the list of files from the specified directory.
Entries = Asset.EnumerateEx(Directory, Extension, OnlyDir)
Directory (string) = The directory to scan (can only be exedir or below).
Extension (string) = The extension of the files to filter.
OnlyDir (string) = Only enumerate directories.
Entries (table) = The files or directories enumerated.
Enumerates the list of files from the specified directory.
Asset.Exec(CmdLine, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
CmdLine (string) = The command-line to execute
Flags (integer) = Special operations to perform during load
ErrorFunc (function(Reason:string)) = Error callback.
ProgressFunc (function(Cmd:integer,...)) = In-progress callback.
SuccessFunc (function(Data:Asset)) = Succession callback.
Executes the specified command-line, stores all the output and sends it for optional processing with the specified flags.
Asset.ExecEx(CmdLine, Flags, Input, ErrorFunc, ProgressFunc, SuccessFunc)
CmdLine (string) = The command-line to execute
Flags (integer) = Special operations to perform during load
Input (Asset) = The data to send to the application before waiting for output
ErrorFunc (function(Reason:string)) = Error callback.
ProgressFunc (function(Cmd:integer,...)) = In-progress callback.
SuccessFunc (function(Data:Asset)) = Succession callback.
Executes the specified command-line, stores all the output and sends it for optional processing with the specified flags. The 'Input' is consumed by the call and sent to the applications 'stdin' on successful execution startup.
Handle = Asset.File(Filename, Flags)
Filename (string) = The filename of the file to load
Flags (integer) = Special operations to perform during load
Handle (Asset) = The asset object
Loads a file from assets in the main thread.
Asset.FileAsync(Filename, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename to load.
Flags (integer) = Special operations to perform during load.
ErrorFunc (function(Reason:string)) = Error callback.
ProgressFunc (function(Cmd:integer,...)) = In-progress callback.
SuccessFunc (function(Data:Asset)) = Succession callback.
Loads the specified file on disk or from archives off the main thread.
Status = Asset.FileExists(Filename)
Filename (string) = The name of the file to check
Status (boolean) = Is the file availabe
Checks if the specified file exists and is readable. The file is checked from the executable directory first and if not found or unable to open then the function traverses archives. Use this function to make sure exceptions aren't raised when loading files with any API function.
Params..., ...Last = Asset.Parse(Filename, Returns)
Filename (string) = The name of the file to parse.
Returns (integer) = The number of returns expected from the call.
Params... (*) = The parameters the function returned.
...Last (integer) = The result code of the compilation.
Compiles and executes the specified string and returns a function and how the code was (re)compiled and cached.
Params..., ...Last = Asset.ParseBlock(Name, Returns, Data)
Name (string) = The name of the block to help identify the the source.
Returns (integer) = The number of returns expected from the call.
Data (Asset) = The data to execute
Params... (*) = The parameters the function returned
...Last (integer) = The result code of the compilation
Compiles and executes the specified asset. Prefix the name with '!' to disable caching of this code and not pollute the code cache.
Params..., ...Last = Asset.ParseString(Name, Returns, Code)
Name (string) = The name of the string to help identify the the source.
Returns (integer) = The number of returns expected from the call.
Code (string) = The block of LUA code to execute.
Params... (*) = The parameters the function returned
...Last (integer) = The result code of the compilation
Compiles and executes the specified string. Prefix the name with '!' to disable caching of this code and not pollute the code cache.
Handle = Asset.String(Id, Text, Flags)
Id (string) = The filename of the file to load
Text (string) = The string of the data to process
Flags (integer) = Special operations to perform during load
Handle (Asset) = The asset object
Copies, decompresses or decrypts a string into an asset class in the main thread.
Asset.WaitAsync()
Halts main-thread execution until all async asset events have completed
Asset:BitClear(Position)
Position (integer) = Position (in bits) to clear the bit from.
Clears the bit at the specified position. Remember this is the bit position and not a byte position.
Asset:BitFlip(Position)
Position (integer) = Position (in bits) to flip the bit from.
Flips the bit at the specified position. Remember this is the bit position and not a byte position.
Asset:BitSet(Position)
Position (integer) = Position (in bits) to set the bit from.
Sets the bit at the specified position. Remember this is the bit position and not a byte position.
Set = Asset:BitTest(Position)
Position (integer) = Position (in bits) to set the bit from.
Set (boolean) = Boolean to show if the bit is set or not.
Sets the bit at the specified position. Remember this is the bit position and not a byte position.
Asset:Clear()
Same as Asset:F64 but automatically assumes zero fill.
Output = Asset:Crop(Position, Bytes)
Position (integer) = Position to start crop at.
Bytes (integer) = Number of bytes to keep.
Output (Asset) = A new asset block containing the cropped memory.
Crops the specified array from the specified position and the specified number of bytes.
Asset:Destroy()
Frees the internal memory allocated to the asset. The object will no longer be useable after this call and an error will be generated if accessed.
Handle = Asset:Duplicate()
Handle (Asset) = Handle to the duplicated asset.
Duplicates the specified asset. By default arrays will move their data across. This allows you to create a duplicate of the specified asset to not destory the original.
Asset:Fill(Position, Bytes, Value)
Position (integer) = Starting position to start filling at.
Bytes (integer) = Number of bytes to fill.
Value (integer|number) = The value to fill with.
Fills the buffer with the specified value. If the value cannot fit in the specified size at the end of the allocated buffer then the remainder is still filled with as much data from the specified value as it can.
Actual functions (Replace 'Fill' with one of the following)...
- FF32 = Fills each float with the specified value.
- FF32BE = Same as FF32 but forces the specified value to big-endian.
- FF32LE = Same as FF32 but forces the specified value to little-endian.
- FF64 = Fills each double with the specified value.
- FF64BE = Same as FF64 but forces the specified value to big-endian.
- FF64LE = Same as FF64 but forces the specified value to little-endian.
- FI16 = Fills each signed word with the specified value.
- FI16BE = Same as FI16 but forces the specified value to big-endian.
- FI16LE = Same as FI16 but forces the specified value to little-endian.
- FI32 = Fills each signed dword with the specified value.
- FI32BE = Same as FI32 but forces the specified value to big-endian.
- FI32LE = Same as FI32 but forces the specified value to little-endian.
- FI64 = Fills each signed qword with the specified value.
- FI64BE = Same as FI64 but forces the specified value to big-endian.
- FI64LE = Same as FI64 but forces the specified value to little-endian.
- FI8 = Fills each signed character at the specified position.
- FU16 = Fills each unsigned word with the specified value.
- FU16BE = Same as FU16 but forces the specified value to big-endian.
- FU16LE = Same as FU16 but forces the specified value to little-endian.
- FU32 = Fills each unsigned dword with the specified value.
- FU32BE = Same as FU32 but forces the specified value to big-endian.
- FU32LE = Same as FU32 but forces the specified value to little-endian.
- FU64 = Fills each unsigned qword with the specified value.
- FU64BE = Same as FU64 but forces the specified value to big-endian.
- FU64LE = Same as FU64 but forces the specified value to little-endian.
- FU8 = Fills each unsigned character at the specified position.
Position = Asset:Find(Text)
Text (string) = String to find in array.
Position (integer) = Position of occurrence.
Finds the first occurence of 'Text' in array from the beginning.
Position = Asset:FindEx(Text, Position)
Text (string) = String to find in array.
Position (integer) = Position to start checking for occurences.
Position (integer) = Position of occurrence.
Finds the first occurrence of 'Text' in array from the specified position.
Id = Asset:Id()
Id (integer) = The id number of the Asset object.
Returns the unique id of the Asset object.
Asset:Invert(Position, Bits)
Position (integer) = Position to invert.
Bits (integer) = Bits to invert (I*F functions only, all bits otherwise).
Flips the specified bits at the specified position.
Actual functions (Replace 'Invert' with one of the following)...
- I8 = Inverts bits 0-7 at the specified position.
- I8F = Inverts specified bits between 0-7 at the specified position.
- I16 = Inverts bits 0-15 at the specified position.
- I16F = Inverts specified bits between 0-15 at the specified position.
- I16FBE = Same as I16F but forces the specified bits to be big-endian.
- I16FLE = Same as I16F but forces the specified bits to be litten-endian.
- I32 = Inverts bits 0-31 at the specified position.
- I32F = Inverts specified bits between 0-32 at the specified position.
- I32FBE = Same as I32F but forces the specified bits to be big-endian.
- I32FLE = Same as I32F but forces the specified bits to be litten-endian.
- I64 = Inverts bits 0-63 at the specified position.
- I64F = Inverts specified bits between 0-63 at the specified position.
- I64FBE = Same as I64F but forces the specified bits to be big-endian.
- I64FLE = Same as I64F but forces the specified bits to be litten-endian.
Name = Asset:Name()
Name (string) = Name of the asset.
If this asset was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
Value = Asset:Read(Position)
Position (integer) = Position to write in the array.
Value (integer|number) = Value at the specified position.
Reads the specified integer at the specified position in the array.
Actual functions (replace 'Read' with one of the following)...
- RF32 = Reads a 32-bit IEEE754 number from the specified position.
- RF32BE = Same as RF32 but forces the return value to big-endian.
- RF32LE = Same as RF32 but forces the return value to little-endian.
- RF64 = Reads a 64-bit IEEE754 number from the specified position.
- RF64BE = Same as RF64 but forces the return value to big-endian.
- RF64LE = Same as RF64 but forces the return value to little-endian.
- RI16 = Reads a 16-bit signed integer from the specified position.
- RI16BE = Same as RI16 but forces the return value to big-endian.
- RI16LE = Same as RI16 but forces the return value to little-endian.
- RI32 = Reads a 32-bit signed integer from the specified position.
- RI32BE = Same as RI32 but forces the return value to big-endian.
- RI32LE = Same as RI32 but forces the return value to little-endian.
- RI64 = Reads a 64-bit signed integer from the specified position.
- RI64BE = Same as RI64 but forces the return value to big-endian.
- RI64LE = Same as RI64 but forces the return value to little-endian.
- RI8 = Reads a 8-bit signed integer from the specified position.
- RU16 = Reads a 16-bit unsigned integer from the specified position.
- RU16BE = Same as RU16 but forces the return value to big-endian.
- RU16LE = Same as RU16 but forces the return value to little-endian.
- RU32 = Reads a 32-bit unsigned integer from the specified position.
- RU32BE = Same as RU32 but forces the return value to big-endian.
- RU32LE = Same as RU32 but forces the return value to little-endian.
- RU64 = Reads a 64-bit unsigned integer from the specified position.
- RU64BE = Same as RU64 but forces the return value to big-endian.
- RU64LE = Same as RU64 but forces the return value to little-endian.
- RU8 = Reads a 8-bit unsigned integer from the specified position.
Asset:Resize(Size)
Size (integer) = The new size of the array in bytes.
Resizes the specified array.
Asset:ResizeUp(Size)
Size (integer) = The new size of the array in bytes.
Resizes the specified array upwards but never downwards.
Asset:Reverse()
Completely reverses all the bytes in the array.
Size = Asset:Size()
Size (integer) = Size of the array in bytes.
Returns the size of the array.
Asset:Swap(Position)
Position (integer) = Position to swap the bytes at
Swaps the high/low order bits at the specified position.
Actual functions (replace 'Swap' with one of the following)...
- S8 = Swaps high/low 4-bits.
- S16 = Swaps high/low 8-bits.
- S32 = Swaps high/low 16-bits.
- S64 = Swaps high/low 32-bits.
Bytes = Asset:ToFile(Filename)
Filename (string) = Filename to write to.
Bytes (integer) = Number of bytes written.
Dumps the array to the specified file on disk. Useful for debugging.
Text = Asset:ToString()
Text (string) = The array converted to a string.
Converts the array to a string. This is binary safe but will obviously terminate at the first null character or at the end of array, whichever comes first.
Asset:Write(Position, Value)
Position (integer) = Position to write the integer to in the array.
Value (integer|number) = Value to write to the array.
Writes the specified integer at the specified position in the array.
Actual functions (replace 'WriteInt' with one of the following)...
- RF32 = Writes a 32-bit IEEE754 number to the specified position.
- RF32BE = Same as RF32 but forces the specified value to big-endian.
- RF32LE = Same as RF32 but forces the specified value to little-endian.
- RF64 = Writes a 64-bit IEEE754 number to the specified position.
- RF64BE = Same as RF64 but forces the specified value to big-endian.
- RF64LE = Same as RF64 but forces the specified value to little-endian.
- WI16 = Writes a 16-bit signed integer to the specified position.
- WI16BE = Same as WI16 but forces the return value to big-endian.
- WI16LE = Same as WI16 but forces the return value to little-endian.
- WI32 = Writes a 32-bit signed integer to the specified position.
- WI32BE = Same as WI32 but forces the return value to big-endian.
- WI32LE = Same as WI32 but forces the return value to little-endian.
- WI64 = Writes a 64-bit signed integer to the specified position.
- WI64BE = Same as WI64 but forces the return value to big-endian.
- WI64LE = Same as WI64 but forces the return value to little-endian.
- WI8 = Writes an 8-bit signed integer to the specified position.
- WU16 = Writes a 16-bit unsigned integer to the specified position.
- WU16BE = Same as WU16 but forces the return value to big-endian.
- WU16LE = Same as WU16 but forces the return value to little-endian.
- WU32 = Writes a 32-bit unsigned integer to the specified position.
- WU32BE = Same as WU32 but forces the return value to big-endian.
- WU32LE = Same as WU32 but forces the return value to little-endian.
- WU64 = Writes a 64-bit unsigned integer to the specified position.
- WU64BE = Same as WU64 but forces the return value to big-endian.
- WU64LE = Same as WU64 but forces the return value to little-endian.
- WU8 = Writes an 8-bit unsigned integer to the specified position.
Codes = Asset.Flags
Codes (table) = The table of key/value pairs of available flags
A table of loading flags available. Returned as key/value pairs. The value is a unique identifier to the flag.
Codes = Asset.ParseResult
Codes (table) = The table of key/value pairs of available parse results
A table containing results for parse commands.
Codes = Asset.Progress
Codes (table) = The table of key/value pairs of available progress commands
A table of loading commands for the progress callback. The first paramter in that callback is one of these.
Volume = Audio.GetGlobalVolume()
Volume (number) = Current master volume (0 to 1).
Returns global/master volume.
Count = Audio.GetNumPBDevices()
Count (integer) = The number of playback devices detected.
Returns the number of audio playback devices detected by OpenAL.
Name = Audio.GetPBDeviceName(Id)
Id (integer) = The playback audio device id.
Name (string) = The name of the audio playback device.
Returns the name of the playback audio device at id.
Volume = Audio.GetSampleVolume()
Volume (number) = Current samples volume (0 to 1).
Returns master volume of all sample classes.
Volume = Audio.GetStreamVolume()
Volume (number) = Current streams volume (0 to 1).
Returns master volume of all stream classes.
Volume = Audio.GetVideoVolume()
Volume (number) = Current samples volume (0 to 1).
Returns master volume of all video classes.
Result = Audio.Reset()
Result (boolean ) = Was the event sent successfully?
Resets the audio subsystem completely. Currently playing streams and samples should resume playing after the reset. The function will return 'false' if the request was already sent.
Audio.SetGlobalVolume(Volume)
Volume (number) = New master volume (0 to 1).
Sets new master/global volume of all current and new streams/samples. This does not modify the cvar which controls the default sample volume.
Audio.SetOrientation(XLook, YLook, ZLook, XUp, YUp, ZUp)
XLook (number) = New X listener look orientation.
YLook (number) = New Y listener look orientation.
ZLook (number) = New Z listener look orientation.
XUp (number) = New X listener up orientation.
YUp (number) = New Y listener up orientation.
ZUp (number) = New Z listener up orientation.
Sets the new audio listener orientation. This would normally be equal to orientation of the game's protagonist character (if applicable).
Audio.SetPosition(X, Y, Z)
X (number) = New X listener position.
Y (number) = New Y listener position.
Z (number) = New Z listener position.
Sets the new audio listener position. This would normally be equal to the position of the game's protagonist character (if applicable).
Audio.SetSampleVolume(Volume)
Volume (number) = New samples volume (0 to 1).
Sets new volume of all current and new samples. This does not modify the cvar which controls the default sample volume.
Audio.SetStreamVolume(Volume)
Volume (number) = New streams volume (0 to 1).
Sets new volume of all current and new streams. This does not modify the cvar which controls the default sample volume.
Audio.SetVelocity(X, Y, Z)
X (number) = New X listener velocity.
Y (number) = New Y listener velocity.
Z (number) = New Z listener velocity.
Sets the new audio listener velocity. This would normally be equal to velocity of the game's protagonist character (if applicable).
Audio.SetVideoVolume(Volume)
Volume (number) = New samples volume (0 to 1).
Sets new volume of all current and new videos. This does not modify the cvar which controls the default video volume.
Handle = Bin.Create(Width, Height)
Width (integer) = The width of the bin in units
Height (integer) = The height of the bin in units
Handle (Bin) = Handle to the Bin class
Creates an empty bin of the specified size.
Bin:Destroy()
Destroys the bin and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Success = Bin:Enlarge(Width, Height)
Width (integer) = The new width of the bin in units
Height (integer) = The new height of the bin in units
Success (boolean) = The enlargement was a success
Makes the specified bin bigger for you to put more rects in. Note this is a dirty operation. None of the original bounds are modified, only new new empty rects are added, i.e. sub-bins to explain it simply.
Height = Bin:Height()
Height (integer) = The height of the bin in units
Returns the height of the bin in units.
Id = Bin:Id()
Id (integer) = The id number of the Bin object.
Returns the unique id of the Bin object.
X1, Y1, X2, Y2 = Bin:Insert(Width, Height)
Width (integer) = The width of the item to insert in units
Height (integer) = The height of the item to insert in units
X1 (integer) = The X1 position of the item inserted
Y1 (integer) = The Y1 position of the item inserted
X2 (integer) = The X2 position of the item inserted
Y2 (integer) = The Y2 position of the item inserted
Inserts the specified rectangle in the bin. All values returned are zero on failure.
Height = Bin:Occupancy()
Height (integer) = The height of the bin in units
Returns the height of the bin in units.
X1, Y1, X2, Y2 = Bin:Test(Width, Height)
Width (integer) = The width of the item to insert in units
Height (integer) = The height of the item to insert in units
X1 (integer) = The X1 position of the item inserted
Y1 (integer) = The Y1 position of the item inserted
X2 (integer) = The X2 position of the item inserted
Y2 (integer) = The Y2 position of the item inserted
Test inserts the specified rectangle in the bin. All values returned are zero on failure.
Width = Bin:Width()
Width (integer) = The width of the bin in units
Returns the width of the bin in units.
Clip.Get(Identifier, Completion)
Identifier (string) = The identifier for the request.
Completion (function) = The function to call when completed.
Retrieves text from the operating systems clipboard. Executes the specified function when completed as the window thread has to request the operation and then forward the request back to the engine thread.
Clip.Set(Identifier, Text, Completion)
Identifier (string) = The identifier for the request.
Text (string) = The text to copy.
Completion (function) = The function to call when completed.
Stores the specified text into the operating system's clipboard and executes the specified completion function when done as the window thread has to request the operation and then forward the request back to the engine thread.
Clip:Destroy()
Destroys the specified Clip object.
Id = Clip:Id()
Id (integer) = The id number of the Clip object.
Returns the unique id of the Clip object.
Identifier = Clip:Name()
Identifier (string ) = The identifier given at creation.
Returns the identifier of this request given at creation.
Value = Clip:Value()
Value (string ) = The value retrieved from or sent to the Clip.
Returns the value sent with Clip.Set or the value retrieved with Clip.Get.
Registered = Command.Exists(Identifier)
Identifier (string) = The console command name to lookup
Registered (boolean) = True if the command is registered
Returns if the specified console command is registered which includes the built-in engine console commands too.
Object = Command.Register(Identifier, Minimum, Maximum, Callback)
Identifier (string) = The console command name.
Minimum (integer) = The minimum number of parameters allowed.
Maximum (integer) = The maximum number of parameters allowed.
Callback (function) = Pointer to the function to callback.
Object (Command) = The class object created.
Registers the specified console command and returns a reference to the newly created object which unregisters the console command when garbage collected.
Command:Destroy()
Unregisters the specified console command.
Id = Command:Id()
Id (integer) = The id of the Command object.
Returns the unique id of the Command object.
Name = Command:Name()
Name (string) = The name of the console command.
Returns the name of the console command this object was registered with.
CPUid, Count, Speed, Family, Model, Stepping = Core.CPU()
CPUid (string) = The CPUID string.
Count (integer) = Number of threads available to the engine.
Speed (integer) = Processor frequency in Hz.
Family (integer) = Processor family.
Model (integer) = Processor model.
Stepping (integer) = Processor stepping.
Returns information about the installed Central Processing Unit.
FPS = Core.CPUFPS()
FPS (number) = Frames per second.
Get CPU loops processed in the last second. Should be the same as GPU for most people but at times may be different, sometimes much higher.
Percent = Core.CPUProcUsage()
Percent (number) = Percentage process.
Returns the engine CPU load. It is hard-coded to only update once a a second so constant calls won't stress the kernel.
Percent = Core.CPUSysUsage()
Percent (number) = Percentage system.
Returns the system CPU load. It is hard-coded to only update once a a second so constant calls won't stress the kernel.
Percent, Percent = Core.CPUUsage()
Percent (number) = Percentage process.
Percent (number) = Percentage system.
Returns the engine and system CPU load. Use this instead of the other two cpu usage functions if you need both values. This omits a second check to update cpu usage and very slightly more optimal than calling both cpu usage functions which are hard-coded to only update once a a second so constant calls won't stress the kernel.
Core.Catchup()
Resets the high resolution timer and resets the accumulator. Please be advised that the video system relies on this timer so videos will not play properly if this is constantly used. Only use when doing loading screens.
Time = Core.Delay()
Time (number) = Delay time in seconds.
Returns the current thread delay time in seconds without having to read the 'vid_delay' variable. This would be useful if you are actually using the delay and you want to offset a time point by the thread delay.
Core.Done()
Confirms that you want the engine to exit. This is so you can perform clean up actions in your own time by setting Core.SetEnd(), then calling this function to confirm you're done.
Core.End()
Ends LUA execution and enables the console.
Title, Vendor, Major, Minor, Build, Revision, Bits, Type, Target, Compiled, Compiler, CompVersion = Core.Engine()
Title (string) = Title of engine (normally Mhatxotic Engine).
Vendor (string) = Author of engine (normally Mhatxotic Design).
Major (integer) = Major version number of engine.
Minor (integer) = Minor version number of engine.
Build (integer) = Build version number of engine.
Revision (integer) = Revision version number of engine.
Bits (integer) = Bits version number of engine (32 or 64).
Type (string) = Text representation of built type (Release,Alpha,Beta).
Target (string) = Text string of the type of executable file.
Compiled (string) = The timestamp of the executable compilation time.
Compiler (string) = The name of the compiler that built the executable.
CompVersion (string) = The version of the compiler that built the executable.
Returns version information about the engine.
Value = Core.Env(Value)
Value (string) = The name of the variable to query.
Value (string) = The value of the specified variable.
Queries the specified environment variable. Returns a blank string if empty. All environment variables are converted to upper-case at startup.
Type 'env' in the console to see the current environment.
Events = Core.Events()
Events (integer) = Number of events in the engine events system.
Returns the number of events in the engine event system. Helps with synchronising Video or Stream class events.
Boolean = Core.IsOSLinux()
Boolean (boolean) = True if using Linux, false if not.
Returns true if executable was built for Linux, false if not.
Boolean = Core.IsOSMac()
Boolean (boolean) = True if using MacOS, false if not.
Returns true if executable was built for MacOS, false if not.
Boolean = Core.IsOSWindows()
Boolean (boolean) = True if using Windows, false if not.
Returns true if executable was built for Windows, false if not.
Result = Core.KillPid(Pid)
Pid (integer) = The pid of the executable to kill.
Result (boolean) = The process is killed?
Kills the specified process id. This only works on pids that were originally spawned by the engine. Specifying pid zero will cause an exception.
Time = Core.LUAMicroTime()
Time (integer) = The time in microseconds.
Returns the total time in the LUA sandbox in microseconds.
Time = Core.LUAMilliTime()
Time (integer) = The execution time in milliseconds.
Returns the total time in the LUA sandbox in milliseconds.
Time = Core.LUANanoTime()
Time (integer) = The time in nanoseconds.
Returns the total time in the LUA sandbox in nanoseconds.
Timestamp = Core.LUATime()
Timestamp (number) = The execution time as a number.
Returns the total time in the LUA sandbox in seconds.
Bytes = Core.LUAUsage()
Bytes (integer) = Bytes of memory.
Returns the amount of memory in use by Lua
Name, Version, Id, Website, Copyright, Author = Core.Library(Id)
Id (integer) = The index of the license.
Name (string) = Name of the credit.
Version (string) = Version of the api.
Id (integer) = License index.
Website (string) = Website of the api.
Copyright (string) = Copyright of the api.
Author (string) = Author of the api.
Shows the full credits information of the specified api index.
Name, Text = Core.License(Id)
Id (integer) = The index of the license.
Name (string) = Name of the license.
Text (string) = Full text file of the license.
Shows the full license information of the specified index.
LocaleID = Core.Locale()
LocaleID (number) = Locale id.
Returns the system locale id.
Core.Log(Text)
Text (string) = The line of text to write to the log.
Writes the specified line of text to the engine log with highest level.
Core.LogEx(Text, Level)
Text (string) = The line of text to write to the log.
Level (integer) = The log severity level.
Writes the specified line of text to the engine log. Note that if the current log level cvar setting is below this then the function does not log anything.
Name, Major, Minor, Build, Platform, SPack, Suite, ProdType, Bits, Extra = Core.OS()
Name (string) = Operating system type (Windows,Linux,MacOS).
Major (integer) = Major version number of operating system.
Minor (integer) = Minor version number of operating system.
Build (integer) = Build version number of operating system.
Platform (integer) = Platform version number of operating system (Windows).
SPack (integer) = Service pack number of operating system (Windows).
Suite (integer) = Suite number of operating system (Windows).
ProdType (integer) = Product number of operating system (Windows).
Bits (integer) = Bits version of operating system.
Extra (string) = Extra operating system information (e.g. Wine/Kernel).
Returns version information about the operating system.
Time = Core.OSMicroTime()
Time (integer) = The time in microseconds.
Returns the time elapsed in microseconds since the OS started. Precision will be lost over time.
Time = Core.OSMilliTime()
Time (integer) = The time in milliseconds.
Returns the time elapsed in milliseconds since the OS started. Precision will be lost over time.
Time = Core.OSNanoTime()
Time (integer) = The time in nanoseconds.
Returns the time elapsed in nanoseconds since the OS started. Precision will be lost over time.
Timestamp = Core.OSNumTime()
Timestamp (number) = The UNIX timestamp as a number.
Returns a unix timestamp of the current time in seconds as a number.
Timestamp = Core.OSTime()
Timestamp (integer) = The UNIX timestamp.
Returns a unix timestamp of the current time in seconds.
Core.OnEnd(Func)
Func (function) = The main end function to change to.
The function address to execute when the engine has been asked to.
terminate. The function _MUST_ call Core.Done() when that function has finished tidying up or the engine will soft-lock. Calling this when the engine is already terminating will do nothing so use Core.SetMain() instead if you want to change to a new main tick function.
Core.OnTick(Func)
Func (function) = The main tick function to change to.
On initialisation of IfLua:: The function address of 'MainTick' is.
stored in the LUA registry for quick successive execution. Thus to change this function, you need to run this command with the function you want to change to.
Core.Pause()
Pauses LUA execution. Obviously, you can't resume and must do it manually!
Result = Core.PidRunning(Id)
Id (integer) = The pid number to check
Result (boolean) = The pid is valid and running?
Asks the operating system to check if the specified pid exists and if the specified executable matches, true is returned, else false. Specifying pid zero will cause an exception.
Core.Quit()
Terminates the engine process cleanly.
Load, Total, Free, Used, ProcUse, ProcPeak = Core.RAM()
Load (number) = % load of total physical memory.
Total (integer) = Total physical memory installed in system.
Free (integer) = Available physical memory to engine.
Used (integer) = Physical memory in use by the system and other apps.
ProcUse (integer) = The total memory in use by the engine (including Virtual).
ProcPeak (integer) = The peak memory usage of the engine.
Returns information about physical memory in the computer.
Result = Core.Reset()
Result (boolean ) = Was the event sent successfully?
Ends LUA execution, clears the context, and restarts LUA execution. It will return 'false' if Lua is already re-initialising.
Core.Restart()
Restarts the engine process cleanly.
Core.RestartFresh()
Restarts the engine process cleanly without command-line arguments.
Core.RestoreDelay()
Restores the frame thread suspend value set via cvars
Core.ScrollDown()
Scrolls the console up one line.
Core.ScrollUp()
Scrolls the console up one line.
Core.SetDelay(Millisecs)
Millisecs (integer) = Milliseconds to delay by each tick
This is the same as updating the cvar 'app_delay' apart from that the cvar is not updated and not saved.
Core.SetIcon(Filename)
Filename (string) = The filenames of the large icon to set.
Asks the operating system to set the specified icons of the programmers choosing. Separate each filename with a colon ':'. On Windows, anything but the first and the last icon are dropped so make sure you list the first filename as the large icon and the last filename as the small icon.
Stack = Core.Stack(Text)
Text (string) = The message to prefix.
Stack (string) = The current stack trace.
Returns the current stack as a string formatted by the engine and not Lua. This is needed for example when you use xpcall() with an error handler. Note that pcall() error messages do not include the stack.
Core.StatusLeft(String)
String (string) = Console status text.
In terminal mode, this function will set the text to appear when no text is input into the input bar. Useful for customised stats. It will update every second.
Core.StatusRight(String)
String (string) = Console status text.
In terminal mode, this function will set the text to appear when no text is input into the input bar. Useful for customised stats. It will update every second.
Core.Suspend(Millisecs)
Millisecs (integer) = Time in seconds.
Delays the engine thread for this amount of time.
Ticks = Core.Ticks()
Ticks (integer) = Number of ticks.
Returns the total number of frames rendered since the engine started.
Time = Core.Time()
Time (number) = The time in seconds.
Returns the time elapsed in seconds since the engine started. This is a very high resolution timer. Use it for time-criticial timings. This counter can be reset with Core.Update() as it will lose precision over time.
Time = Core.UpMicroTime()
Time (integer) = The engine uptime in microseconds.
Returns the total time the engine has been running in microseconds.
Time = Core.UpMilliTime()
Time (integer) = The engine uptime in milliseconds.
Returns the total time in the engine has been running in milliseconds.
Time = Core.UpNanoTime()
Time (integer) = The engine time in nanoseconds.
Returns the total time in the engine has been running in nanoseconds.
Ticks = Core.Uptime()
Ticks (number) = Uptime in seconds
Returns the total number of seconds elapsed since the start of the engine this call maybe a little more expensive than Glfw.Time() but you have no choice to use this if you are using terminal mode. This uses std::chrono to retrieve this value.
Core.WaitAsync()
Delays main thread execution until ALL asynchronous threads have completed Please note that the engine will be unresponsive during this time and therefore this call should only really be used in emergencies. Sockets are NOT synchronied. Use Sockets.CloseAll() to do that.
Core.Write(String)
String (string) = Text to write to console.
Writes the specified line of text directly to the console with no regard to colour of text.
Core.WriteEx(Message, Colour)
Message (string) = Text to write to console.
Colour (integer) = The optional colour to use.
Writes the specified line of text directly to the console with the specified text colour.
Data = Core.Colours
Data (table) = A table of const string/int key pairs
Returns all the colour palette of console colours used with ConWrite.
Ids = Core.Libraries
Ids (table) = The table of all library ids
A table containing the ids of all the libraries supported.
Data = Core.LogLevels
Data (table) = The entire list of possible log levels.
Returns a table of key/value pairs that identify possible log levels.
Display.Attention()
This function requests user attention to the main window. On platforms where this is not supported, attention is requested to the application as a whole. Once the user has given attention, usually by focusing the window or application, the system will end the request automatically.
Display.Centre()
Moves the window to the centre of the screen.
State = Display.Decordated()
State (boolean) = The window is decorated?
Returns if the window is decorated with a border.
Type = Display.FSType()
Type (integer) = Type of full-screen
This function returns the type of full-screen currently engaged. Check Display.FSTypes table for a list of possible values.
State = Display.Floating()
State (boolean) = The window is floating?
Returns if the window is floating an always showing on top.
Display.Focus()
Sets input focus to the window. This will actually restore the window if in full-screen mode.
State = Display.Focused()
State (boolean) = The window is focused?
Returns if the window is focused.
Vendor, Version, Renderer = Display.GPU()
Vendor (string) = GL vendor string.
Version (string) = GL version string.
Renderer (string) = GL gpu string.
Returns info about OpenGL.
FPS = Display.GPUFPS()
FPS (number) = Frames per second.
Get GPU frames rendered in the second. Should be 60 for most people.
X, Y = Display.GetPos()
X (integer) = Current X position of the window.
Y (integer) = Current Y position of the window.
Gets the current position of the window on the desktop.
Width, Height = Display.GetSize()
Width (integer) = Width of the window.
Height (integer) = Height of the window.
Resets the current size of the window.
State = Display.Hovered()
State (boolean) = Mouse is over the window?
Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.
State = Display.Iconified()
State (boolean) = The window is inconified?
Returns if the window is iconified.
Display.Iconify()
Minimises the window.
Display.Maximise()
Maximises the window.
State = Display.Maximised()
State (boolean) = The window is maximised?
Returns if the window is maximised.
Id = Display.Monitor()
Id (number) = Monitor index.
Returns the currently selected monitor id.
Name = Display.MonitorData(Id)
Id (integer) = Id of monitor to query.
Name (string) = Name of monitor.
Returns the name of the specified monitor.
Id = Display.Monitors()
Id (number) = Monitor count.
Returns the total number of detected monitors on the system.
Display.OnFocused(Func)
Func (function) = The event callback function
When the window loses or gains focus, this event is called.
Display.Reset()
Resets the size and position of the window.
Display.ResetCursor()
Resets to the standard cursor graphic
State = Display.Resizable()
State (boolean) = The window is visible?
Indicates whether the window is resizable.
Display.Restore()
Restores the window from a minimized state. This may not work in full-screen mode. Check Display.Focus().
Id = Display.SetCursor()
Id (integer) = The id of the new cursor
This function sets a new standard cursor id. This operation is asynchronous and won't take effect until the next frame.
Display.SetFullScreen(State)
State (boolean) = true for fullscreen, false for window.
Sets the full-screen window state and resets the video subsystem.
This changes the cvar too.
Display.SetInterval(Ticks)
Ticks (integer) = Number of ticks per second (min:1,max:200).
This functions set the core timing frequency. The default target is to perform at least 60 game loop iterations per second. This is completely detatched from GPU rendering which will always render as fast as possible.
Display.SetMatrix(Width, Height)
Width (number) = Matrix width.
Height (number) = Matrix height.
Sets the 2D aspect size of the matrix. Recommended to use a 4:3 aspect ratio to allow the automatic aspect ratio feature to work properly for widescreen window sizes.
Display.SetPos(X, Y)
X (integer) = New X position of the window.
Y (integer) = New Y position of the window.
Sets the new position of the window. This does not change the cvars which control the default window position.
Display.SetSize(Width, Height)
Width (integer) = New width of the window.
Height (integer) = New height of the window.
Sets the new size of the window. This does not change the cvars which control the default window size.
State = Display.Transparent()
State (boolean) = The window is using an alpha framebuffer?
Returns if the window is transparent and using a alpha framebuffer.
Available, Total, Used, Dedicated = Display.VRAM()
Available (integer) = Available video memory in bytes
Total (integer) = Total video memory in bytes
Used (integer) = Used video memory in bytes
Dedicated (boolean) = Is video memory separate from main memory
Returns info about the GPU's video memory.
Display.VReset()
Resets the video subsystem.
Id = Display.VidMode()
Id (number) = Mode id.
Returns the currently selected video mode id.
Width, Height, Depth, Refresh, Red, Green, Blue = Display.VidModeData(MonitorId, ModeId)
MonitorId (integer) = Id of monitor to query.
ModeId (integer) = Id of video mode to query.
Width (integer) = Width of the video mode in pixels.
Height (integer) = Height of the video mode in pixels.
Depth (integer) = Depth of the video mode. (16 or 24).
Refresh (integer) = Refresh rate of the video mode (normally 60).
Red (integer) = Number of bits in the red component (normally 8).
Green (integer) = Number of bits in the green component (normally 8).
Blue (integer) = Number of bits in the blue component (normally 8).
Returns information about the specified video mode.
Count = Display.VidModes()
Count (number) = Total video modes.
Returns the total number of video modes supported by the GPU.
State = Display.Visible()
State (boolean) = The window is visible?
Indicates whether the window is visible.
Data = Display.Cursors
Data (table) = The available standard cursor types
Returns a table of key/value pairs that identify standard cursors
Data = Display.FSTypes
Data (table) = The available full-screen types
Returns a table of key/value pairs that identify the states of the window.
ID Keyname Meaning === ======= ========================================================= [0] WINDOW Decorated and can be moved and sized around the desktop.
[1] EXCLUSIVE Undecorated, covers the whole screen and set resolution.
[2] BORDERLESS Undecorated, covers the whole screen only.
[3] NATIVE (MacOS only) Same as BORDERLESS but disables toggler.
=== ======= =========================================================
State = Fbo.ConEnabled()
State (boolean) = The console state.
Returns true if the console is showing, false if it is not. This function is in Fbo because it only applies to opengl mode.
Fbo.ConHeight(State)
State (number) = The console height.
Sets the console height normal without modifying the cvar. This function is in Fbo because it only applies to opengl mode.
State = Fbo.ConLock()
State (boolean) = The console visibility lock state.
Lock the visibility of the console on or off. This function is in Fbo because it only applies to opengl mode.
Success = Fbo.ConSet(State)
State (boolean) = The console state.
Success (boolean) = Returns if the requested function was successful.
Shows or hides the console. This does not modify the cvar state. This function is in Fbo because it only applies to opengl mode. It also overrides the 'con_disabled' setting.
Handle = Fbo.Create(Identifier, Width, Height)
Identifier (string) = Reference only user-defined identifier.
Width (integer) = Width of the FBO.
Height (integer) = Height of the FBO.
Handle (Fbo) = A handle to the newly created main fbo object.
Creates a new FBO of the specified size.
Fbo.Draw()
When the UI mode is set to 3 which is fully manual mode, you need to call this function for every frame that changes. The main screen FBO will be flushed and not finished and OpenGL will NOT swap buffers if you do not call this function.
State = Fbo.IsDrawing()
State (boolean) = Is the main fbo set to redraw?
Returns if the main fbo is set to redraw.
Handle = Fbo.Main()
Handle (Fbo) = A handle to the main fbo object.
Returns a handle to the main FBO so you can draw to it. Changing the properties of the main FBO may result in undefined behaviour. Note that the engine console shares the same FBO so you may want to create a separatte FBO to draw to.
Fbo.OnRedraw(Func)
Func (function) = The main redraw function to change to
When OpenGL needs to be reinitialised, the specified callback will be called so the guest can redraw FBO's and maybe do other stuff. All texture and fbo data is already preserved so there is no need to reinitialise any of that, you just need to redraw them.
Width, Height = Fbo.Resize(Success)
Success (boolean) = Returns whether the frame buffer changed or not.
Width (number) = The new width of the main frame buffer
Height (number) = The new height of the main frame buffer
This is a run-time override for 'vid_orwidth' and 'vid_orheight' cvars in which the main frame buffer viewport is re-calculated and re-initialised to these dimensions. Note that this modifies the console size as well.
Fbo.SetBlend(srcRGB, dstRGB, srcAlpha, dstAlpha)
srcRGB (integer) = How the source RGB blending factors are computed.
dstRGB (integer) = How the dest RGB blending factors are computed.
srcAlpha (integer) = How the alpha source blending factor is computed.
dstAlpha (integer) = How the alpha destination blending factor is computed.
Sets the alpha blending function formula of the back buffer using glBlendFuncSeparate. The parameters are a zero index of the formula you want to use. These values are available in the 'Fbo.Blends' table.
Fbo:Activate()
Makes the specified fbo the active fbo and all subsequent Texture:* calls will apply to this fbo. This can be called on the main fbo.
Fbo:Blit()
Blits the SPECIFIED fbo to the currently ACTIVE fbo. This just adds to the active FBO drawing arrays and doesn't actually render until the active fbo is finished and rendered. The currently stored vertex, texcoord, colour and matrix values are used.
Fbo:BlitT(TriIndex)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
Blits the SPECIFIED triangle of the SPECIFIED fbo to the currently ACTIVE fbo. This just adds to the active FBO drawing arrays and doesn't actually render until the active fbo is finished and rendered. The currently stored vertex, texcoord, colour and matrix values are used.
Fbo:Destroy()
Destroys the FBO and frees all the memory associated with it. The OpenGL handles and VRAM allocated by it are freed after the main FBO has has been rendered. The object will no longer be useable after this call and an error will be generated if accessed.
Fbo:Finish()
Queues the fbo for redrawing after LUA has finished it's tick function.
You only need to run this once, subsequent calls in the same frame will be ignored as the fbo has already been queued for redrawing.
Count = Fbo:GetFloatCount()
Count (integer) = Number of floats in display lists.
Returns the number of floating point numbers currently entered into the display list.
Id = Fbo:GetId()
Id (integer) = The id number of the Fbo object.
Returns the unique id of the Fbo object.
Count = Fbo:GetLFloatCount()
Count (integer) = Number of floats in display lists.
Returns the number of floating point numbers entered into the display list on the last rendered frame.
Width, Height, Left, Top, Right, Bottom, MatrixWidth, MatrixHeight = Fbo:GetMatrix()
Width (number) = Total count of horizontal viewable pixels.
Height (number) = Total count of vertical viewable pixels.
Left (number) = Minimum viewable matrix X position.
Top (number) = Minimum viewable matrix Y position.
Right (number) = Maximum viewable matrix X position.
Bottom (number) = Maximum viewable matrix Y position.
MatrixWidth (number) = Current requested matrix width.
MatrixHeight (number) = Current requested matrix height.
Returns the current matrix information for the specified fbo.
Id = Fbo:GetName()
Id (string) = The video identifier
Returns the identifier of the Fbo object.
State = Fbo:IsFinished()
State (boolean) = Is the fbo finished
Returns if the fbo has been finished.
Fbo:Reserve(Vertexes, Commands)
Vertexes (integer) = How many 64-bit floats to reserve in GPU float list
Commands (integer) = How many structs to reserve in GPU commands list
Reserves memory the respective number of items. Use this if the first complex frame you draw is slow. It's probably because of this as the default reservation level for the lists is 1024 x 64-bit float/command.
Fbo:SetCRGBA(Red, Green, Blue, Alpha)
Red (number) = The entire fbo texture red colour intensity (0 to 1).
Green (number) = The entire fbo texture green colour intensity (0 to 1).
Blue (number) = The entire fbo texture blue colour intensity (0 to 1).
Alpha (number) = The entire fbo texture alpha colour intensity (0 to 1).
Sets the colour intensity of all the vertexes for the entire fbo texture.
Fbo:SetCX(TriIndex, V1Red, V1Green, V1Blue, V1Alpha, V2Red, V2Green, V2Blue, V2Alpha, V3Red, V3Green, V3Blue, V3Alpha)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Red (number) = Red component of vertex #1 of the specified triangle.
V1Green (number) = Green component of vertex #1 of the specified triangle.
V1Blue (number) = Blue component of vertex #1 of the specified triangle.
V1Alpha (number) = Alpha component of vertex #1 of the specified triangle.
V2Red (number) = Red component of vertex #2 of the specified triangle.
V2Green (number) = Green component of vertex #2 of the specified triangle.
V2Blue (number) = Blue component of vertex #2 of the specified triangle.
V2Alpha (number) = Alpha component of vertex #2 of the specified triangle.
V3Red (number) = Red component of vertex #3 of the specified triangle.
V3Green (number) = Green component of vertex #3 of the specified triangle.
V3Blue (number) = Blue component of vertex #3 of the specified triangle.
V3Alpha (number) = Alpha component of vertex #3 of the specified triangle.
Stores the specified colour intensities on each vertex for the Fbo:Blit() function.
Fbo:SetClear(State)
State (bool) = New clear state
Sets if the fbo should be cleared before rendering to it
Fbo:SetClearColour(Red, Green, Blue, Alpha)
Red (number) = The red component intensity (0 to 1).
Green (number) = The green component intensity (0 to 1).
Blue (number) = The blue component intensity (0 to 1).
Alpha (number) = The alpha component intensity (0 to 1).
Same as glClearColour(). Allows you to set the colour for glClear(), meaning the fbo is cleared with this colour on each new frame loop.
See: https://www.opengl.org/sdk/docs/man2/xhtml/glClear.xml.
See: https://www.opengl.org/sdk/docs/man2/xhtml/glClearColor.xml.
Fbo:SetFilter(Id)
Id (integer) = The texture filter id.
Sets the texture filtering id for the fbo texture. Mipmaps are automatically generated if a mipmapping id is selected.
(Magnification / Minification). See 'Texture.Filters()' for more info.
Fbo:SetMatrix(Left, Top, Right, Bottom)
Left (number) = The left co-ordinate.
Top (number) = The top co-ordinate.
Right (number) = The right co-ordinate.
Bottom (number) = The bottom co-ordinate.
Sets the matrix of the specified fbo, meaning, these are the bounds of where you can draw. Same as glOrtho().
See: https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml
Fbo:SetTCLTRB(Left, Top, Right, Bottom)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Right (number) = The destination right co-ordinate.
Bottom (number) = The destination bottom co-ordinate.
Stores the specified texture bounds used when blitting the frame buffer object.
Fbo:SetTCLTWH(Left, Top, Width, Height)
Left (number) = The left destination co-ordinate.
Top (number) = The top destination co-ordinate.
Width (number) = The destination width.
Height (number) = The destination height.
Stores the specified texture co-ords and dimensions when blitting the frame buffer object.
Fbo:SetTCX(TriIndex, TC1Left, TC1Top, TC2Left, TC2Top, TC3Left, TC3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
TC1Left (number) = Coord #1 of vertex #1 of the specified triangle.
TC1Top (number) = Coord #2 of vertex #2 of the specified triangle.
TC2Left (number) = Coord #1 of vertex #3 of the specified triangle.
TC2Top (number) = Coord #2 of vertex #1 of the specified triangle.
TC3Left (number) = Coord #1 of vertex #2 of the specified triangle.
TC3Top (number) = Coord #2 of vertex #3 of the specified triangle.
Stores the specified texture co-ordinates for when the frame buffer object is drawn.
Fbo:SetVLTRB(Left, Top, Right, Bottom)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Right (number) = The destination right co-ordinate.
Bottom (number) = The destination bottom co-ordinate.
Allows you to set basic vertex bounds when blitting the frame buffer object.
Fbo:SetVLTWH(Left, Top, Width, Height)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Width (number) = The destination width.
Height (number) = The destination height.
Allows you to set basic vertex co-ordinates and dimensions when blitting the frame buffer object.
Fbo:SetVLTWHA(Left, Top, Width, Height, Angle)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Width (number) = The destination width.
Height (number) = The destination height.
Angle (number) = The angle of the vertex.
Allows you to set basic vertex co-ordinates when blitting the fbo with angle calculations.
Fbo:SetVX(TriIndex, V1Left, V1Top, V2Left, V2Top, V3Left, V3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Left (number) = Coord #1 of vertex #1 of the specified triangle.
V1Top (number) = Coord #2 of vertex #2 of the specified triangle.
V2Left (number) = Coord #1 of vertex #3 of the specified triangle.
V2Top (number) = Coord #2 of vertex #1 of the specified triangle.
V3Left (number) = Coord #1 of vertex #2 of the specified triangle.
V3Top (number) = Coord #2 of vertex #3 of the specified triangle.
Stores the specified vertex co-ordinates when using the 'Fbo:Blit' function.
Fbo:SetWireframe(Wireframe)
Wireframe (Boolean) = Use polygon mode GL_LINE (true) or GL_FILL (false).
Sets drawing the contents in the fbo in wireframe more or texture filled mode (default).
Codes = Fbo.Blends
Codes (table) = The table of key/value pairs of available flags
Returns the texture filters available. See https://registry.khronos.org/OpenGL-Refpages/es3/html/glBlendFuncSeparate.xhtml for more information about the values.
Codes = Fbo.Filters
Codes (table) = The table of key/value pairs of available flags
Returns the texture filters available. See https://registry.khronos.org/OpenGL-Refpages/es3/html/glTexParameter.xhtml for more information about the values
Result, Reason = File.AppendOne(Source, Data)
Source (string) = Filename to append asset to
Data (Asset) = The asset to write to the file
Result (multi) = Result of operation
Reason (string) = (Conditional) Error reason
Appends the specified data to the specified file. Returns 'false' if failed or bytes written if succeeded. If 'Result' is false then the second argument 'Reason' returned is the error reason string.
Result, Reason = File.AppendOneStr(Source, String)
Source (string) = Filename to append string to
String (string) = The string to append
Result (multi) = Result of operation
Reason (string) = (Conditional) Error reason
Appends the specified string to the specified file. Returns 'false' if failed or bytes written if succeeded. If 'Result' is false then the second argument 'Reason' returned is the error reason string.
Result = File.DirExists(Source)
Source (string) = Directory
Result (Boolean) = Directory exists?
Returns if the specified directory exists and is actually a directory.
Files, Directories = File.Enumerate(Source)
Source (string) = Directory to enumerate
Files (table) = File list in a indexed table
Directories (table) = Directory list in a indexed table
Dumps all the files in the specified directory to two tables
Files, Directories = File.EnumerateEx(Source, Extension)
Source (string) = Directory to enumerate
Extension (string) = Extension to filter
Files (table) = File list in a indexed table
Directories (table) = Directory list in a indexed table
Dumps all the files ending in the specified extension in the specified directory to two tables.
Result = File.Executable(Source)
Source (string) = Filename
Result (Boolean) = File executable?
Returns if the file on disk is executable. Only allowed as a child of the working executable directory. Should always return 'false' on Windows.
Result = File.Exists(Source)
Source (string) = File name or directory name
Result (Boolean) = File or directory exists?
Returns if the specified file or directory exists on disk.
Result = File.FileExists(Source)
Source (string) = Filename
Result (Boolean) = File exists?
Returns if the specified directory exists and is actually a directory.
Result, Size, Mode, Timestamp, Timestamp, Timestamp, Links, UserId, GroupId, Device, RDevice, INode = File.Info(Source)
Source (string) = Filename
Result (boolean) = Error number result
Size (integer) = File size
Mode (integer) = File attributes
Timestamp (integer) = File creation time
Timestamp (integer) = File modification time
Timestamp (integer) = File access time
Links (integer) = Number of hard links in the file
UserId (integer) = User id number
GroupId (integer) = Group id number
Device (integer) = Device id
RDevice (integer) = Device id of special file
INode (integer) = Inode id
Returns information about a file without opening it.
Result = File.MkDir(Directory)
Directory (string) = Directory to create
Result (Integer) = The errno return code from the C-Lib mkdir() function
Creates the specified directory. Only allowed as a child of the working executable directory.
Result = File.MkDirEx(Directory)
Directory (string) = Directory to create
Result (Integer) = The errno return code from the C-Lib mkdir() function
Creates the specified directory. Only allowed as a child of the working executable directory. This creates interim directories that do not already exist. If the directory already exists than the function returns success.
Handle = File.Open(Filename, Mode)
Filename (string) = File to open or create.
Mode (integer) = The mode id to use.
Handle (File) = The handle to the file stream created.
Uses fopen() to open or create a file stream for reading or writing. Note that this function will only allow access to files from the executable directory and it's children for security reasons.
Directory, File, Extension, Full = File.Parts(Source)
Source (string) = Filename to break apart
Directory (string) = The directory part
File (string) = The filename part
Extension (string) = The filename extension
Full (string) = The fully qualified filename to the file
Splits apart a filename and return its parts.
Result, Reason = File.ReadOneStr(Source)
Source (string) = Filename to read string from
Result (multi) = Result of operation
Reason (string) = (Conditional) Error reason
Reads the specified string from the the file in text-mode only. Please use Asset.String(Async) to read a file in binary form. Returns 'false' if failed or the string that was read if succeeded. If 'Result' is false then the second argument 'Reason' returned is the error reason string.
Result = File.ReadWritable(Source)
Source (string) = Filename
Result (Boolean) = File readable and writable?
Returns if the file on disk is readable and writable. Only allowed as a child of the working executable directory.
Result = File.Readable(Source)
Source (string) = Filename
Result (Boolean) = File readable?
Returns if the file on disk is readable. Only allowed as a child of the working executable directory.
Result = File.Rename(Source, Dest)
Source (string) = Source filename
Dest (string) = Destination filename
Result (Integer) = The errno return code from the C-Lib unlink() function
Renames the specified file or directory. Only allowed as a child of the working executable directory for both parameters.
Result = File.RmDir(Directory)
Directory (string) = Directory to create
Result (Integer) = The errno return code from the C-Lib mkdir() function
Creates the specified directory. Only allowed as a child of the working executable directory.
Result = File.RmDirEx(Directory)
Directory (string) = Directories to remove
Result (Integer) = The errno return code from the C-Lib mkdir() function
Removes the specified directory and interim directories. Only allowed as a child of the working executable directory. This removes interim directories that are empty.
Result = File.Unlink(File)
File (string) = File to delete
Result (Integer) = The errno return code from the C-Lib unlink() function
Deletes the specified file. Only allowed as a child of the working executable directory.
Result = File.ValidName(Source)
Source (string) = Filename to check
Result (integer) = The result of the check
Returns 0 if the filename is valid, non-zero if not.
Result = File.Writable(Source)
Source (string) = Filename
Result (Boolean) = File writable?
Returns if the file on disk is writable. Only allowed as a child of the working executable directory.
Result, Reason = File.WriteOne(Source, Data)
Source (string) = Filename to append asset to
Data (Asset) = The binary data from memory to write
Result (multi) = Result of operation
Reason (string) = (Conditional) Error reason
Create or open existing file, and write the specified asset and closes the file. Returns the number of bytes written (integer) if succeeded or 'false' (boolean) if fails, and sets 'Reason' as the error reason.
Result, Reason = File.WriteOneStr(Source, String)
Source (string) = Filename to write string to
String (string) = The string to write.
Result (multi) = Result of operation
Reason (string) = (Conditional) Error reason
Opens/Creates the specified file, writes the specified string and closes the file. Returns the number of bytes written (integer) if succeeded or 'false' (boolean) if fails, and sets 'Reason' as the error reason.
Result = File:Close()
Result (boolean) = If file was closed
Closes the file
File:Destroy()
Closes and destroys the file stream and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
State = File:End()
State (boolean) = File is at EOF?
Calls feof() and returns if the file pointer is at EOF.
ErrNo = File:Error()
ErrNo (integer) = Error code returned
Returns the last recorded errno.
Error = File:ErrorStr()
Error (string) = Error string returned
Returns the last recorded errno as a human readable string.
State = File:FError()
State (boolean) = Error in stream?
Returns the file stream encounted an error.
State = File:Flush()
State (boolean) = Succeeded?
By default writing to a file stream is buffered. This calls fflush() and makes sure that any unwritten data to disk is written straight away.
Id = File:Id()
Id (integer) = The id number of the File object.
Returns the unique id of the File object.
Name = File:Name()
Name (string) = Name of the file.
Returns the name of the loaded file.
State = File:Opened()
State (boolean) = Error in stream?
Returns if the file was successfully opened.
Data = File:Read(Bytes)
Bytes (integer) = Maximum number of bytes to read.
Data (array) = The data read.
Uses fread() to read the specified number of bytes from the stream. The data is returned as an array class.
Bytes = File:ReadStr(String)
String (string) = The string read
Bytes (integer) = Maximum number of bytes to read.
Uses fgets() to read the specified line from the stream. The line ends at the specified maximum number of bytes to read or until it reaches an end-of-line character.
File:Rewind()
Calls frewind() to sets the file stream pointer to position 0.
State = File:Seek(Offset)
Offset (integer) = Offset.
State (boolean) = Succeeded?
Calls fseek() to set the file stream pointer to the specified position.
from the start of the stream.
State = File:SeekCur(Offset)
Offset (integer) = Offset.
State (boolean) = Succeeded?
Calls fseek() to adjust the file stream pointer from the current position of the stream.
State = File:SeekEnd(Offset)
Offset (integer) = Offset.
State (boolean) = Succeeded?
Calls fseek() to set the file stream pointer to the specified position.
from the end of the stream.
Size = File:Size()
Size (integer) = Size in bytes
Returns the current sie of the file
Position = File:Tell()
Position (integer) = Position
Returns the current position in file
Count = File:Write(Data)
Data (Asset) = The data to write.
Count (integer) = Number of bytes written.
Uses fwrite() to write the specified data array to the specified file.
Count = File:WriteStr(String)
String (string) = Text to write.
Count (integer) = Number of bytes written
Writes the specified string to the file.
Codes = File.Flags
Codes (table) = The table of key/value pairs of available open flags
A table containing all the possible file open modes available...
ID Keyname FOpen Operation ==== ======= ===== ==================================================== [00] R_T "rt" Read + Exists + Text [01] W_T "wt" Write + New + Truncate + Text [02] A_T "at" Write + Append + New + Text [03] R_P_T "r+t" Read + Write + Exists + Text [04] W_P_T "w+t" Read + Write + New + Truncate + Text [05] A_P_T "a+t" Read + Write + Append + New + Text [06] R_B "rb" Read + Exists + Binary [07] W_B "wb" Write + New + Truncate + Binary [08] A_B "ab" Write + Append + New + Binary [09] R_P_B "r+b" Read + Write + Exists + Binary [10] W_P_B "w+b" Read + Write + New + Truncate + Binary [11] A_P_B "a+b" Read + Append + New + Binary ==== ======= ===== ==================================================== Read = File must have permission to read.
Write = File must have permission to write.
Exists = File must exist.
New = Create file if it does not exist.
Truncate = Truncate size to zero.
Append = Place the file pointer at the end of file.
Binary = Open in binary mode with no line ending conversions.
Text = Open in text mode and convert to OS specific line endings.
Handle = Font.Console()
Handle (Font) = Font handle to console texture
Returns the handle to the console font. Useful if you want to reuse the font in your application. Careful not to mess around with it's properties!
Handle = Font.Create(Font, Size, Padding, Filter, Flags)
Font (Ftf) = An ftf object of a loaded freetype font.
Size (integer) = The initial canvas size of the texture.
Padding (integer) = Amount of padding to use to prevent texture spilling.
Filter (integer) = Font texture filtering mode to use.
Flags (integer) = Font flags.
Handle (Font) = A texture handle to the font.
Creates a texture from the specified font using FreeType. Note that the ftf object invalidated externally as the new font object will assume private ownership of it.
Handle = Font.Image(Source)
Source (Image) = The source image for use with the font.
Handle (Font) = A handle to the newly created texture.
Creates a texture as a font tileset. The function looks for a file with the same name as 'filename' with the .txt extension which explains the parameters for the font tileset. These parameters are as follows...
rangestart = The ASCII character to represent the first tile.
range = The number of ASCII characters in the tileset.
tilewidth = The width of the tile.
tileheight = The height of the tile.
tilespacingwidth = The horizontal spacing between each tile.
tilespacingheight = The vertical spacing between each tile.
filetype = The source type of texture.
width = The widths of each character separated by a whitespace.
default = The default ASCII character to draw if char not available.
name = A name to describe the font.
scale = The starting scale of the characters (i.e. 1=100%, 0.5=50%).
Font:Destroy()
Destroys the font and frees all the memory associated with it. The OpenGL handles and VRAM allocated by it are freed after the main FBO has has been rendered. The object will no longer be useable after this call and an error will be generated if accessed.
Font:Dump(TexId, File)
TexId (integer) = The texture id to dump.
File (stream) = The filename of the stream to write to.
Dumps the font tileset to the specified file.
Height = Font:GetHeight()
Height (integer) = The tile height of the font.
Returns height of the font tile. If this font is a free-type font, this will just be the height of the white-space character only.
Id = Font:GetId()
Id (integer) = The id number of the Font object.
Returns the unique id of the Font object.
Name = Font:GetName()
Name (string) = Name of the font.
If this font was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
Width = Font:GetWidth()
Width (integer) = The tile width of the font.
Returns width of the font tile. If this font is a free-type font, this will just be the width of the white-space character only.
Font:LoadChars(Characters)
Characters (string) = A utf-8 string of characters you want to pre-cache.
Caches all the characters in the specified utf-8 character range to the texture. Although new characters are dynamically loaded on demand, this function will act as a 'pre-cache' for characters you KNOW you are going to use.
Font:LoadRange(Start, End)
Start (integer) = The starting UNICODE character index.
End (integer) = The ending UNICODE character index.
Caches the specified UNICODE character range to the texture. Although new characters are dynamically loaded on demand, this function will act as a 'pre-cache' for characters you KNOW you are going to use.
Font:Print(X, Y, String)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Prints the specified string on screen with left alignment.
Font:PrintC(X, Y, Text)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
Text (string) = The string to print.
Prints the specified string on screen with centre alignment.
Font:PrintCT(X, Y, Text, Glyphs)
X (number) = The X position of where to start printing the string
Y (number) = The Y position of the string.
Text (string) = The string to print.
Glyphs (Texture) = The texture handle to use for printing glyphs.
Prints the specified string on screen with centre alignment and glyphs.
Font:PrintM(X, Y, Scroll, Width, Text)
X (number) = The X position of where to draw the string.
Y (number) = The Y position of where to draw the string.
Scroll (number) = The amount to scroll leftwards by in pixels.
Width (number) = The width of the string to print.
Text (string) = The string to print
Prints part of a string which helps one create a marquee effect.
Font:PrintMT(X, Y, Scroll, Width, Text, Glphs)
X (number) = The X position of where to draw the string.
Y (number) = The Y position of where to draw the string.
Scroll (number) = The amount to scroll leftwards by in pixels.
Width (number) = The width of the string to print.
Text (string) = The string to print
Glphs (Texture) = The texture to use to printing glyph
Prints part of a string which helps one create a marquee effect with glyphs support.
Font:PrintR(X, Y, Text)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
Text (string) = The string to print.
Prints the specified string on screen with right alignment.
Font:PrintRT(X, Y, Text, Glyphs)
X (number) = The X position of where to start printing the string
Y (number) = The Y position of the string.
Text (string) = The string to print.
Glyphs (Texture) = The texture handle to use for printing glyphs.
Same functionality as PrintR but with the option to print glyphs. You can do this by specifying \rthhhhhhhh anywhere in your text. Where 'h' is a hexadecimal number between 00000000 and ffffffff to match the tile id of the texture. You must zero pad the number as shown.
Width = Font:PrintS(Text)
Text (string) = The string to simulate printing.
Width (Number) = The width of the text in pixels.
Simluates printing of the specified string on screen with left alignment and returns the width of the string printed
Font:PrintT(X, Y, Text, Glyphs)
X (number) = The X position of where to start printing the string
Y (number) = The Y position of the string.
Text (string) = The string to print.
Glyphs (Texture) = The texture handle to use for printing glyphs.
Same functionality as Print but with the option to print glyphs. You can do this by specifying \rthhhhhhhh anywhere in your text. Where 'h' is a hexadecimal number between 00000000 and ffffffff to match the tile id of the texture. You must zero pad the number as shown.
Width = Font:PrintTS(Text, Glyphs)
Text (string) = The string to simulate printing.
Glyphs (Texture) = The glyph textures to use
Width (Number) = The width of the text in pixels.
Simluates printing of the specified string on screen with left alignment and returns the width of the string printed
Height = Font:PrintU(X, Y, String)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with bottom-left alignment.
Equivalent of calling Print() with the result of PrintUS() subtracted from the Y position.
Height = Font:PrintUC(X, Y, String)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with vertical bottom-left vertical and horizontal centre alignment. Equivalent of calling PrintC() with the result of PrintUS() subtracted from Y position.
Height = Font:PrintUCT(X, Y, String, Glyphs)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Glyphs (Texture) = The texture handle to use for printing glyphs.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with vertical bottom-left vertical and horizontal centre alignment. Equivalent of calling PrintCT() with the result of PrintUS() subtracted from Y position.
Height = Font:PrintUR(X, Y, String)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with vertical bottom-left vertical and horizontal right alignment. Equivalent of calling PrintR() with the result of PrintUS() subtracted from Y position.
Height = Font:PrintURT(X, Y, String, Glyphs)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
String (string) = The string to print.
Glyphs (Texture) = The texture handle to use for printing glyphs.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with vertical bottom-left vertical and horizontal centre alignment. Equivalent of calling PrintCT() with the result of PrintUS() subtracted from Y position.
Height = Font:PrintUS(String)
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Simulates printing a string. Returns height.
Height = Font:PrintW(X, Y, Right, Indent, Text)
X (number) = The X position of where to start printing the string
Y (number) = The Y screen position of the string.
Right (number) = The right position of where to end printing the string
Indent (number) = The width of the indentation on wrapping.
Text (string) = The string to print.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with left alignment. While printing, the text will cleanly wrap if it cannot draw any word past the specified 'Right' position and position the cursor at the specified 'Indent'.
Height = Font:PrintWS(WrapX, Indent, String)
WrapX (number) = The X position to wrap the text at.
Indent (number) = The width of the indentation on wrapping.
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Simulates printing a string with word-wrap. Returns height.
Font:PrintWT(X, Y, Right, Indent, Text, Glyphs)
X (number) = The X position of where to start printing the string
Y (number) = The Y position of the string.
Right (number) = The right position of where to wrap text to the next line.
Indent (number) = The width of the indentation on wrapping.
Text (string) = The string to print.
Glyphs (texture) = The texture handle to use for printing glyphs.
Same functionality as PrintW but with the option to print glyphs. You can do this by specifying \rthhhhhhhh anywhere in your text. Where 'h' is a hexadecimal number between 00000000 and ffffffff to match the tile id of the texture. You must zero pad the number as shown.
Font:PrintWTS(Width, Indent, Text, Glyphs)
Width (number) = The maximum width of a line before wrapping to the next.
Indent (number) = The width of the indentation on wrapping.
Text (string) = The string to print.
Glyphs (texture) = The texture handle to use for printing glyphs.
Same functionality as PrintW but with the option to print glyphs. You can do this by specifying \rthhhhhhhh anywhere in your text. Where 'h' is a hexadecimal number between 00000000 and ffffffff to match the tile id of the texture. You must zero pad the number as shown.
Height = Font:PrintWU(X, Y, Width, Indent, String)
X (number) = The X screen position of the string.
Y (number) = The Y screen position of the string.
Width (number) = The X+Width to wrap at.
Indent (number) = The width of the indentation on wrapping.
String (string) = The string to print.
Height (number) = The height of the text printed on screen.
Prints the specified string on screen with left alignment. While printing, if X exceeds the specified Width, the text is wrapped with the specified indent size on the following line.
Font:PrintWUT(X, Y, Right, Indent, Text, Glyphs)
X (number) = The X position of where to start printing the string
Y (number) = The Y position of the string.
Right (number) = The right position of where to wrap text to the next line.
Indent (number) = The width of the indentation on wrapping.
Text (string) = The string to print.
Glyphs (texture) = The texture handle to use for printing glyphs.
Same functionality as PrintWU but with the option to print glyphs. You can do this by specifying \rthhhhhhhh anywhere in your text. Where 'h' is a hexadecimal number between 00000000 and ffffffff to match the tile id of the texture. You must zero pad the number as shown.
Font:SetCA(Alpha)
Alpha (number) = The transparency of the texture (0-1).
Sets the colour transparency of the texture. The change affects all subsequent calls to all blitting functions.
Font:SetCB(Blue)
Blue (number) = The colour intensity of the texture's blue component (0-1).
Sets the colour intensity of the texture for the blue component. The change affects all subsequent calls to all blitting functions.
Font:SetCG(Green)
Green (number) = The colour intensity of the texture's green component (0-1).
Sets the colour intensity of the texture for the green component. The change affects all subsequent calls to all blitting functions.
Font:SetCOA(Alpha)
Alpha (number) = The transparency of the outline texture (0-1).
Sets the colour transparency of the outline texture. The change affects all subsequent calls to all blitting functions.
Font:SetCOB(Blue)
Blue (number) = The colour intensity of the blue outline component (0-1).
Sets the colour intensity of the outline for the blue component. The change affects all subsequent calls to all blitting functions.
Font:SetCOG(Green)
Green (number) = The colour intensity of green outline component (0-1).
Sets the colour intensity of the outline for the green component. The change affects all subsequent calls to all blitting functions.
Font:SetCOR(Red)
Red (number) = The colour intensity of red outline component (0-1).
Sets the colour intensity of the outline for the red component. The change affects all subsequent calls to all blitting functions.
Font:SetCORGB(Red, Green, Blue)
Red (number) = The colour intensity of the outline red component (0-1).
Green (number) = The colour intensity of the outline green component (0-1).
Blue (number) = The colour intensity of the outline blue omponent (0-1).
Sets the colour intensity of the outline for each component. The change affects all subsequent calls to all blitting functions.
Font:SetCORGBA(Red, Green, Blue, Alpha)
Red (number) = The colour intensity of the outline red component (0-1).
Green (number) = The colour intensity of the outline green component (0-1).
Blue (number) = The colour intensity of the outline blue omponent (0-1).
Alpha (number) = The transparency of the outline (0-1).
Sets the colour intensity of the outline for each component. The change affects all subsequent calls to all blitting functions.
Font:SetCORGBAI(Colour)
Colour (integer) = The entire colour to set as an integer (0xAARRGGBB)
Sets the colour intensity of the font outline for each component using a 32 bit integer.
Font:SetCR(Red)
Red (number) = The colour intensity of the texture's red component (0-1).
Sets the colour intensity of the texture for the red component. The change affects all subsequent calls to all blitting functions.
Font:SetCRGB(Red, Green, Blue)
Red (number) = The colour intensity of the texture's red component (0-1).
Green (number) = The colour intensity of the texture's green component (0-1).
Blue (number) = The colour intensity of the texture's blue omponent (0-1).
Sets the colour intensity of the texture for each component. The change affects all subsequent calls to all blitting functions.
Font:SetCRGBA(Red, Green, Blue, Alpha)
Red (number) = The colour intensity of the texture's red component (0-1).
Green (number) = The colour intensity of the texture's green component (0-1).
Blue (number) = The colour intensity of the texture's blue omponent (0-1).
Alpha (number) = The transparency of the texture (0-1).
Sets the colour intensity of the texture for each component. The change affects all subsequent calls to all blitting functions.
Font:SetCRGBAI(Colour)
Colour (integer) = The entire colour to set as an integer (0xAARRGGBB)
Sets the colour intensity of the font face for each component using a 32 bit integer.
Font:SetGSize(Scale)
Scale (number) = The new scale of the font glyphs.
Changes the scale of the font glyphs.
Font:SetGlyphPadding(Padding)
Padding (number) = The top side Y padding to add to glyphs
When using print functions with glyph texture addons, this controls the Y padding.
Font:SetLSpacing(Adjust)
Adjust (number) = The new line spacing adjustment
Changes the line spacing adjustment
Font:SetSize(Scale)
Scale (number) = The new scale of the font.
Changes the scale of the font.
Font:SetSpacing(Adjust)
Adjust (number) = The new character spacing adjustment
Changes the character spacing adjustment
Codes = Font.Flags
Codes (table) = The table of key/value pairs of available flags for use with
the InitFTFont function.
Handle = Ftf.Asset(Id, Data, Width, Height, DPIWidth, DPIHeight, Outline)
Id (String) = The identifier string for the Freetype object.
Data (Asset) = The raw font data supported by FreeType.
Width (number) = The width of the font in pixels.
Height (number) = The height of the font in pixels.
DPIWidth (integer) = The DPI width of the font.
DPIHeight (integer) = The DPI height of the font.
Outline (number) = The pixels to add for a border.
Handle (Ftf) = The Ftf object
Loads a font into the freetype system and returns a handle you can use with the Font.Create() function.
Ftf.AssetAsync(Id, Data, Width, Height, DPIWidth, DPIHeight, Outline, ErrorFunc, ProgressFunc, SuccessFunc)
Id (String) = The identifier string for the Freetype object.
Data (Asset) = The raw font data supported by FreeType.
Width (number) = The width of the font in pixels.
Height (number) = The height of the font in pixels.
DPIWidth (integer) = The DPI width of the font.
DPIHeight (integer) = The DPI height of the font.
Outline (number) = The pixels to add for a border.
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the audio file is laoded
Asyncronously loads a freetype font into memory for use with the Font.Create() function. The original Asset class is destroyed in the process.
Handle = Ftf.File(Filename, Width, Height, DPIWidth, DPIHeight, Outline)
Filename (string) = The filename of the ftf file to load
Width (number) = The width of the font in pixels.
Height (number) = The height of the font in pixels.
DPIWidth (integer) = The DPI width of the font.
DPIHeight (integer) = The DPI height of the font.
Outline (number) = The pixels to add for a border.
Handle (Ftf) = The Ftf object
Loads a freetype compatible font from the specified file on disk for use with the Font.Create() function.
Ftf.FileAsync(Filename, Width, Height, DPIWidth, DPIHeight, Outline, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the freetype font to load
Width (number) = The width of the font in pixels.
Height (number) = The height of the font in pixels.
DPIWidth (integer) = The DPI width of the font.
DPIHeight (integer) = The DPI height of the font.
Outline (number) = The pixels to add for a border.
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the file is laoded
Loads a freetype compatible font from the specified file on disk asynchronously for use with the Font.Create() function.
Ftf.WaitAsync()
Halts main-thread execution until all async Ftf events have completed
Ftf:Destroy()
Destroys the freetype font and frees all the memory associated with it.
The object will no longer be useable after this call and an error will be generated if accessed.
Name = Ftf:Family()
Name (string) = The internal name of the freetype font
Returns the internal name of the actual freetype font. (e.g. Arial)
Count = Ftf:Glyphs()
Count (integer) = Number of glyphs available.
Returns the internal number of glyphs supported by this freetype font.
Id = Ftf:Id()
Id (integer) = The id number of the Ftf object.
Returns the unique id of the Ftf object.
Name = Ftf:Name()
Name (string) = The name of the freetype font
Returns the name of the specified object when it was created.
Name = Ftf:Style()
Name (string) = The internal style name of the freetype font
Returns the internal name of the actual freetype font. (e.g. Bold)
Handle = Image.Asset(Name, Data, Flags)
Name (String) = The user-defined id of the image
Data (Asset) = The data of the image to load
Flags (Integer) = Load flags
Handle (Image) = The image object
Loads a image on the main thread from the specified asset object. The Asset object specified is consumed upon load. Returns an image object.
Image.AssetAsync(Name, Data, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Name (string) = A user-defined id of the image
Data (array) = The image data array
Flags (Integer) = Load flags
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the image is laoded
Loads a image off the main thread from the specified array object. The callback functions send an argument to the image object that was created.
Handle = Image.Blank(Name, Width, Height, Filter)
Name (string) = The name of the texture
Width (integer) = The width of the texture
Height (integer) = The height of the texture
Filter (integer) = The texture filtering mode
Handle (Texture) = A handle to the texture(s) created.
Creates an empty blank texture for manipulation.
Handle = Image.Colour(Colour)
Colour (integer) = The colour of the pixel (Syntax: 0xAABBGGRR)
Handle (Image) = The image object
Loads a 1x1 pixel for use as a solid.
Handle = Image.File(Filename, Flags)
Filename (string) = The filename of the image to load
Flags (Integer) = Load flags
Handle (Image) = The image object
Loads a image on the main thread from the specified file on disk. Returns the image object.
Image.FileAsync(Filename, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the image to load
Flags (Integer) = Load flags
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the image is laoded
Loads a image off the main thread. The callback functions send an argument to the image object that was created.
Handle = Image.Raw(Data, Width, Height, Bits)
Data (Asset) = The data of the image to load which is consumed.
Width (integer) = The width of the image being sent (1-65535)
Height (integer) = The height of the image being sent (1-65535)
Bits (integer) = Bits per pixel of the image being sent (1,8,16,24 or 32)
Handle (Image) = The image object
Loads a image on the main thread from the specified array object.
Image.WaitAsync()
Halts main-thread execution until all async image events have completed
Height = Image:Depth()
Height (integer) = The bit-depth of the image in bits
Returns the bit-depth of the image
Image:Destroy()
Destroys the image and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Height = Image:Height()
Height (integer) = The height of the image in pixels
Returns the height if the image.
Id = Image:Id()
Id (integer) = The id number of the Image object.
Returns the unique id of the Image object.
Name = Image:Name()
Name (string) = Name of the image.
If this font was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
File = Image:Save()
File (string) = The filename to save to.
Saves the file to disk.
Width = Image:Width()
Width (integer) = The width of the image in pixels
Returns the width if the image.
Codes = Image.Flags
Codes (table) = The table of key/value pairs of available flags
Returns the image plugins available. Returned as key/value pairs. The value is a unique identifier to the flag.
Codes = Image.Formats
Codes (table) = The table of key/value pairs of available texture formats
Returns the texture formats supported.
Input.ClearStates()
Clears the keyboard, mouse and joystick states which wipes the current state of all the control methods preventing input.
Input.CursorCentre()
Sets the mouse cursor in the centre of the window.
Result = Input.GetJoyAxis(Id, AxisId)
Id (integer) = The joystick id.
AxisId (integer) = The axis id to test.
Result (integer) = Number of ticks the button has been held down.
Returns the state of the specified joystick axis.
Result = Input.GetJoyAxisUB(Id, AxisId)
Id (integer) = The joystick id.
AxisId (integer) = The axis id to test.
Result (number) = The raw state of axis.
Result = Input.GetJoyButton(Id, ButtonId)
Id (integer) = The joystick id.
ButtonId (integer) = The button id to test.
Result (integer) = Number of ticks the button has been held down.
Returns the state of the specified joystick button.
Result can be: =0: The button is not held down.
>0: The button was held down for this many game ticks.
Name = Input.GetJoyName(Id)
Id (integer) = The joystick id.
Name (string) = The name of the joystick.
Returns the name of the specified joystick as reported by the OS.
Name = Input.GetKeyName(Value)
Value (integer) = The key id of the key
Name (integer) = The scan id of the key
Returns the name of the specified key
Count = Input.GetNumJoyAxises(Id)
Id (integer) = The joystick id.
Count (integer) = Number of axises.
Returns the number of axises this joystick supports.
Count = Input.GetNumJoyButtons(Id)
Id (integer) = The joystick id.
Count (integer) = Number of buttons.
Returns the number of buttons this joystick supports.
State = Input.JoyExists(Id)
Id (integer) = The joystick id.
State (boolean) = True if it exists, false if it does not.
Tests if the specified joystick exists.
Input.OnChar(Func)
Func (function) = The callback function to use
When a filtered key is pressed, this function will be called with the key that was pressed.
Input.OnDragDrop(Func)
Func (function) = The callback function to use
When files are dragged into the window, this function will be called with an array of files that were dragged into it.
Input.OnJoyState(Func)
Func (function) = The callback function to use
Sets the callback event when a joystick event occurs and then polls the joysticks sending results to the callback. Specify 'nil' to clear the event. The callback syntax is 'Callback(iJoystick, bConnected)' Where 'iJoystick' is the unique joystick id given to the joystick and 'bConnected' is if the joystick was connected (true) or disconnected (false).
Input.OnKey(Func)
Func (function) = The callback function to use
When an filtered key is pressed, this function will be called with the key that was pressed
Input.OnMouseClick(Func)
Func (function) = The callback function to use
When the mouse is clicked, this function will be called with the mouse button clicked, the state and the key modifiers
Input.OnMouseFocus(Func)
Func (function) = The callback function to use
When the mouse is moved from the window to another application and back, this function will be called with a integer whether the mouse entered the window or not.
Input.OnMouseMove(Func)
Func (function) = The callback function to use
Sets teh callback function for When the mouse is moved. It will also be called immediately after setting a function. The syntax for the callback is 'Callback(nX, nY)' where 'nX' is the left co-ordinate and 'nY' is the top co-ordinate. Setting the function to 'nil' unreferences the already referenced function.
Input.OnMouseScroll(Func)
Func (function) = The callback function to use
When a filtered key is pressed, this function will be called with the 2 axis coordinates on which direction the mouse was scrolled
Input.SetCursor(State)
State (boolean) = True to show the cursor, false to hide it.
Shows or hides the OS cursor so you can effectively design your own software based cursor.
Input.SetCursorPos(X, Y)
X (integer) = The X co-ordinate of the mouse cursor.
Y (integer) = The Y co-ordinate of the mouse cursor.
Sets the position of the mouse cursor relative to the top-left of the main FBO matrix, meaning X could be negative. The specified co-ordinates will also be sent to the 'Input.OnMouseMove' callback if set.
Input.SetJoyAxisDeadZones(JId, AId, FThresh, RThresh)
JId (integer) = The joystick id.
AId (integer) = The joystick axis id.
FThresh (number) = The forward deadzone value (positive)
RThresh (number) = The reverse deadzone value (positive)
Sets the forward and reverse deadzone of the specified axis for the specified joystick. The reverse value automatically gets converted to negative value.
Input.SetJoyAxisForwardDeadZone(JId, AId, Threshold)
JId (integer) = The joystick id.
AId (integer) = The joystick axis id.
Threshold (number) = The forward deadzone value
Sets the forward deadzone of the specified axis for the specified joystick
Input.SetJoyAxisReverseDeadZone(JId, AId, Threshold)
JId (integer) = The joystick id.
AId (integer) = The joystick axis id.
Threshold (number) = The forward deadzone value (positive)
Sets the reverse deadzone of the specified axis for the specified joystick This value automatically gets converted to negative value.
Data = Input.KeyCodes
Data (table) = The entire list of key codes GLFW supports
Returns a table of key/value pairs that identify a specific key with its corresponding GLFW code (for use with GetKeyButton[UB]).
Data = Input.KeyMods
Data (table) = The entire list of states GLFW supports
Returns a table of key/value pairs that identify a the state in which the keyboard or mouse key was pressed.
Data = Input.MouseCodes
Data (table) = The entire list of key codes GLFW supports
Returns a table of key/value pairs that identify a specific mouse button with its corresponding GLFW code (for use with GetMouseButton[UB]).
Data = Input.States
Data (table) = The entire list of states GLFW supports
Returns a table of key/value pairs that identify a the state in which the keyboard or mouse key was pressed.
Json.File(Filename)
Filename (string) = The filename of the json to load
Decodes the specified string as JSON encoded. The level depth is limited to 255 due to limitations with LUA's hardcoded stack level.
Json.FileAsync(Filename, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the json to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the JSON string is laoded
Decodes the specified string as JSON encoded asynchronously.
Handle = Json.String(Code)
Code (string) = The string of JSON encoded data to decode
Handle (Json) = Handle to the Json object
Decodes the specified string as JSON encoded. The level depth is limited to 255 due to limitations with LUA's hardcoded stack level.
Json.StringAsync(Code, ErrorFunc, ProgressFunc, SuccessFunc)
Code (string) = The string of JSON encoded data to decode
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the JSON string is laoded
Decodes the specified string as JSON encoded asynchronously.
Handle = Json.Table(Table)
Table (string) = The string of JSON encoded data to decode
Handle (Json) = Handle to the Json object
Encodes the specified string as JSON encoded. The level depth is limited to 255 due to limitations with LUA's hardcoded stack level.
Json.WaitAsync()
Halts main-thread execution until all json pcm events have completed
Json:Destroy()
Destroys the json object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Id = Json:Id()
Id (integer) = The id number of the Json object.
Returns the unique id of the Json object.
Name = Json:Name()
Name (string) = Name of the json.
If this json was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
Result = Json:ToFile(Filename)
Filename (string) = The filename to write to
Result (integer) = Error number code returned (0 = success)
Dumps the entire json into the specified file.
Result = Json:ToHRFile(Filename)
Filename (string) = The filename to write to
Result (integer) = Error number code returned (0 = success)
Dumps the entire json into the specified file in readable format.
Data = Json:ToHRString()
Data (string) = Encoded JSON data
Encodes the data inside the class to JSON string in human readable format.
Data = Json:ToString()
Data (string) = Encoded JSON data
Encodes the data inside the class to JSON string.
Result = Json:ToTable()
Result (table) = The entire json scope converted to a lua table
Dumps the entire contents of the JSON's current scope as a LUA table
Handle = Mask.Create(Image, Count, Width, Height)
Image (image) = The monochrome image to open.
Count (integer) = The number of tiles to grab from image.
Width (integer) = The width of each tile.
Height (integer) = The height of each tile.
Handle (Mask) = The handle of the new mask created.
Loads pre-defined masks from the specified raster image file.
Handle = Mask.CreateOne(Identifier, Width, Height)
Identifier (string) = The identifier of the mask.
Width (integer) = The width of the new mask.
Height (integer) = The height of the new mask.
Handle (Mask) = The handle of the new mask created.
Creates a new collision mask of the specified dimensions with all the bits set to ONE.
Handle = Mask.CreateZero(Identifier, Width, Height)
Identifier (string) = The identifier of the mask.
Width (integer) = The width of the new mask.
Height (integer) = The height of the new mask.
Handle (Mask) = The handle of the new mask created.
Creates a new collision mask of the specified dimensions with all the bits set to ZERO.
Mask:Clear(DestX, DestY, DestWidth, DestHeight)
DestX (integer) = Destination X position to start filling at.
DestY (integer) = Destination Y position to start filling at.
DestWidth (integer) = Horizontal pixel count to clear.
DestHeight (integer) = Vertical pixel count to clear.
Clears all the specified bits in the mask.
Mask:Copy(SrcHandle, SrcTileId, DestX, DestY)
SrcHandle (Mask) = Source mask to merge from.
SrcTileId (integer) = The id number of the source mask.
DestX (integer) = Destination X position.
DestY (integer) = Destination Y position.
Copies the source mask id into destination mask id zero at the specified position.
Count = Mask:Count()
Count (integer) = Number of sub-masks in the mask.
Returns the number of sub-masks in the mask.
Mask:Destroy()
destroys the mask and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Mask:Erase(DestTileId)
DestTileId (integer) = The id number of the destination mask.
Fills the destination mask with zeros.
Mask:Fill(DestX, DestY, DestWidth, DestHeight)
DestX (integer) = Destination X position to start filling at.
DestY (integer) = Destination Y position to start filling at.
DestWidth (integer) = Horizontal pixel count to fill.
DestHeight (integer) = Vertical pixel count to fill.
Sets all the specified bits in the mask.
Height = Mask:Height()
Height (integer) = Height of each tile in sub-masks.
Returns the height of each sub-mask in the mask.
Id = Mask:Id()
Id (integer) = The id number of the Mask object.
Returns the unique id of the Mask object.
Result = Mask:IsCollide(Dest, DestId, DestX, DestY)
Dest (Mask) = The destination mask to test upon
DestId (integer) = The destination sub-mask id
DestX (integer) = The X position to overlap the source mask
DestY (integer) = The Y position to overlap the source mask
Result (boolean) = True if the two bitmasks overlap. False if not
Returns true if the second mask collides with the first mask at x0 y0.
Result = Mask:IsCollideEx(SrcTileId, SrcX, SrcY, Dest, DestTileId, DestX, DestY)
SrcTileId (integer) = The sub-mask id to use
SrcX (integer) = The X position of the source mask
SrcY (integer) = The Y position of the source mask
Dest (Mask) = The destination mask to test upon
DestTileId (integer) = The destination sub-mask id
DestX (integer) = The X position to overlap the source mask
DestY (integer) = The Y position to overlap the source mask
Result (boolean) = True if the two bitmasks overlap. False if not
Performs a bitmask comparison between two masks
Mask:Merge(SrcHandle, SrcTileId, DestMaskX, DestMaskY)
SrcHandle (Mask) = Source mask to merge from.
SrcTileId (integer) = The id number of the source mask.
DestMaskX (integer) = Destination X position.
DestMaskY (integer) = Destination Y position.
Merges the source mask id into destination mask id zero at the specified position.
Name = Mask:Name()
Name (string) = Name of the mask.
If this mask was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
DoesCollide, CollideX, CollideY = Mask:RayCast(SrcTileId, SrcX, SrcY, Dest, DestTileId, DestFX, DestFY, DestTX, DestTY)
SrcTileId (integer) = The source mask id to test
SrcX (integer) = The X position of the source mask
SrcY (integer) = The Y position of the source mask
Dest (Mask) = The destination mask handle to test upon
DestTileId (integer) = The destination mask id to test upon
DestFX (integer) = The starting X position of the destination mask
DestFY (integer) = The starting Y position of the destination mask
DestTX (integer) = The ending X position of the destination mask
DestTY (integer) = The ending Y position of the destination mask
DoesCollide (boolean) = True if the raycast collided with the other mask
CollideX (integer) = If collision, the X co-ordinate of it
CollideY (integer) = If collision, the Y co-ordinate of it
Performs a raycast collision
Mask:Save(Id, Filename)
Id (integer) = The id number of the mask to dump.
Filename (string) = The file to save to.
Dumps the specified mask to disk for debugging purposes.
Width = Mask:Width()
Width (integer) = Width of each tile in sub-masks.
Returns the width of each sub-mask in the mask.
Handle = Palette.Create(Identifier)
Identifier (string) = Reference only user-defined identifier.
Handle (Palette) = A handle to the newly created palette object.
Creates a new empty palette with the specified name
Handle = Palette.Default(Identifier)
Identifier (string) = Reference only user-defined identifier.
Handle (Palette) = A handle to the newly created palette object.
Creates a new palette with the default VGA palette.
Palette.Image(Identifier, Handle)
Identifier (string) = Reference only user-defined identifier.
Handle (Image) = Handle to image to grab palette from.
Creates a new palette from the specified image.
Handle = Palette.Palette(Identifier, Handle)
Identifier (string) = Reference only user-defined identifier.
Handle (Palette) = A handle to the palette object to copy.
Handle (Palette) = A handle to the newly created palette object.
Creates a new palette from another essentially copying it.
Palette.Texture(Identifier, Handle)
Identifier (string) = Reference only user-defined identifier.
Handle (Texture) = Handle to texture to grab palette from.
Creates a new palette from the specified texture.
Palette:Commit()
Use this function to commit the new palette to the shader.
Palette:Copy(Count, DstId, Src, SrcId)
Count (integer) = The number of values to copy.
DstId (integer) = Index offset to copy the values to.
Src (Palette) = The source palette to copy.
SrcId (integer) = Index offset to copy the values from.
Use this function to copy palette data from another palette.
Palette:Destroy()
Destroys the palette and frees the memory associated with it. This does not affect the active palette as this is stored on the GPU.
Red, Green, Blue, Alpha = Palette:Fill(Id, Count)
Id (integer) = Palette entry to modify from (0-255).
Count (integer) = The number of indexes to fill
Red (number) = The red intensity number (0.0-1.0).
Green (number) = The green intensity number (0.0-1.0).
Blue (number) = The blue intensity number (0.0-1.0).
Alpha (number) = The alpha intensity number (0.0-1.0).
Use this function to fill the palette with the specified values.
Alpha = Palette:GetA(Id)
Id (integer) = Palette entry to modify (0-255).
Alpha (number) = The alpha intensity number (0.0-1.0).
Use this function to get the alpha palette entry.
Red = Palette:GetAI(Id)
Id (integer) = Palette entry to modify (0-255).
Red (integer) = The alpha intensity integer (0-255).
Use this function to get the alpha palette entry. This function is mainly for convenience only and has slightly more overhead than with :GetA() as the palette values have to be stored as GLfloats in the GPU and thus extra calculations are required as a result.
Red = Palette:GetB(Id)
Id (integer) = Palette entry to modify (0-255).
Red (number) = The red intensity number (0.0-1.0).
Use this function to get the blue palette entry.
Blue = Palette:GetBI(Id)
Id (integer) = Palette entry to modify (0-255).
Blue (integer) = The blue intensity integer (0-255).
Use this function to get the blue palette entry. This function is mainly for convenience only and has slightly more overhead than with :GetB() as the palette values have to be stored as GLfloats in the GPU and thus extra calculations are required as a result.
Green = Palette:GetG(Id)
Id (integer) = Palette entry to modify (0-255).
Green (number) = The green intensity number (0.0-1.0).
Use this function to get the green palette entry.
Green = Palette:GetGI(Id)
Id (integer) = Palette entry to modify (0-255).
Green (integer) = The green intensity integer (0-255).
Use this function to get the green palette entry. This function is mainly for convenience only and has slightly more overhead than with :GetG() as the palette values have to be stored as GLfloats in the GPU and thus extra calculations are required as a result.
Id = Palette:GetId()
Id (integer) = The id number of the Palette object.
Returns the unique id of the Palette object.
Name = Palette:GetName()
Name (string) = The identifier of the palette.
Returns the palette identifier
Red = Palette:GetR(Id)
Id (integer) = Palette entry to modify (0-255).
Red (number) = The red intensity number (0.0-1.0).
Use this function to get the red palette entry.
Red, Green, Blue, Alpha = Palette:GetRGBA(Id)
Id (integer) = Palette entry to modify (0-255).
Red (number) = The red intensity number (0.0-1.0).
Green (number) = The green intensity number (0.0-1.0).
Blue (number) = The blue intensity number (0.0-1.0).
Alpha (number) = The alpha intensity number (0.0-1.0).
Use this function to get the palette entry.
Red, Green, Blue, Alpha = Palette:GetRGBAI(Id)
Id (integer) = Palette entry to modify (0-255).
Red (integer) = The red intensity integer (0-255).
Green (integer) = The green intensity integer (0-255).
Blue (integer) = The blue intensity integer (0-255).
Alpha (integer) = The alpha intensity integer (0-255).
Use this function to get the palette entry.
Red = Palette:GetRI(Id)
Id (integer) = Palette entry to modify (0-255).
Red (integer) = The red intensity integer (0-255).
Use this function to get the red palette entry. This function is mainly for convenience only and has slightly more overhead than with :GetR() as the palette values have to be stored as GLfloats in the GPU and thus extra calculations are required as a result.
Palette:SetA(Id, Alpha)
Id (integer) = Palette entry to modify (0-255).
Alpha (number) = The alpha intensity number (0.0-1.0).
Use this function to set the alpha palette entry.
Palette:SetAI(Id, Alpha)
Id (integer) = Palette entry to modify (0-255).
Alpha (integer) = The alpha intensity integer (0-255).
Use this function to set the alpha palette entry.
Palette:SetB(Id, Blue)
Id (integer) = Palette entry to modify (0-255).
Blue (number) = The blue intensity number (0.0-1.0).
Use this function to set the blue palette entry.
Palette:SetBI(Id, Blue)
Id (integer) = Palette entry to modify (0-255).
Blue (integer) = The blue intensity integer (0-255).
Use this function to set the blue palette entry.
Palette:SetG(Id, Green)
Id (integer) = Palette entry to modify (0-255).
Green (number) = The green intensity number (0.0-1.0).
Use this function to set the green palette entry.
Palette:SetGI(Id, Green)
Id (integer) = Palette entry to modify (0-255).
Green (integer) = The green intensity integer (0-255).
Use this function to set the green palette entry.
Palette:SetR(Id, Red)
Id (integer) = Palette entry to modify (0-255).
Red (number) = The red intensity number (0.0-1.0).
Use this function to set the red palette entry.
Palette:SetRGBA(Id, Red, Green, Blue, Alpha)
Id (integer) = Palette entry to modify (0-255).
Red (number) = The red intensity number (0.0-1.0).
Green (number) = The green intensity number (0.0-1.0).
Blue (number) = The blue intensity number (0.0-1.0).
Alpha (number) = The alpha intensity number (0.0-1.0).
Use this function to set the palette entry.
Palette:SetRGBAI(Id, Red, Green, Blue, Alpha)
Id (integer) = Palette entry to modify (0-255).
Red (integer) = The red intensity integer (0-255).
Green (integer) = The green intensity integer (0-255).
Blue (integer) = The blue intensity integer (0-255).
Alpha (integer) = The alpha intensity integer (0-255).
Use this function to set the palette entry using integers. This function is mainly for convenience only and has slightly more overhead than with :Set() as the palette values have to be stored as GLfloats in the GPU and thus extra calculations are required as a result.
Palette:SetRI(Id, Red)
Id (integer) = Palette entry to modify (0-255).
Red (integer) = The red intensity integer (0-255).
Use this function to set the red palette entry.
Palette:Shift(Begin, End, Amount)
Begin (integer) = The starting palette index to shift up to.
End (integer) = The ending palette index to shift up to.
Amount (integer) = Amount to rotate by.
Shifts all palette entries backwards or forwards this amount from the specified palette index and limited to the specified number of indexes.
Palette:ShiftB(Begin, End, Amount)
Begin (integer) = The starting palette index to shift up to.
End (integer) = The ending palette index to shift up to.
Amount (integer) = Amount to rotate backwards by.
Shifts all palette entries backwards this amount from the specified palette index and limited to the specified number of indexes.
Palette:ShiftF(Begin, End, Amount)
Begin (integer) = The starting palette index to shift up to.
End (integer) = The ending palette index to shift up to.
Amount (integer) = Amount to rotate forwards by.
Shifts all palette entries forwards this amount from the specified palette index and limited to the specified number of indexes.
Handle = Pcm.Asset(Id, Data)
Id (String) = The identifier of the string
Data (Asset) = The file data of the audio file to load
Handle (Pcm) = The pcm object
Loads an audio file on the main thread from the specified array object.
Pcm.AssetAsync(Id, Data, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Id (String) = The identifier of the string
Data (array) = The data of the audio file to load
Flags (Integer) = Load flags
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the audio file is laoded
Loads an audio file off the main thread from the specified array object.
The callback functions send an argument to the Pcm object that was created.
Handle = Pcm.File(Filename, Flags)
Filename (string) = The filename of the audio file to load
Flags (Integer) = Load flags
Handle (Pcm) = The pcm object
Loads a audio sample on the main thread from the specified file on disk.
Returns the pcm object.
Pcm.FileAsync(Filename, Flags, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the encoded waveform to load
Flags (Integer) = Load flags
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call when there is progress
SuccessFunc (function) = The function to call when the file is laoded
Loads a audio file off the main thread. The callback functions send an argument to the pcm object that was created.
Handle = Pcm.Raw(Identifier, Data, Rate, Channels, Bits)
Identifier (string) = Identifier of the sample.
Data (Asset) = Sample PCM data.
Rate (integer) = Sample rate.
Channels (integer) = Sample channels.
Bits (integer) = Sample ibts per channel.
Handle (Pcm) = The pcm object
Loads an audio file on the main thread from the specified array object.
Pcm.WaitAsync()
Halts main-thread execution until all async pcm events have completed
Pcm:Destroy()
Destroys the pcm object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Id = Pcm:Id()
Id (integer) = The id number of the PCM object.
Returns the unique id of the PCM object.
Name = Pcm:Name()
Name (string) = The name of the object
Returns the name of the specified object when it was created, or if used by another function, a small trace of who took ownership of it prefixed with an exclamation mark (!).
Codes = Pcm.Flags
Codes (table) = The table of key/value pairs of available flags
Returns the pcm flags available. Returned as key/value pairs. The value is a unique identifier to the flag.
Object = SShot.Fbo(Dest, File)
Dest (Fbo) = The frame buffer to dump.
File (string) = (Optional) File to save to.
Object (SShot) = The screenshot object created.
Takes a screenshot of the specified FBO. You must completely omit the 'file' parameter to use an engine generated file.
Object = SShot.Screen()
Object (SShot) = The screenshot object created.
Takes a screenshot of the screen.
SShot:Destroy()
Destroys the specified screenshot object.
Id = SShot:Id()
Id (integer) = The id number of the SShot object.
Returns the unique id of the SShot object.
Name = SShot:Name()
Name (string) = The name of the SShot object.
Returns the filename generated on this screenshot object.
Handle = Sample.Create(Handle)
Handle (Pcm) = The pcm sample class to load
Handle (Sample) = The handle to the specified sample
Loads the specified number of samples and returns a handle.
Sample:Destroy()
Destroys the sample object and frees all the memory associated with it.
The object will no longer be useable after this call and an error will be generated if accessed.
Duration = Sample:Duration()
Duration (number) = Duration of buffer in seconds
Returns the duration of the buffer in seconds
Id = Sample:Id()
Id (integer) = The id number of the Sample object.
Returns the unique id of the Sample object.
Name = Sample:Name()
Name (string) = Name of the sample.
If this sample was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
Sample:Play(Gain, Pan, Pitch, Loop)
Gain (number) = Volume of sample to play at.
Pan (integer) = Current 2D position.
Pitch (integer) = Pitch of played sample.
Loop (boolean) = Loop the sample?
Plays the specified sample at the specified gain and pitch with the specified 2D panning position. The source that this sample spawns is managed internally. See PlayEx() if you need to manage the source.
Class, Class = Sample:PlayEx(Gain, Pan, Pitch, Loop)
Gain (number) = Volume of sample to play at.
Pan (integer) = Current 2D position.
Pitch (integer) = Pitch of played sample.
Loop (boolean) = Loop the sample?
Class (Source) = The source created from the sample or left channel source.
Class (Source) = (Optional) If in stereo, the right channel source.
Plays the specified sample at the specified gain and pitch with the specified 2D panning position. The source that this sample spawns is managed internally. See PlayEx() if you need to manage the source.
Class, Class = Sample:Spawn()
Class (Source) = The source created from the sample or left channel source.
Class (Source) = (Optional) If in stereo, the right channel source.
Spawns a new source from the sample. It is initially stopped and uninitialised in a 3-D state.
Count = Sample:Stop()
Count (integer) = Number of source buffers stopped;
Stops playing the specified sample.
Count = Socket.Connected()
Count (integer) = Total number of sockets connected
Returns the total number of socket classes currently connected.
Count = Socket.Count()
Count (integer) = Total number of sockets created.
Returns the total number of socket classes currently active.
Socket.Create(Address, Port, Cipher, Delay, Error, Success)
Address (string) = The network destination address to connect to.
Port (integer) = The port to connect to (1-65535).
Cipher (string) = Make SSL connection and try this cipher.
Delay (string) = The worker thread throttling rate.
Error (function) = Function to call when a critical error occurs
Success (function) = Function to call when any other event occurs
Makes a standard point-to-point connection to the specified address.
The function returns immediately as all socket operations are asynchronous. If you need SSL, make sure you specify the cipher suite you want to use or blank if you don't want to use SSL. Since a worker thread is used for each socket, you might want to specify a delay to throttle the loop as all operations are non-blocking. A value of 0 will make the thread consume 100% of a CPU core so be careful.
Socket.CreateHTTP(Cipher, Address, Port, Request, Scheme, Headers, Body, Error, Success)
Cipher (string) = Make SSL connection and try this cipher.
Address (string) = The network destination address to connect to.
Port (integer) = The port to connect to (1-65535).
Request (string) = The HTTP URI request resource.
Scheme (string) = The HTTP scheme (GET, POST, PUT, DELETE, etc.).
Headers (string) = A carriage return separated list of headers.
Body (string) = A body of text to send with the request.
Error (function) = Function to call when a critical error occurs
Success (function) = Function to call when any other event occurs
This is a minimalist implementation of a HTTP request and will support most (if not all) operations one would need. The function returns immediately. The worker thread uses blocking socket operations.
Count = Socket.Flush()
Count (integer) = Total number of sockets disconnected.
Disconnects all active Sockets. Returns immediately.
Text = Socket.OAuth11(Method, Scheme, Port, Resource, Params, Body)
Method (string) = The HTTP method (GET, PUT, etc.).
Scheme (string) = The HTTP scheme (HTTP, HTTPS, etc.);
Port (integer) = The HTTP port connected.
Resource (string) = The HTTP resource requested.
Params (string) = A HTTP URI list of variables that will be sent.
Body (string) = Any HTTP body text sent.
Text (string) = An OAuth11 compatible string that you can pass to web request.
Calculates a OAuth v1.1 string to use with HTTP requests. Twitter is an example that uses this system.
Count = Socket.SocketWaitAsync()
Count (integer) = Total number of sockets disconnected.
Disconnects all active Sockets and waits until all sockets are closed.
Total = Socket.TotalRXBytes()
Total (integer) = The number of bytes read from this socket.
Returns the total number of bytes read from this socket.
Total = Socket.TotalRXPackets()
Total (integer) = The total number of packets read from this socket.
Returns the total number of packets read from this socket.
Total = Socket.TotalTXBytes()
Total (integer) = The number of bytes written to this socket.
Returns the total number of bytes written to this socket.
Total = Socket.TotalTXPackets()
Total (integer) = The total number of packets written to all sockets.
Returns the total number of packets written to all sockets.
State = Socket.ValidAddress(Address)
Address (string) = The address to check.
State (boolean) = The address is valid or not.
Returns if the specified hostname or IP address is valid.
Socket:Callback(Callback)
Callback (function) = The new callback function
Sets a new callback function for the socket. This is useful - for example, if you have an addon system and you need to re-assign the newer callback so the older overwritten callback is no longer referenced.
Data, Count = Socket:CompactRecvQ()
Data (Asset) = An array of data that was read from the queue.
Count (integer) = The number of bytes removed from the read queue.
This function collects all the data in the 'read' queue and moves it all into an array for you to manipulate as you desire.
Data, Count = Socket:CompactSendQ()
Data (Asset) = An array of data that was waiting to be written to the queue.
Count (integer) = The number of bytes removed from the queue.
Removes all data from the pending write queue. If used as a HTTP socket then this may contain return header information (use PopSendQT() instead).
Socket:Destroy()
Aborts, disconnects and destroys the socket object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Socket:Disconnect(Socket)
Socket (socket) = The socket to disconnect.
Disconnects the specified socket. All current asynchronous operations are cancelled so make sure they are finished before calling.
Address = Socket:GetAddress()
Address (string) = The address of the socket.
Returns the hostname of the socket.
Address = Socket:GetAddressEx()
Address (string) = The address and port of the socket in string format.
Returns the hostname and port of the socket as a string.
Cipher = Socket:GetCipher()
Cipher (string) = Cipher tokens
Returns the current cipher used for this connection
Code = Socket:GetError()
Code (integer) = The OpenSSL error code.
Returns the current OpenSSL error code associated with the socket.
Address = Socket:GetIPAddress()
Address (string) = The IP address of the socket.
Returns the IP address of the socket. Only valid when the hostname has been resolved.
Address = Socket:GetIPAddressAndPortEx()
Address (string) = The IP address of the socket.
Returns the IP address of the socket. Only valid when the hostname has been resolved.
Id = Socket:GetId()
Id (integer) = The id of the Socket object.
Returns the unique id of the Socket object.
Total = Socket:GetRXBytes()
Total (integer) = The number of bytes read from this socket.
Returns the total number of bytes read from this socket.
Total = Socket:GetRXPackets()
Total (integer) = The number of packets read from this socket.
Returns the total number of packets read from this socket.
Reason = Socket:GetReason()
Reason (string) = Reason for last error
Returns the current OpenSSL error string associated with the socket.
State = Socket:GetSecure()
State (boolean) = Encryption state.
Returns if this socket was initialised using SSL.
Status = Socket:GetStatus()
Status (integer) = The current socket status.
Returns the current flags of the socket (See GetStatusCodes()).
Total = Socket:GetTXBytes()
Total (integer) = The number of bytes written to this socket.
Returns the total number of bytes written to this socket.
Total = Socket:GetTXPackets()
Total (integer) = The number of packets written to this socket.
Returns the total number of packets written to this socket.
Data, Count = Socket:PopRecvQ()
Data (Asset) = An array of data at the front of the read queue.
Count (integer) = The number of bytes removed from the read queue.
Removes the packet from the front of the read queue. If used as a HTTP socket then this may contain return header information (use PopSendQT() instead).
Data, Count = Socket:PopSendQ()
Data (Asset) = The data packet at the front of the send queue.
Count (integer) = The number of bytes removed from the queue.
Removes the packet from the front of the write queue. If used as a HTTP socket then this may contain return header information (use PopSendQT() instead).
Data, Count = Socket:PopSendQT()
Data (Asset) = An array of data that was waiting to be written to the queue.
Count (integer) = The number of bytes removed from the queue.
Removes all data from the pending write queue. If used as a HTTP socket then this may contain return header information (use PopSendQT() instead).
Count = Socket:RecvQCount()
Count (integer) = The current number of packets waiting to be processed.
Because socket operations are asynchronous, the caller needs to process the packets manually. This function shows how many 'read' packets are waiting to be processed.
Count = Socket:SendQCount()
Count (integer) = The current number of packets waiting to be written.
When a send operation is requested by the programmer, each packet is put in a queue and the worker thread dispatches these packets when it can. This functions shows how many packets are waiting to be 'written'.
Time = Socket:TConnect()
Time (number) = The time the socket entered SS_CONNECTING state
Returns the processor time that the socket entered the SS_CONNECTING state.
Time = Socket:TConnected()
Time (number) = The time the socket entered SS_CONNECTED state
Returns the processor time that the socket entered the SS_CONNECTED state.
Time = Socket:TDisconnect()
Time (number) = The time the socket was closing.
Returns the processor time that the socket initiated a close() operation.
Time = Socket:TDisconnected()
Time (number) = The time the socket was closed.
Returns the processor time that the socket completed a close() operation.
Time = Socket:TRead()
Time (number) = The time the socket last completed a recv() operation.
Returns the processor time that the socket last completed a recv() receive operation.
Time = Socket:TWrite()
Time (number) = The time the socket last completed a send() operation.
Returns the processor time that the socket last completed a send() send operation.
Socket:Write(Data)
Data (Asset) = The data to write.
Places the specified data packet into the sockets send queue. The worker thread will dispatch this data as soon as it can. The function returns immediately.
Socket:WriteString(Text)
Text (string) = The data string to write.
Places the specified string packet into the sockets send queue. The worker thread will dispatch this string as soon as it can. The function returns immediately.
Data = Socket.Flags
Data (table) = A list of socket status operations.
Returns a key/value table of socket connction status codes supported.
Source:Destroy()
Stops and destroys the source object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
X, Y, Z = Source:GetDirection()
X (number) = Current X direction.
Y (number) = Current Y direction.
Z (number) = Current Z direction.
Returns the current direction of the source.
Seconds = Source:GetElapsed()
Seconds (number) = Number of seconds elapsed.
Returns the number of seconds elapsed in the source.
Gain = Source:GetGain()
Gain (number) = The current gain value.
Returns the current gain of the source.
Id = Source:GetId()
Id (integer) = The id number of the Source object.
Returns the unique id of the Source object.
State = Source:GetLooping()
State (boolean) = Is the source looping?
Returns if the source is looping.
Distance = Source:GetMaxDist()
Distance (number) = The current maximum distance.
Returns the current maximum distance of the source.
Gain = Source:GetMaxGain()
Gain (number) = The current gain value.
Returns the current maximum gain of the source.
Gain = Source:GetMinGain()
Gain (number) = The current gain value.
Returns the current minimum gain of the source.
Pitch = Source:GetPitch()
Pitch (number) = The current pitch value.
Returns the current pitch of the source.
X, Y, Z = Source:GetPosition()
X (number) = Current X position.
Y (number) = Current Y position.
Z (number) = Current Z position.
Returns the current position of the source.
Distance = Source:GetRefDist()
Distance (number) = The current reference distance.
Returns the current reference distance of the source.
State = Source:GetRelative()
State (boolean) = Is the source relative?
Returns if the source is relative.
RollOff = Source:GetRollOff()
RollOff (number) = The current rolloff.
Returns the current rolloff of the source.
State = Source:GetState()
State (integer) = The current playback state.
Returns if current playback state.
X, Y, Z = Source:GetVelocity()
X (number) = Current X velocity.
Y (number) = Current Y velocity.
Z (number) = Current Z velocity.
Returns the current velocity of the source.
Source:SetDirection(X, Y, Z)
X (number) = The new X direction.
Y (number) = The new Y direction.
Z (number) = The new Z direction.
Sets the new direction of the source.
Source:SetElapsed(Seconds)
Seconds (number) = Number of seconds elapsed.
Sets the number of seconds elapsed in the source.
Source:SetGain(Gain)
Gain (number) = The new gain value.
Sets the new gain of the source.
Source:SetLooping(Looping)
Looping (boolean) = The new looping state
Sets if the source should be looping.
Source:SetMaxDist(Distance)
Distance (number) = The new maximum distance.
Sets the maximum distance of the source.
Source:SetMaxGain(Gain)
Gain (number) = The new maximum gain value.
Sets a new maximum gain of the source.
Source:SetMinGain(Gain)
Gain (number) = The new minimum gain value.
Sets the new minimum gain gain of the source.
Source:SetPitch(Pitch)
Pitch (number) = The new pitch value.
Sets a new pitch value of the source.
X, Y, Z = Source:SetPosition()
X (number) = The new X position.
Y (number) = The new Y position.
Z (number) = The new Z position.
Sets the new position of the source.
Source:SetRefDist(Distance)
Distance (number) = The new reference distance.
Sets the new reference distance of the source.
Source:SetRelative(Relative)
Relative (boolean) = Sets if the source is relative.
Sets the new relative state of the source.
Source:SetRollOff(RollOff)
RollOff (number) = The new rolloff.
Sets the new rolloff of the source.
X, Y, Z = Source:SetVelocity()
X (number) = The new X velocity.
Y (number) = The new Y velocity.
Z (number) = The new Z velocity.
Sets the new velocity of the source.
Sql.Active()
Returns wether a transaction is in progress or not.
Sql.Affected()
Returns number of affected rows in the last result
Result = Sql.Begin()
Result (integer) = The result of the operation
Begins a new transaction. Returns non-zero if the call fails.
Result = Sql.Commit()
Result (integer) = The result of the operation
Ends an existing transaction and commits it. Returns non-zero if the call fails.
Code = Sql.Error()
Code (integer) = Last error code.
Returns the error code of the last SQLlite operation.
Error = Sql.ErrorStr()
Error (string) = Last error reason string.
Returns the string version of the error code.
Result = Sql.Exec(Code, Data)
Code (string) = The SQLlite code to execute.
Data (Any) = The arguments used in place of '?'
Result (boolean) = If the statement was added or not
Execute the specified SQLlite statement. See https://www.sqlite.org/docs.html for more information on the SQLlite API.
Error = Sql.Reason()
Error (string) = Last error reason string.
Returns the error string of the last SQLlite operation.
Records = Sql.Records()
Records (table) = Resulting records.
Returns the resulting records of the last SQLlite operation. The format is an indexed table of string key/value tables. e.g.
table = { { ["Index"]=1, ["Name"]="John Doe", ["Age"]=37 }, { ["Index"]=2, ["Name"]="Bill Gates", ["Age"]=33 }, etc...
}
Sql.Reset()
Cleans up the last result, error and response.
Sql.Time()
Returns time taken with the last executed SQL statement
Data = Sql.Codes
Data (table) = The entire list of errors SQL supports
Returns a table of key/value pairs that identify a SQL error code.
Stat.Create(Name)
Name (string) = Name of the class
Creates an empty stat table.
Stat:Data(String)
String (string) = Data string to add to the cell.
Inserts the specified string into the next cell.
Stat:DataI(Value)
Value (integer) = Integer to add to the next cell.
Inserts the specified integer into the next cell.
Stat:DataN(Value, Precision)
Value (number) = Number to add to the next cell.
Precision (integer) = Amount of precision to use on the number.
Inserts the specified number into the next cell.
Stat:Destroy()
Destroys the stat object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Output = Stat:Finish(OmitLF, Gap)
OmitLF (boolean) = Omits the ending linefeed.
Gap (integer) = Number of whitespaces between each header field.
Output (String) = The final formatted output.
Builds the whole formatted output and returns a string. All data and headers are erased and the class can be reused. Sizes and thus memory are preserved as per C++ STL rules when being reused.
Stat:Header(Text, Right)
Text (string) = Header string to add to the cell.
Right (boolean) = Header is right justified?
Inserts the specified string into the next header. This has no effect if data has been added.
Stat:HeaderDupe(Count)
Count (integer) = Number of times to duplicate the current headers.
Duplicates the currently stored headers.
Count = Stat:Headers()
Count (integer) = Number of headers registered
Returns the number of headers in the table
Id = Stat:Id()
Id (integer) = The id number of the Stat object.
Returns the unique id of the Stat object.
Id = Stat:Name()
Id (string) = The stat identifier
Returns the identifier of the Stat object.
Stat:Reserve(Rows)
Rows (integer) = Reserve memory for this many rows.
Reserves memory for this many rows.
Stat:Sort(Column, Reverse)
Column (integer) = Sort from this column
Reverse (boolean) = Sort the list in descending order
Sorts the data by the specified column.
Stat:SortTwo(Column1, Column2, Reverse)
Column1 (Integer) = Sort from this primary column
Column2 (Integer) = Sort from this secondary column if primary is the same
Reverse (Boolean) = Sort the list in descending order
Sorts the data by the specified columns.
Handle = Stream.Asset(Id, Data)
Id (String) = The identifier of the string
Data (Asset) = The file data of the ogg file to load
Handle (Ogg) = The ogg object
Loads an ogg file to stream on the main thread from the specified array object.
Stream.AssetAsync(Id, Data, ErrorFunc, ProgressFunc, SuccessFunc)
Id (String) = The identifier of the string
Data (array) = The data of the ogg file to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call during initial IO loading.
SuccessFunc (function) = The function to call when the audio file is laoded
Loads an ogg file off the main thread from the specified array object.
The callback functions send an argument to the Stream object that was created.
Stream.ClearEvents()
Clear the OnEvent callback on all Stream objects. This might be useful for when you use the OnEvent() function and the Stream object is still referenced and no longer accessable by your code in which the result is that the Stream object does not get garbage collected.
Handle = Stream.File(Filename)
Filename (string) = The filename of the ogg file to load
Handle (Stream) = The stream object
Loads a stream sample on the main thread from the specified file on disk.
Returns the stream object.
Stream.FileAsync(Filename, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the ogg to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call during initial IO loading.
SuccessFunc (function) = The function to call when the file is laoded
Loads a streamable ogg file off the main thread. The callback functions send an argument to the stream object that was created.
Stream.WaitAsync()
Halts main-thread execution until all async stream mevents have completed
Stream:Destroy()
Stops and destroys the stream object and frees all the memory associated with it. The object will no longer be useable after this call and an error will be generated if accessed.
Upper, Nominal, Lower, Window = Stream:GetBitRate()
Upper (integer) = The upper bitrate
Nominal (integer) = The nominal bitrate
Lower (integer) = The lower bitrate
Window (integer) = The window bitrate
Returns bitrate information for the audio file.
Total = Stream:GetBytes()
Total (integer) = Current stream total bytes.
Returns the size of the file that is streaming.
Rate = Stream:GetChannels()
Rate (integer) = The number of channels
Returns the number of channels in the audio file.
Duration = Stream:GetDuration()
Duration (number) = Duration in seconds
Returns the duration of the specified stream in seconds.
Duration = Stream:GetElapsed()
Duration (number) = Elapsed time in seconds
Returns the time elapsed of the stream. This is the position of the codec and not the actual playback position.
Id = Stream:GetId()
Id (integer) = The id number of the Stream object.
Returns the unique id of the Stream object.
Count = Stream:GetLoop()
Count (integer) = Number of loops left.
Returns the number of loops remaining of playback.
Count = Stream:GetLoopBegin()
Count (integer) = Smaple position begin point
Gets the current loop begin sample.
Count = Stream:GetLoopEnd()
Count (integer) = Sample position end point
Gets the current loop end sample.
Data = Stream:GetMetaData()
Data (table) = Stream metadata key/value table.
Returns all the metadata that was stored inside the audio file.
Name = Stream:GetName()
Name (string) = Filename of stream
Returns the stream indentifier or filename
Position = Stream:GetPosition()
Position (integer) = Sample position
Returns the sample position elapsed of the stream.
Rate = Stream:GetRate()
Rate (integer) = The sample rate
Returns the sample rate per second in samples.
Total = Stream:GetSamples()
Total (integer) = Current stream total samples.
Returns the duration of the stream in samples.
Version = Stream:GetVersion()
Version (integer) = The ogg version
Returns the version of the ogg file
Volume = Stream:GetVolume()
Volume (number) = Current stream volume (0 to 1).
Returns the volume of the stream class.
State = Stream:IsPlaying()
State (boolean) = Stream is playing?
Returns true if the stream is playing or false if the stream is stopped.
Stream:OnEvent(Func)
Func (function) = The callback function to call when an event occurs.
This function is called when the stream stops, starts or loops. The callback function syntax is 'function(EventType:Integer)'. Please be aware that that reference counter on the supplied function is increased therefore the reference will linger until a new function is set or the Stream class is destroyed. This also means references to variables such as this class inside the callback will make the variable invulnerable to the garbage collector if the reference on the function is not properly unreferenced so be careful how you use this!
Stream:Play(Loops, Volume, Position)
Loops (integer) = Number of loops.
Volume (number) = Stream volume (0 to 1).
Position (integer) = Sample position.
Plays the specified stream at the specified sample position.
Stream:SetElapsed(Duration)
Duration (number) = Duration in seconds
Sets the specified time index of the stream. This is not a precise time index and is optimised for speed. Use Stream.SetElapsedP() for precision.
Stream:SetElapsedPage(Duration)
Duration (number) = Duration in seconds
Sets the precise specified time index of the stream.
Stream:SetLoop(Count)
Count (integer) = New playback loop count.
Sets the new playback loop count.
Stream:SetLoopBegin(Begin)
Begin (integer) = New beginning sample playback position of loop.
Sets the new playback beginning sample position after stream loops.
Stream:SetLoopEnd(End)
End (integer) = New ending sample playback position of loop.
Sets the new playback ending sample position before stream loops.
Stream:SetLoopRange(Begin, End)
Begin (integer) = New beginning sample playback position of loop.
End (integer) = New ending sample playback position of loop.
Sets the new playback beginning sample position after stream loops and the ending sample position.
Stream:SetPosition(Position)
Position (integer) = Sample position.
Sets the precise specified sample position index of the stream.
Stream:SetPositionPage(Position)
Position (integer) = Sample position
Sets the current sample position of playback. This is not a precise position is optimised for speed. Use Stream.SetPosition() for precision.
Stream:SetVolume(Volume)
Volume (number) = New stream volume (0 to 1).
Sets the volume of the stream class even if it is playing.
Stream:Stop()
Stops playback of the specified stream. This will not modify the position or any other stream property.
Codes = Stream.Flags
Codes (table) = The table of key/value pairs of available flags
Returns possible values for Stream:OnEvent() event command.
Codes = Stream.Reasons
Codes (table) = The table of key/value pairs of available flags
Returns possible values for Stream:OnEvent() stop reason command.
Codes = Stream.States
Codes (table) = The table of key/value pairs of available flags
Returns possible values for Stream:OnEvent() last state command.
Handle = Texture.Console()
Handle (Texture) = Texture handle to console texture
Returns the handle to the console texture. Useful if you want to reuse the texture in your application. Careful not to mess around with it's properties!
Handle = Texture.Create(Source, Filter)
Source (image) = The image class to load from.
Filter (integer) = The default filter to use
Handle (Texture) = A handle to the texture(s) created.
Creates the specified texture from the specified image class.
Handle = Texture.CreateTS(Source, TWidth, THeight, PWidth, PHeight, Filter)
Source (image) = The image class to load from.
TWidth (integer) = The width of each tile in the image.
THeight (integer) = The height of each tile in the image.
PWidth (integer) = The width padding between each tile in the image.
PHeight (integer) = The height padding between each tile in the image.
Filter (integer) = The filtering setting to use on texture
Handle (Texture) = A handle to the texture(s) created.
Loads a texture as a tileset from the specified image class.
Texture:Blit()
Blits texture 0 with the stored preset texcoord (SetTC*), vertex (SetV*) and colour (SetC*). Using the Blit* functions will overwrite this stored preset data.
Texture:BlitILT(TexIndex, Left, Top)
TexIndex (integer) = The texture index to use.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created.
Texture:BlitILTA(TexIndex, Left, Top, Angle)
TexIndex (integer) = The texture index to use.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created and with the specified angle.
Texture:BlitILTRB(TexIndex, Left, Top, Right, Bottom)
TexIndex (integer) = The texture index to use.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Right (number) = The ending column pixel to draw to.
Bottom (number) = The ending row pixel to draw to.
Blits tile 0 of texture 'TexIndex' at the specified bounds.
Texture:BlitILTWH(TexIndex, Left, Top, Width, Height)
TexIndex (integer) = The texture index to use.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Blits tile 0 of texture 'TexIndex' at the specified screen co-ordinates and with the specified dimensions.
Texture:BlitILTWHA(TexIndex, Left, Top, Width, Height, Angle)
TexIndex (integer) = The texture index to use.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 0 of texture 'TexIndex' at the specified screen co-ordinates and with the specified dimensions at the specified angle.
Texture:BlitISLT(TexIndex, TileIndex, Left, Top)
TexIndex (integer) = The texture index to use.
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Blits tile 'TileIndex' of texture 'TexIndex' at the specified screen co-ordinates with the internal tile width and height calculated when created.
Texture:BlitISLTA(TexIndex, TileIndex, Left, Top, Angle)
TexIndex (integer) = The texture index to use.
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 'TileIndex' of texture 'TexIndex' at the specified screen co-ordinates with the internal tile width and height calculated when created, and with the specified angle.
Texture:BlitISLTRB(TexIndex, TileIndex, Left, Top, Right, Bottom)
TexIndex (integer) = The texture index to use.
TileIndex (integer) = The tile index to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Right (number) = The ending column pixel to draw to.
Bottom (number) = The ending row pixel to draw to.
Blits tile 'TileIndex' of texture 'TexIndex' at the specified screen bounds.
Texture:BlitISLTWH(TexIndex, TileIndex, Left, Top, Width, Height)
TexIndex (integer) = The texture index to use.
TileIndex (integer) = The tile index to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Blits tile 'TileIndex' of texture 'TexIndex' at the specified screen co-ordinates and with the specified dimensions.
Texture:BlitISLTWHA(TexIndex, TileIndex, Left, Top, Width, Height, Angle)
TexIndex (integer) = The texture index to use.
TileIndex (integer) = The tile index to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 'TileIndex' of texture 'TexIndex' at the specified screen co-ordinates and with the specified dimensions.
Texture:BlitLT(Left, Top)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Blits tile 0 of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created.
Texture:BlitLTA(Left, Top, Angle)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 0 of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created and with the specified angle.
Texture:BlitLTRB(Left, Top, Right, Bottom)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Right (number) = The ending column pixel to draw to.
Bottom (number) = The ending row pixel to draw to.
Blits tile 0 of texture 0 at the specified bounds.
Texture:BlitLTWH(Left, Top, Width, Height)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Blits tile 0 of texture 0 at the specified screen co-ordinates and with the specified dimensions.
Texture:BlitLTWHA(Left, Top, Width, Height, Angle)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 0 of texture 0 at the specified screen co-ordinates and with the specified dimensions at the specified angle from the centre of the quad.
Texture:BlitM(Columns, Left, Top, Right, Bottom)
Columns (integer) = The number of horizonal textures to blit.
Left (number) = The left position of the blit.
Top (number) = The top position of the blit.
Right (number) = The right position of the blit.
Bottom (number) = The bottom position of the blit.
Blits multiple textures as one giant texture which is a workaround for texture size limits on OpenGL.
Texture:BlitSLT(TileIndex, Left, Top)
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created.
Texture:BlitSLTA(TileIndex, Left, Top, Angle)
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates with the internal tile width and height calculated when created and with the specified angle.
Texture:BlitSLTRB(TileIndex, Left, Top, Right, Bottom)
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Right (number) = The ending column pixel to draw to.
Bottom (number) = The ending row pixel to draw to.
Blits tile 'TileIndex' of texture 0 at the specified bounds.
Texture:BlitSLTWH(TileIndex, Left, Top, Width, Height)
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates and with the specified dimensions.
Texture:BlitSLTWHA(TileIndex, Left, Top, Width, Height, Angle)
TileIndex (integer) = The tile index of the texture to blit.
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Blits tile 'TileIndex' of texture 0 at the specified screen co-ordinates and with the specified dimensions and angle.
Texture:Destroy()
Destroys the texture and frees all the memory associated with it. The OpenGL handles and VRAM allocated by it are freed after the main FBO has has been rendered. The object will no longer be useable after this call and an error will be generated if accessed.
Handle = Texture:Download(TexId)
TexId (Integer) = The sub-id of the texture to download
Handle (Image) = The image class
Dumps the texture from VRAM to the specified array. The format of which is how the image was originally uploaded
Texture:Dump()
Dumps the texture to the specified file in the specified format.
Height = Texture:GetHeight()
Height (integer) = The handle of the new mask created.
Returns height of texture.
Id = Texture:GetId()
Id (integer) = The id number of the Texture object.
Returns the unique id of the Texture object.
Name = Texture:GetName()
Name (string) = Name of the texture.
If this texture was loaded by a filename or it was set with a custom id.
This function returns that name which was assigned to it.
Count = Texture:GetSubCount()
Count (integer) = The number of sub-textures in this texture
Returns number of sub-textures found in the loaded image file.
Width = Texture:GetWidth()
Width (integer) = The handle of the new mask created.
Returns width of texture.
Texture:PopColour()
Restores the currently saved colour by PushColour.
Texture:PushColour()
Saves the currently set colour by SetCRGBA. Use PopColour to restore it.
Texture:SetCA(Alpha)
Alpha (number) = The transparency of the texture (0-1).
Sets the colour transparency of the texture. The change affects all subsequent calls to all blitting functions.
Texture:SetCB(Blue)
Blue (number) = The colour intensity of the texture's blue component (0-1).
Sets the colour intensity of the texture for the blue component. The change affects all subsequent calls to all blitting functions.
Texture:SetCG(Green)
Green (number) = The colour intensity of the texture's green component (0-1).
Sets the colour intensity of the texture for the green component. The change affects all subsequent calls to all blitting functions.
Texture:SetCR(Red)
Red (number) = The colour intensity of the texture's red component (0-1).
Sets the colour intensity of the texture for the red component. The change affects all subsequent calls to all blitting functions.
Texture:SetCRGB(Red, Green, Blue)
Red (number) = The colour intensity of the texture's red component (0-1).
Green (number) = The colour intensity of the texture's green component (0-1).
Blue (number) = The colour intensity of the texture's blue omponent (0-1).
Sets the colour intensity of the texture for each component. The change affects all subsequent calls to all blitting functions.
Texture:SetCRGBA(Red, Green, Blue, Alpha)
Red (number) = The colour intensity of the texture's red component (0-1).
Green (number) = The colour intensity of the texture's green component (0-1).
Blue (number) = The colour intensity of the texture's blue omponent (0-1).
Alpha (number) = The transparency of the texture (0-1).
Sets the colour intensity of the texture for each component. The change affects all subsequent calls to all blitting functions.
Texture:SetCRGBAI(Colour)
Colour (integer) = The entire colour to set as an integer (0xAARRGGBB)
Sets the colour intensity of the texture for each component using a 32 bit integer.
Texture:SetCX(TriIndex, V1Red, V1Green, V1Blue, V1Alpha, V2Red, V2Green, V2Blue, V2Alpha, V3Red, V3Green, V3Blue, V3Alpha)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Red (number) = Red component of vertex #1 of the specified triangle.
V1Green (number) = Green component of vertex #1 of the specified triangle.
V1Blue (number) = Blue component of vertex #1 of the specified triangle.
V1Alpha (number) = Alpha component of vertex #1 of the specified triangle.
V2Red (number) = Red component of vertex #2 of the specified triangle.
V2Green (number) = Green component of vertex #2 of the specified triangle.
V2Blue (number) = Blue component of vertex #2 of the specified triangle.
V2Alpha (number) = Alpha component of vertex #2 of the specified triangle.
V3Red (number) = Red component of vertex #3 of the specified triangle.
V3Green (number) = Green component of vertex #3 of the specified triangle.
V3Blue (number) = Blue component of vertex #3 of the specified triangle.
V3Alpha (number) = Alpha component of vertex #3 of the specified triangle.
Presets the specified colour intensities on each vertex for the Texture:BlitP* function.
Texture:SetTCLTRB(Left, Top, Right, Bottom)
Left (number) = The left co-ordinate.
Top (number) = The top co-ordinate.
Right (number) = The right co-ordinate.
Bottom (number) = The bottom co-ordinate.
Preset the specified texture bounds for the Texture:BlitP* function.
Texture:SetTCLTWH(Left, Top, Width, Height)
Left (number) = The left co-ordinate.
Top (number) = The top co-ordinate.
Width (number) = The width of the tile.
Height (number) = The height of the tile.
Preset the specified texture co-ordinates and dimensions for the Texture:BlitP* function.
Texture:SetTCX(TriIndex, TC1Left, TC1Top, TC2Left, TC2Top, TC3Left, TC3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
TC1Left (number) = GLfloat for X coord of vertex #1 of the specified triangle.
TC1Top (number) = GLfloat for Y coord of vertex #2 of the specified triangle.
TC2Left (number) = GLfloat for X coord of vertex #3 of the specified triangle.
TC2Top (number) = GLfloat for Y coord of vertex #1 of the specified triangle.
TC3Left (number) = GLfloat for X coord of vertex #2 of the specified triangle.
TC3Top (number) = GLfloat for Y coord of vertex #3 of the specified triangle.
Presets the specified texture co-ordinates on the specified triangle for the Texture:BlitP* function.
Texture:SetVLTRB(Left, Top, Right, Bottom)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Right (number) = The ending column pixel to draw to.
Bottom (number) = The ending row pixel to draw to.
Presets these screen bounds for the next use of Texture:BlitP*.
Texture:SetVLTWH(Left, Top, Width, Height)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Presets the specified screen co-ordinates and dimensions for the next use of Texture:BlitP*.
Texture:SetVLTWHA(Left, Top, Width, Height, Angle)
Left (number) = The starting column to draw from.
Top (number) = The starting row to draw from.
Width (number) = The width of the quad to draw.
Height (number) = The height of the quad to draw
Angle (number) = The angle in which to rotate from the centre point (-1 to 1).
Presets the specified screen co-ordinates and dimensions with angle for the next use of Texture:BlitP*.
Texture:SetVX(TriIndex, V1Left, V1Top, V2Left, V2Top, V3Left, V3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Left (number) = GLfloat for X coord of vertex #1 of the specified triangle.
V1Top (number) = GLfloat for Y coord of vertex #1 of the specified triangle.
V2Left (number) = GLfloat for X coord of vertex #2 of the specified triangle.
V2Top (number) = GLfloat for Y coord of vertex #2 of the specified triangle.
V3Left (number) = GLfloat for X coord of vertex #3 of the specified triangle.
V3Top (number) = GLfloat for Y coord of vertex #3 of the specified triangle.
Presets the specified co-ordinates on each vertex for the specified triangle for the Texture:BlitP* function.
Id = Texture:TileA(Left, Top, Right, Bottom)
Left (integer) = The left pixel position on the texture..
Top (integer) = The top pixel position on the texture..
Right (integer) = The right pixel position on the texture.
Bottom (integer) = The bottom pixel position on the texture.
Id (integer) = The id number for the cached texcoords..
Caches the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Id = Texture:TileAD(Left, Top, Width, Height)
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Width (integer) = The width of the texture.
Height (integer) = The height of the texture.
Id (integer) = The id number for the cached texcoords.
Caches the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Id = Texture:TileAS(Id, Left, Top, Right, Bottom)
Id (integer) = The id of the sub-texture to add to
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Right (integer) = The right pixel position on the texture
Bottom (integer) = The bottom pixel position on the texture
Id (integer) = The id number for the cached texcoords.
Caches the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions of the specified sub-texture.
Id = Texture:TileASD(Id, Left, Top, Width, Height)
Id (integer) = The id of the sub-texture to add to.
Left (integer) = The left pixel position on the texture..
Top (integer) = The top pixel position on the texture..
Width (integer) = The width of the texture..
Height (integer) = The height of the texture..
Id (integer) = The id number for the cached texcoords..
Caches the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions of the specified sub-texture.
Count = Texture:TileGSTC(Id)
Id (integer) = The id of the sub-texture to get the count for.
Count (integer) = The handle of the texture created.
Returns number of tiles found in the loaded texture file with the specified sub-texture id.
Count = Texture:TileGTC()
Count (integer) = The handle of the texture created.
Returns number of tiles found in the loaded texture file.
Texture:TileS(Id, Left, Top, Right, Bottom)
Id (integer) = The id of the tile to change
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Right (integer) = The right pixel position on the texture
Bottom (integer) = The bottom pixel position on the texture
Changes the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Texture:TileSD(Id, Left, Top, Width, Height)
Id (integer) = The id of the tile to change
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Width (integer) = The width of the texture.
Height (integer) = The height of the texture.
Changes the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Texture:TileSS(TexId, TileId, Left, Top, Right, Bottom)
TexId (integer) = The id of the sub texture to change.
TileId (integer) = The id of the tile id to change.
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Right (integer) = The right pixel position on the texture
Bottom (integer) = The bottom pixel position on the texture
Changes the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Texture:TileSSD(TexId, TileId, Left, Top, Width, Height)
TexId (integer) = The id of the sub texture to change.
TileId (integer) = The id of the tile id to change.
Left (integer) = The left pixel position on the texture.
Top (integer) = The top pixel position on the texture.
Width (integer) = The width of the texture.
Height (integer) = The height of the texture.
Changes the specified texture coordinates which you can use as a parameter to 'tileid' on blitting functions.
Texture:TileSSTC(Id, Count)
Id (integer) = The id of the sub-texture to set the size of.
Count (integer) = The new size of the tile list.
Modifies the size of the tile list. Useful if you want to manage your tile texcoord list dynamically. If the new size is below the current size then existing entries will be deleted, otherwise if the new size is larger, then new blank entries are created and are set to zero. You will need to use SetTileData to change them.
Texture:TileSTC(Count)
Count (integer) = The new size of the tile list.
Modifies the size of the tile list. Useful if you want to manage your tile texcoord list dynamically. If the new size is below the current size then existing entries will be deleted, otherwise if the new size is larger, then new blank entries are created and are set to zero. You will need to use SetTileData to change them.
Texture:Upload(Data)
Data (Image) = The pixel data to update the texture with
Updates the whole texture in VRAM with the texture specified in the array.
The array data must be the same width, the same height and the same pixel type of when the texture was first originally updated, thus the size of the memory must match the actual texture memory. The source and destination colour format must be the same, or use UploadEx
Texture:UploadEx(TexId, Data, OffsetX, OffsetY, Width, Height, Alpha)
TexId (Integer) = The sub-id of the texture to download
Data (Image) = The image to upload to the texture
OffsetX (Integer) = The X position on the destination texture where to place
OffsetY (Integer) = The Y position on the destination texture where to place
Width (Integer) = The width of the image stored in the 'Data' array
Height (Integer) = The height of the image stored in the 'Data' array
Alpha (boolean) = The source image is RGBA 32bpp? Else it is RGB 24bpp.
Updates a partial area of the supplied texture in VRAM with the texture data specified in the array. Only sources and destinations of 24 and 32 bits per pixel are supported.
Date = Util.AscNTime()
Date (string) = The timestamp converted to a string.
Converts the current time into the format 'Www Mmm dd hh:mm:ss yyyy zzz'.
There maybe a slight differences across different operating systems.
Note that time will be in local time format.
Date = Util.AscNTimeUTC()
Date (string) = The timestamp converted to a string.
Converts the current time into the format 'Www Mmm dd hh:mm:ss yyyy zzz'.
There maybe a slight differences across different operating systems.
Note that time will be in UTC time format.
Date = Util.AscTime(Timestamp)
Timestamp (integer) = The timestamp to convert to string
Date (string) = The timestamp converted to a string.
Converts the timestamp into the format 'Www Mmm dd hh:mm:ss yyyy zzz'.
There maybe a slight differences across different operating systems.
Note that time will be in local time format.
Date = Util.AscTimeUTC(Timestamp)
Timestamp (integer) = The timestamp to convert to string
Date (string) = The timestamp converted to a string.
Converts the timestamp into the format 'Www Mmm dd hh:mm:ss yyyy zzz'.
There maybe a slight differences across different operating systems.
Note that time will be in UTC time format.
Text = Util.B64D(Text)
Text (string) = The string to decode.
Text (string) = The base64 decoded string.
Decodes the specified string from base64.
Data = Util.B64DA(Text)
Text (string) = The string to decode.
Data (Asset) = The base64 decoded data array.
Decodes the specified string from base64 to a data array class. Useful if you're handling binary data and/or not sure if the data is binary/text and need to check.
Hash = Util.B64E(Data)
Data (string) = The string to encode.
Hash (string) = The return string encoded to base64.
Encodes the specified string to base64.
Hash = Util.B64EA(Data)
Data (array) = The data to encode.
Hash (string) = The return string encoded to bas64.
Encodes the specified data array to base64.
Result = Util.Bits(Bits, Precision)
Bits (integer) = The number to convert.
Precision (integer) = The precision after the decimal point to use
Result (string) = The resulting string.
Converts the specified number of bits into a human readable string.
Util.Blank()
Just a blank function that does nothing. Useful for passing to functions that require a callback. The function is only available for convenience as performing 'local function EmptyFunc() end' is generally faster than this.
Result = Util.Bytes(Count, Precision)
Count (integer) = The number to convert.
Precision (integer) = The precision after the decimal point to use
Result (string) = The resulting string.
Converts the specified number of bytes into a human readable string.
Hash = Util.CRC(Data)
Data (string) = The string to hash.
Hash (integer) = The calculated CRC hash.
Calculates a CRC32 hash from a string. Insecure, only use for super fast hashing of insignificant strings. The benefit of CRC hashing though is that the function returns an integer.
Hash = Util.CRCA(Data)
Data (array) = The data to hash.
Hash (integer) = The calculated CRC hash.
Calculates a CRC32 hash from an array class. Insecure, only use for super fast hashing of insignificant strings. The benefit of CRC hashing though is that the function returns an integer.
Result = Util.Capitalise(String)
String (string) = The string to capitalise
Result (string) = The same string in memory capitalised
Returns the same string capitalised
Result = Util.Clamp(Value, Minimum, Maximum)
Value (number) = The current number.
Minimum (number) = The minimum number.
Maximum (number) = The maximum number.
Result (number) = The clamped number.
Makes sure the specified number does not go under the minimum or maximum numbers specified.
Result = Util.ClampInt(Value, Minimum, Maximum)
Value (integer) = The current number.
Minimum (integer) = The minimum number.
Maximum (integer) = The maximum number.
Result (integer) = The clamped number.
Makes sure the specified number does not go under the minimum or maximum numbers specified.
Result = Util.Compact(Value)
Value (string) = The string to compact.
Result (integer) = The compacted string.
Removes all leading, trailing and grouped whitespaces from string so that each word has only one whitespace in between them.
Count = Util.CountOf(Source, What)
Source (string) = Source string to search
What (string) = String to search for
Count (integer) = Number of occurences in the string
A fast way of counting the number of occurences in a string.
Result = Util.DecodeUUID(High64, Low64)
High64 (integer) = The high-order 128-bit integer.
Low64 (integer) = The low-order 128-bit integer.
Result (string) = The decoded UUID.
Decodes the specified UUID integers to a string.
Result = Util.Duration(Seconds, Precision)
Seconds (number) = The number of seconds.
Precision (integer) = The maximum number of floating point digits.
Result (string) = The human readable duration string.
Converts the specified number of seconds into a human readable duration string in the format of 000:00:00:00.
High64, Low64 = Util.EncodeUUID(UUID)
UUID (string) = The UUID string to recode.
High64 (integer) = The high-order 128-bit integer
Low64 (integer) = The low-order 128-bit integer
Encodes the specified UUID string to two 64-bit integers.
Text = Util.EntDecode(Text)
Text (string) = The URL string to remove HTML entities from.
Text (string) = The URL decoded string.
Decodes HTML entities from the spcified string.
Text = Util.EntEncode(Text)
Text (string) = The URL string to insert HTML entities into.
Text (string) = The URL encoded string.
Encodes HTML entities into the spcified string.
Table = Util.Explode(Text, Separator)
Text (string) = The text to tokenise.
Separator (string) = The separator.
Table (table) = The returned table.
Splits the specified string into table entries on each matching interation of the specified separator.
Table = Util.ExplodeEx(Text, Separator, Maximum)
Text (string) = The text to tokenise.
Separator (string) = The separator.
Maximum (integer) = Maximum tokens.
Table (table) = The returned table.
Splits the specified string into table entries on each matching interation of the specified separator. The maximum value is the maximum number of tokens allowed so further occurences of the separator are not tokenised and included in the final tokens string.
Date = Util.FormatNTime(Format)
Format (stringr) = The strftime format string.
Date (string) = The timestamp converted to a string.
Converts the current timestamp into the specified formatted string.
There may be slight differences across different operating systems.
Note that time will be in local time format.
Date = Util.FormatNTimeUTC(Format)
Format (stringr) = The strftime format string.
Date (string) = The timestamp converted to a string.
Converts the current timestamp into the specified formatted string. There may be slight differences across different operating systems. Note that time will be in UTC time format.
Value = Util.FormatNumber(Value, Precision)
Value (number) = A number value, it will be converted to a string.
Precision (integer) = Maximum number of floating point digits
Value (string) = The formatted string.
Uses the current OS locale settings to cleanly format a number with thousand separators.
Value = Util.FormatNumberI(Value, Precision)
Value (integer) = A integer value, it will be converted to a string.
Precision (integer) = Maximum number of floating point digits
Value (string) = The formatted string.
Uses the current OS locale settings to cleanly format a number with thousand separators.
Date = Util.FormatTime(Timestamp, Format)
Timestamp (integer) = The timestamp to convert to string
Format (stringr) = The strftime format string.
Date (string) = The timestamp converted to a string.
Converts the timestamp into the specified formatted string. There may be slight differences across different operating systems. Note that time will be in local time format.
Date = Util.FormatTimeUTC(Timestamp, Format)
Timestamp (integer) = The timestamp to convert to string
Format (stringr) = The strftime format string.
Date (string) = The timestamp converted to a string.
Converts the timestamp into the specified formatted string. There may be slight differences across different operating systems. Note that time will be in UTC time format.
Result = Util.GetRatio(Width, Height)
Width (integer) = The width number.
Height (integer) = The height number
Result (string) = The ratio between the two numbers.
Caclulates the ratio between the two numbers and returns a string in the format of "n:n".
Result = Util.Grouped(Count, Precision)
Count (integer) = The number to convert.
Precision (integer) = The precision after the decimal point to use
Result (string) = The resulting string.
Converts the specified number into a human readable string.
Hash = Util.HMSHA1(Key, Data)
Key (string) = The entropy to use.
Data (string) = The string to hash.
Hash (string) = The calculated SHA1 hash.
Calculates a SHA1 hash from a string using the specifiy entropy. Insecure, only use for hashing of insignificant data.
Hash = Util.HMSHA224(Key, Data)
Key (string) = The entropy to use.
Data (string) = The string to hash.
Hash (string) = The calculated SHA224 hash.
Calculates a SHA224 hash from a string using the specifiy entropy.
Hash = Util.HMSHA256(Key, Data)
Key (string) = The entropy to use.
Data (string) = The string to hash.
Hash (string) = The calculated SHA256 hash.
Calculates a SHA256 hash from a string using the specifiy entropy.
Hash = Util.HMSHA384(Key, Data)
Key (string) = The entropy to use.
Data (string) = The string to hash.
Hash (string) = The calculated SHA384 hash.
Calculates a SHA384 hash from a string using the specifiy entropy.
Hash = Util.HMSHA512(Key, Data)
Key (string) = The entropy to use.
Data (string) = The string to hash.
Hash (string) = The calculated SHA512 hash.
Calculates a SHA512 hash from a string using the specifiy entropy.
Value = Util.Hex(Value)
Value (integer) = Integer to be converted to hex
Value (string) = Same number but in hexadecimal
Convert integer to hexadecimal in uppercase
Text = Util.HexDecode(Text)
Text (string) = The hex encoded string to decode.
Text (Asset) = The text decoded string.
Encodes the specified text to uppercase hexadecimal.
Data = Util.HexDecodeA(Text)
Text (string) = The hex encoded string to decode.
Data (Asset) = The decoded data array class.
Decodes the specified hexadecimal string to binary data.
Text = Util.HexEncode(Text)
Text (string) = The string.
Text (string) = The hex encoded string.
Encodes the specified text to uppercase hexadecimal.
Text = Util.HexEncodeA(Data)
Data (Asset) = The data array class to encode.
Text (string) = The hex encoded string.
Encodes the specified data array to uppercase hexadecimal.
Text = Util.HexEncodeL(Text)
Text (string) = The string.
Text (string) = The hex encoded string.
Encodes the specified text to lowercase hexadecimal.
Text = Util.HexEncodeLA(Data)
Data (Asset) = The data array class to encode.
Text (string) = The hex encoded string.
Encodes the specified data array to lowercase hexadecimal.
Value = Util.HexL(Value)
Value (integer) = Integer to be converted to hex
Value (string) = Same number but in hexadecimal
Convert integer to hexadecimal in lowercase
Result = Util.HighByte(Value)
Value (integer) = The 16-bit ranged value to extract the highest 8-bit value
Result (integer) = The resulting 8-bit ranged value
Extracts the highest 8-bits from a 16-bit ranged integer.
Result = Util.HighDWord(Value)
Value (integer) = The 64-bit ranged value to extract the lowest 32-bit value
Result (integer) = The resulting 32-bit ranged value
Extracts the lowest 32-bits from a 64-bit ranged integer.
Result = Util.HighWord(Value)
Value (integer) = The 32-bit ranged value to extract the highest 16-bit value
Result (integer) = The resulting 16-bit ranged value
Extracts the highest 16-bits from a 32-bit ranged integer.
Return = Util.IfBlank(String, Alternative)
String (string) = The string to test if empty.
Alternative (string) = The string to use if blank.
Return (string) = The returned string.
If 'String' is blank or invalid, then 'StringAlt' is returned.
String = Util.Implode(Table, Separator)
Table (table) = The table to convert to a string.
Separator (string) = The separator.
String (string) = The returned string.
Appends each entry in the specified table to a string separated by the specified separator string.
String = Util.ImplodeEx(Table, Separator, LastSep)
Table (table) = The table to convert to a string.
Separator (string) = The separator.
LastSep (string) = The final separator (i.e. ' or' or ' and').
String (string) = The returned string.
Appends each entry in the specified table to a string separated by a 'Separator' and uses the specified 'LastSep' as the final separator to form a human reable string.
Result = Util.IsASCII(String)
String (string) = The string to test if empty.
Result (boolean) = String is all ASCII.
Returns if all characters in string are all less than 0x80. This call is UTF8 compatible.
Result = Util.IsBoolean(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid boolean.
Returns if specified parameter is a boolean.
Result = Util.IsExtASCII(String)
String (string) = The string to test if empty.
Result (boolean) = String is all extended ASCII.
Returns if all characters in string are all less than 0xFF. This call is UTF8 compatible.
Result = Util.IsFunction(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid function.
Returns if specified parameter is a function.
Result = Util.IsInteger(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid integer.
Returns if specified parameter is a integer.
Result = Util.IsNumber(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid number.
Returns if specified parameter is a number.
Result = Util.IsString(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid string.
Returns if specified parameter is a string.
Result = Util.IsTable(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid table.
Returns if specified parameter is a table.
Result = Util.IsUserdata(Var)
Var (*) = Any parameter.
Result (boolean) = Is a valid userdata object.
Returns if specified parameter is a userdata object.
Result = Util.LDuration(Seconds)
Seconds (integer) = The number of seconds.
Result (string) = The human readable duration string.
Converts the specified number of seconds into a human readable duration string in the format of e.g. 0 years 0 weeks 0 days 0 hours 0 mins 0 secs.
Result = Util.LDurationEx(Seconds, Components)
Seconds (integer) = The number of seconds.
Components (integer) = The maximum number of components
Result (string) = The human readable duration string.
Converts the specified number of seconds into a human readable duration string in the format of e.g. 0 years 0 weeks 0 days 0 hours 0 mins 0 secs.
Result = Util.LowByte(Value)
Value (integer) = The 16-bit ranged value to extract the lowest 8-bit value
Result (integer) = The resulting 8-bit ranged value
Extracts the lowest 8-bits from a 16-bit ranged integer.
Result = Util.LowDWord(Value)
Value (integer) = The 64-bit ranged value to extract the lowest 32-bit value
Result (integer) = The resulting 32-bit ranged value
Extracts the lowest 32-bits from a 64-bit ranged integer.
Result = Util.LowWord(Value)
Value (integer) = The 32-bit ranged value to extract the lowest 16-bit value
Result (integer) = The resulting 16-bit ranged value
Extracts the lowest 16-bits from a 32-bit ranged integer.
Result = Util.MakeDWord(High, Low)
High (integer) = The high-order 16-bit range integer
Low (integer) = The low-order 16-bit range integer
Result (integer) = The resulting 32-bit range integer
Joins two integers in the 16-bit range to return one integer in the 32-bit range.
Result = Util.MakeQWord(High, Low)
High (integer) = The high-order 32-bit range integer
Low (integer) = The low-order 32-bit range integer
Result (integer) = The resulting 64-bit range integer
Joins two integers in the 32-bit range to return one integer in the 64-bit range.
Result = Util.MakeWord(High, Low)
High (integer) = The high-order 8-bit range integer
Low (integer) = The low-order 8-bit range integer
Result (integer) = The resulting 16-bit range integer
Joins two integers in the 8-bit range to return one integer in the 16-bit range.
Table = Util.ParseArgs(String)
String (string) = The arguments to parse.
Table (table) = A table of arguments.
Treats the specified string as a command line and returns a table entry for each argument.
Timestamp = Util.ParseTime(Format)
Format (string) = The ISO 8601 formatted string.
Timestamp (integer) = The timestamp converted from the string.
Converts the specified ISO 8601 formatted string to a numerical timestamp.
Only the format '2015-09-04T14:26:16Z' is supported at the moment.
Timestamp = Util.ParseTime2(String)
String (string) = The specially formatted date string.
Timestamp (integer) = The timestamp converted from the string.
Converts the specified specially formatted string to a numerical timestamp. Only the format 'Mon May 04 00:05:00 +0000 2009' is supported at the moment.
Timestamp = Util.ParseTimeEx(Timestamp, Format)
Timestamp (string) = The specially formatted date string.
Format (string) = The customised syntax of the formatted string.
Timestamp (integer) = The timestamp converted from the string.
Converts the specified specially formatted string to a numerical timestamp.
Result, Protocol, Secure, Host, Port, Resource, Bookmark, Username, Password = Util.ParseUrl(String)
String (string) = The url to parse
Result (integer) = The result code of the parse
Protocol (string) = The protocol string 'http' or 'https'
Secure (boolean) = The conneciton would need to use SSL?
Host (string) = The hostname to connect to
Port (integer) = The port number to connect to
Resource (string) = The resource to request
Bookmark (string) = The bookmark part of the request
Username (string) = The username part of the request
Password (string) = The password part of the request
Parses the specified url and returns all the information about it
Result = Util.Pluralise(Count, Singular, Plural)
Count (integer) = The number to check
Singular (string) = The word to suffix if the number is singular
Plural (string) = The word to suffix if the number is plural
Result (string) = The resulting number plus the suffixed text
Checks the number and suffixes the appropriate word depending on if the supplied number is singular or plural.
Result = Util.PluraliseEx(Count, Singular, Plural)
Count (integer) = The number to check
Singular (string) = The word to suffix if the number is singular
Plural (string) = The word to suffix if the number is plural
Result (string) = The resulting number plus the suffixed text
Checks the number and suffixes the appropriate word depending on if the supplied number is singular or plural. Uses the systems local settings to make sure the number is formatted properly.
Result = Util.PlusOrMinus(Count)
Count (number) = The number to convert.
Result (string) = The resulting string.
Prefixes the specified number with + or -.
Result = Util.PlusOrMinusEx(Count)
Count (number) = The number to convert.
Result (string) = The resulting string.
Prefixes the specified number with + or - and formats the number.
Result = Util.Position(Position)
Position (integer) = The position to convert to human readable form.
Result (string) = The resulting string
Converts the specified number into a positional number. i.e. 1=1st, 2="2nd", 11="11th", 98="98th", etc.
High64, Low64 = Util.RandUUID()
High64 (integer) = The high-order 128-bit integer
Low64 (integer) = The low-order 128-bit integer
Generates a random UUIDv4
Result = Util.RelTime(Seconds)
Seconds (integer) = The unix timestamp.
Result (string) = The resulting string
Subtracts the specified time with the current time and converts it to a human readable string showing the time duration between the two.
Result = Util.RelTimeEx(Seconds, Count)
Seconds (integer) = The unix timestamp.
Count (integer) = The maximum number of components.
Result (string) = The resulting string
Subtracts the specified time with the current time and converts it to a human readable string showing the time duration between the two whilst giving the option to keep the string short and simple by limiting the specified number of components to show.
Result = Util.Replace(String, Search, Replace)
String (string) = The string to search from
Search (string) = The string to find
Replace (string) = The string to replace with
Result (string) = The resulting string
A simple search/replace text mechanism without having to worry about errors with escape sequences with string:gsub. Uses standard c++ string class functions for functionality.
Result = Util.ReplaceEx(String, Data)
String (string) = The string to search from
Data (table) = Object with the replacement data
Result (string) = The resulting string
Same as Replace but takes an object table as argument which has key value pairs which are the text to replace (as key) and the text to replace to (as value).
Value = Util.Round(Value, Precision)
Value (string) = A number value
Precision (integer) = Maximum number of floating point digits
Value (number) = The rounded value
Rounds the specified number to the specified number of floating point digits up or down to the nearest zero.
Value = Util.RoundInt(Value, Precision)
Value (string) = A number value
Precision (integer) = Maximum number of floating point digits
Value (integer) = The rounded value
Rounds the specified number to the specified number of floating point digits up or down to the nearest zero.
Result = Util.RoundMul(Value, Multiplier)
Value (integer) = The integer to round up to the nearest multiple.
Multiplier (integer) = The nearest multiple in which to round up to.
Result (integer) = The resulting rounded value.
Rounds the specified integer up to the nearest multiple of the specified multiplier.
Result = Util.RoundPow2(Value)
Value (integer) = The integer to round up to the nearest power of two
Result (integer) = The resulting rounded value
Rounds the specified integer up to the nearest power of two.
Hash = Util.SHA1(Data)
Data (string) = The string to hash.
Hash (string) = The calculated SHA1 hash.
Calculates a SHA1 hash from a string. This hashing algorithm is obsolete and insecure and should no longer be used and is here only for compatibility reasons only.
Hash = Util.SHA1A(Data)
Data (array) = The data to hash.
Hash (string) = The calculated SHA1 hash.
Calculates a SHA1 hash from an array class. Insecure, only use for hashing of insignificant data.
Hash = Util.SHA224(Data)
Data (string) = The string to hash.
Hash (string) = The calculated SHA256 hash.
Calculates a SHA224 hash from a string.
Hash = Util.SHA224A(Data)
Data (array) = The data to hash.
Hash (string) = The calculated SHA256 hash.
Calculates a SHA224 hash from an array class.
Hash = Util.SHA256(Data)
Data (string) = The string to hash.
Hash (string) = The calculated SHA256 hash.
Calculates a SHA256 hash from a string.
Hash = Util.SHA256A(Data)
Data (array) = The data to hash.
Hash (string) = The calculated SHA256 hash.
Calculates a SHA256 hash from an array class.
Hash = Util.SHA384(Data)
Data (string) = The string to hash.
Hash (string) = The calculated SHA384 hash.
Calculates a SHA384 hash from a string.
Hash = Util.SHA384A(Data)
Data (array) = The data to hash.
Hash (string) = The calculated SHA384 hash.
Calculates a SHA384 hash from an array class.
Hash = Util.SHA512(Data)
Data (string) = The string to hash.
Hash (string) = The calculated SHA512 hash.
Calculates a SHA512 hash from a string.
Hash = Util.SHA512A(Data)
Data (array) = The data to hash.
Hash (string) = The calculated SHA512 hash.
Calculates a SHA384 hash from an array class.
Text = Util.Sanitise(Text)
Text (string) = The string to sanitise.
Text (string) = The modified string.
Tries to remove repetitions in the specified string.
OuterWidth, OuterHeight, InnerWidth, InnerHeight = Util.StretchInner(OuterWidth, OuterHeight, InnerWidth, InnerHeight)
OuterWidth (number) = Outer width of the rectangle to adjust
OuterHeight (number) = Outer height of the rectangle to adjust
InnerWidth (number) = Inner width of the rectangle to adjust
InnerHeight (number) = Inner height of the rectangle to adjust
OuterWidth (number) = Outer width of the rectangle to adjust
OuterHeight (number) = Outer height of the rectangle to adjust
InnerWidth (number) = Inner width of the rectangle to adjust
InnerHeight (number) = Inner height of the rectangle to adjust
Scales the specified 2D inner rectangle to the outer bounds while preserving aspect ratio.
OuterWidth, OuterHeight, InnerWidth, InnerHeight = Util.StretchOuter(OuterWidth, OuterHeight, InnerWidth, InnerHeight)
OuterWidth (number) = Outer width of the rectangle to adjust
OuterHeight (number) = Outer height of the rectangle to adjust
InnerWidth (number) = Inner width of the rectangle to adjust
InnerHeight (number) = Inner height of the rectangle to adjust
OuterWidth (number) = Outer width of the rectangle to adjust
OuterHeight (number) = Outer height of the rectangle to adjust
InnerWidth (number) = Inner width of the rectangle to adjust
InnerHeight (number) = Inner height of the rectangle to adjust
Scales the specified 2D inner rectangle to the outer bounds while preserving aspect ratio.
Count = Util.TableSize(Table)
Table (table) = A key/value pairs table
Count (integer) = Number of items in a table
This function is only provided for convenience and should not normally be used. It enumerates a key/value pairs table and returns the number of items in it. It will also subtract the number of actual 1-indexed items if there are any present. It is recommended to manually record the table size yourself whilst building the key/value pairs table instead of using this.
Result = Util.Trim(String, Search)
String (string) = The string to modify
Search (integer) = The ASCII character to remove
Result (string) = The trimmed string
Removes the specified character that are prefixed and suffixed to the specified string.
ByteCode = Util.UTF8Char(Value)
Value (integer) = Value to cast to a string
ByteCode (string) = The 'value' cast as a string.
Casts the specified 24-bit integer directly to a string. This is useful as a quicker way to create unicode characters. All bits above 24 are automatically stripped by a bitwise operation for safety.
Text = Util.UrlDecode(Text)
Text (string) = The URL string to decode.
Text (string) = The URL decoded string.
URL decodes the specified string.
Text = Util.UrlEncode(Text)
Text (string) = The URL string to encode.
Text (string) = The URL encoded string.
URL encodes the specified string.
Lines = Util.WordWrap(Text, Maximum, Indent)
Text (string) = The text to word wrap
Maximum (integer) = The maximum number of characters per line.
Indent (integer) = The indentation to wrap at.
Lines (table) = The resulting indexed table of lines.
Word wraps the specified string into a table of lines.
Registered = Variable.Exists(String)
String (string) = The console command name to lookup
Registered (boolean) = True if the command is registered
Returns if the specified console command is registered which includes the built-in engine console commands too.
Value = Variable.GetInt(Id)
Id (integer) = The engine cvar index.
Value (mixed) = The engine internal id value.
Retrieves the value of the specified cvar given at the specified id. The id's are populated as key/value pairs in the 'Variable.Internal' table.
Class = Variable.Register(Name, Default, Flags, Callback)
Name (string) = The engine cvar name.
Default (string) = The default cvar value.
Flags (integer) = The cvar flags.
Callback (function) = The callback global function name.
Class (Variable) = The Variable object created.
Registers the specified cvar name with the specified default value. The default value is ignored if there is already a saved value in the Sql cvars database. If the saved value is a corrupted encrypted value then the default is used. If the cvar already exists then an exception is thrown so make sure you check for it first if do not expect this call to garauntee success. Normally it is unless there is a memory allocation issue. You can register an unlimited amount of variables.
See Variable.Flags to see available flags.
Variable.ResetInt(Id)
Id (integer) = The engine cvar index.
Resets the specified cvar to its default variable.
Count = Variable.Save()
Count (number) = Number of items saved
Commits all modified variables to database. Returns number of items written.
Variable.SetInt(Id, Value)
Id (integer) = The engine cvar index.
Value (string) = The new engine cvar value.
Sets the new value of the specified engine cvar name. An exception is raised if any error occurds. See Variable.Result to see the possible results.
Value = Variable:Default()
Value (string) = The engine default cvar value.
Retrieves the value of the specified cvar name. An exception is raised if the specified cvar does not exist.
Variable:Destroy()
Unregisters the specified console command.
Empty = Variable:Empty()
Empty (boolean) = Is the value empty?
Returns if the value is empty.
Value = Variable:Get()
Value (mixed) = The engine cvar value.
Retrieves the value of the specified cvar name. An exception is raised if the specified cvar does not exist.
Id = Variable:Id()
Id (integer) = The id of the Variable object.
Returns the unique id of the Variable object.
Name = Variable:Name()
Name (string) = The name of the console command.
Returns the name of the console command this object was registered with.
Variable:Reset()
Resets the cvar to the default value as registered.
Success = Variable:Set(String)
String (string) = The new cvar value.
Success (integer) = The return code.
Sets the new value of the specified cvar name. An exception is raised if any error occurs. See Variable.Result to see the possible results.
Data = Variable.Flags
Data (table) = A table of const string/int key pairs
Returns all the cvar flags supported by the engine in the form of a string/int key pairs which can be used with the Variable.Register() command.
Data = Variable.Result
Data (table) = A table of const string/int key pairs
Returns the possible values that can be returned with the Variable.Set() function. Any other errors are thrown as an exception.
Handle = Video.Asset(Id, Data)
Id (String) = The identifier of the string
Data (Asset) = The file data of the ogg file to load
Handle (Ogg) = The ogg object
Loads an ogv video file to stream on the main thread from the specified array object.
Video.AssetAsync(Id, Data, ErrorFunc, ProgressFunc, SuccessFunc)
Id (String) = The identifier of the string
Data (array) = The data of the ogg file to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call during initial IO loading.
SuccessFunc (function) = The function to call when the audio file is laoded
Loads an ogv file off the main thread from the specified array object.
The callback functions send an argument to the video stream object that was created.
Video.ClearEvents()
Clear the OnEvent callback on all Video objects. This might be useful for when you use the OnEvent() function and the Video object is still referenced and no longer accessable by your code in which the result is that the Video object does not get garbage collected.
Handle = Video.File(Filename)
Filename (string) = The filename of the ogg file to load
Handle (Video) = The video stream object
Loads a video stream sample on the main thread from the specified file on disk. Returns the video stream object.
Video.FileAsync(Filename, ErrorFunc, ProgressFunc, SuccessFunc)
Filename (string) = The filename of the ogv to load
ErrorFunc (function) = The function to call when there is an error
ProgressFunc (function) = The function to call during initial IO loading.
SuccessFunc (function) = The function to call when the file is laoded
Loads a streamable ogv file off the main thread. The callback functions send an argument to the video stream object that was created.
Video.WaitAsync()
Halts main-thread execution until all async video stream events have completed.
Video:Advance()
Advances one frame. The video must be paused or stopped and it only happens in the engine thread and not its own thread.
Video:Awaken()
Initialises the audio and video structures after loading or after being manually stopped.
Video:Blit()
Blits the specified video texture frame to the currently ACTIVE fbo. This just adds to the active FBO drawing arrays and doesn't actually render until the active fbo is finished and rendered. The currently stored vertex, texcoord, colour and matrix values are used.
Video:BlitT()
TriIndex:integer=The specified triangle id.
Blits the specified video texture frame to the currently ACTIVE fbo. This just adds to the active FBO drawing arrays and doesn't actually render until the active fbo is finished and rendered. The currently stored vertex, texcoord, colour and matrix values are used.
Video:Destroy()
Stops and destroys the stream object and frees all the memory associated with it. The OpenGL handles and VRAM associated with the object will be freed after the main FBO has been rendered. The object will no longer be useable after this call and an error will be generated if accessed.
Seconds = Video:GetATime()
Seconds (Number) = Returns the elapsed audio time in seconds
Returns the elapsed video time in seconds
Seconds = Video:GetDrift()
Seconds (Number) = Drift time in seconds.
Returns the drift between audio and video sync.
FPS = Video:GetFPS()
FPS (Number) = The FPS rate of the video
Returns the FPS rate of the video
Frame = Video:GetFrame()
Frame (Integer) = The current frame
Returns the current frame number
Frames = Video:GetFrames()
Frames (Integer) = Returns the frames decoded
Returns the number of frames decoded
Frames = Video:GetFramesLost()
Frames (Integer) = Returns the frames that were skipped
Returns the number of skipped frames decoded
Width = Video:GetHeight()
Width (integer) = The height of the video
Returns the height of the video
Id = Video:GetId()
Id (integer) = The id number of the Video object.
Returns the unique id of the Video object.
Count = Video:GetLoop()
Count (integer) = Number of loops left.
Returns the number of loops remaining of playback.
Id = Video:GetName()
Id (string) = The video identifier
Returns the identifier of the video, usually the filename.
Status = Video:GetPlaying()
Status (boolean) = Playback status
Returns the playback status
Seconds = Video:GetTime()
Seconds (Number) = Returns the elapsed video time in seconds
Returns the elapsed audio time in seconds
Width = Video:GetWidth()
Width (integer) = The width of the video
Returns the width of the video
Video:OnEvent(Func)
Func (function) = The callback function to call when an event occurds. This
function is called when the video stops, starts or loops. The callback function syntax is 'function(EventType:Integer)'. The valid values that the callback can send are in the 'Video.Events' table.
Video:Pause()
Pauses the specified video.
Video:Play()
Plays the specified video.
Video:Rewind()
Rewinds the specified video back to the beginning.
Video:SetCRGBA(Red, Green, Blue, Alpha)
Red (number) = The entire fbo texture red colour intensity (0 to 1).
Green (number) = The entire fbo texture green colour intensity (0 to 1).
Blue (number) = The entire fbo texture blue colour intensity (0 to 1).
Alpha (number) = The entire fbo texture alpha colour intensity (0 to 1).
Sets the colour intensity of all the vertexes for the entire video frame texture.
Video:SetCX(TriIndex, V1Red, V1Green, V1Blue, V1Alpha, V2Red, V2Green, V2Blue, V2Alpha, V3Red, V3Green, V3Blue, V3Alpha)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Red (number) = Red component of vertex #1 of the specified triangle.
V1Green (number) = Green component of vertex #1 of the specified triangle.
V1Blue (number) = Blue component of vertex #1 of the specified triangle.
V1Alpha (number) = Alpha component of vertex #1 of the specified triangle.
V2Red (number) = Red component of vertex #2 of the specified triangle.
V2Green (number) = Green component of vertex #2 of the specified triangle.
V2Blue (number) = Blue component of vertex #2 of the specified triangle.
V2Alpha (number) = Alpha component of vertex #2 of the specified triangle.
V3Red (number) = Red component of vertex #3 of the specified triangle.
V3Green (number) = Green component of vertex #3 of the specified triangle.
V3Blue (number) = Blue component of vertex #3 of the specified triangle.
V3Alpha (number) = Alpha component of vertex #3 of the specified triangle.
Stores the specified colour intensities on each vertex for the Video:Blit() function.
Filter = Video:SetFilter()
Filter (boolean) = Video should be filtered by OpenGL
Sets GL_LINEAR filtering on the video if true, GL_NEAREST if not.
Video:SetKeyColour(Red, Green, Blue, Intensity)
Red (number) = The R component to phase out
Green (number) = The G component to phase out
Blue (number) = The B component to phase out
Intensity (number) = The intensity of the phasing out
Allows a certain colour to be phased out on the video. You must enable keying colour with the SetKeyed() function before using this
Keyed = Video:SetKeyed()
Keyed (boolean) = Video should be keyed with the set colour
Enabling this allowed the video to be chroma keyed. This also disables changing the colour intensity because the specified colour using SetCRGBA will set the colour to be keyed. If the pixel is greater or equal then the specified colour then the pixel is set to the specified alpha.
Video:SetLoop(Count)
Count (integer) = New playback loop count (-1 = infinity).
Sets the new playback loop count.
Video:SetTCLTRB(Left, Top, Right, Bottom)
Left (number) = The left co-ordinate.
Top (number) = The top co-ordinate.
Right (number) = The right co-ordinate.
Bottom (number) = The bottom co-ordinate.
Allows you to set basic texture co-ordinates when blitting the video frame texture.
Video:SetTCLTWH(Left, Top, Width, Height)
Left (number) = The left co-ordinate.
Top (number) = The top co-ordinate.
Width (number) = The width of the tile.
Height (number) = The height of the tile.
Allows you to set basic texture co-ordinates when blitting the video frame texture.
Video:SetTCX(TriIndex, TC1Left, TC1Top, TC2Left, TC2Top, TC3Left, TC3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
TC1Left (number) = Coord #1 of vertex #1 of the specified triangle.
TC1Top (number) = Coord #2 of vertex #2 of the specified triangle.
TC2Left (number) = Coord #1 of vertex #3 of the specified triangle.
TC2Top (number) = Coord #2 of vertex #1 of the specified triangle.
TC3Left (number) = Coord #1 of vertex #2 of the specified triangle.
TC3Top (number) = Coord #2 of vertex #3 of the specified triangle.
Stores the specified texture co-ordinates for when the frame buffer object is drawn.
Video:SetVLTRB(Left, Top, Right, Bottom)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Right (number) = The destination right co-ordinate.
Bottom (number) = The destination bottom co-ordinate.
Allows you to set basic vertex bounds when blitting the frame buffer object.
Video:SetVLTWH(Left, Top, Width, Height)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Width (number) = The destination width.
Height (number) = The destination height.
Allows you to set basic vertex co-ordinates and dimensions when blitting the videos frame buffer object.
Video:SetVLTWHA(Left, Top, Width, Height, Angle)
Left (number) = The destination left co-ordinate.
Top (number) = The destination top co-ordinate.
Width (number) = The destination width.
Height (number) = The destination height.
Angle (number) = The angle of the vertex
Allows you to set basic vertex co-ordinates, dimensions and angle when blitting the video's frame buffer object.
Video:SetVX(TriIndex, V1Left, V1Top, V2Left, V2Top, V3Left, V3Top)
TriIndex (integer) = Triangle index. Triangle #1 (zero) or triangle #2 (one).
V1Left (number) = Coord #1 of vertex #1 of the specified triangle.
V1Top (number) = Coord #2 of vertex #2 of the specified triangle.
V2Left (number) = Coord #1 of vertex #3 of the specified triangle.
V2Top (number) = Coord #2 of vertex #1 of the specified triangle.
V3Left (number) = Coord #1 of vertex #2 of the specified triangle.
V3Top (number) = Coord #2 of vertex #3 of the specified triangle.
Stores the specified vertex co-ordinates when using the 'Video:Blit' function.
Video:SetVolume(Volume)
Volume (number) = New video volume (0 to 1).
Sets the volume of the video class even if it is playing.
Video:Stop()
Stops and unloads the specified video, this also unloads the audio and video output structures.
Codes = Video.Events
Codes (table) = The table of key/value pairs of available flags
Returns possible values for Video:OnEvent() event command.
Lists available audio input devices (unused by engine right now).
Lists currently loaded X509 certificates which are populated by the 'net_castore' cvar on startup.
Shows all the available console commands. You can optionally specify an argument to partially match the beginning of each command.
Specifies the author of the guest application. This is used for display purposes only and can be requested by the guest and only set in the app.cfg file.
Specifies how the host wants to be run with the following flags...
[0x1] CFL_TERMINAL = Opens (Win32) or reuses (Unix) a console window.
[0x2] CFL_AUDIO = Initialises an OpenAL audio context and exposes API.
[0x4] CFL_VIDEO = Initialises an OpenGL context+window and exposes API.
Asks the system to delete the global mutex in Linux and MacOS so the engine can startup. You only need to do this if the engine crashes. On Windows the mutex is freed on process termination so there is never any need to use this on Windows.
Shows the commandline sent to the application it cannot be changed at all.
Loads the configuration file with the specified extension (usually 'app').
The suffix extension of '.cfg' is always assumed for protection so the guest need never specify it. This variable can only be set at the command-line.
Specifies any copyright information for the guest application. It is purely for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies an artificial delay to force for terminal mode in milliseconds.
This is ignored on interactive mode because a one millisecond delay is forced for every frame under the target rate.
Specifies a description for the guest application. It is purely for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies a large icon for use with the application and window. It can be any format that is supported with the Image.* loading functions. It can also be changed dynamically by Lua. Keep to empty for default icon.
Specifies a long title name for the guest application. It is uses as the window title and for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies a short title name for the guest application. It is purely for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies the base tick rate of the guest application in nanoseconds.
The engine locks to this tick rate regardless of lag. It can also be changed dynamically with Lua. The default is 0.016666667 seconds (60fps).
Sets a custom title for the window. This can only be changed at the command-line or the application configuration file and not saved to the persistence database. It only applies to the Win32 terminal window (not MacOS nor Linux terminal windows) and to any OS desktop windows. If not specified, the default is used in the format of 'L V (T)' where 'L' is the value of 'app_longname', where 'V' is the value of 'app_version' and 'T' is the target executable architechture.
Specifies a version for the guest application. It is purely for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies a website for the guest application. It is purely for display purposes only to the end-user. It can be requested by the guest and only set in the app.cfg file.
Specifies the base directory of where the executable was started from. It is only readable by the end-user and the host, but not the guest.
Specifies the [.ext]ension to use as 7-zip archives. These filenames will be checked for at startup and automatically loaded by the engine.
A boolean to specify if the executable file should be checked for a 7-zip archive and use that to load guest assets. This is only supported on Windows architectures right now and ignored on others.
Specifies the order in which to load resources. Specify '0' to only allow the files to be loaded from archives, '1' to search the disk first and then archives, '2' to load from archives first and then try the disk or '3' to load from disk only.
Species the users home directory where files are written to if they cannot be written to the working directory. It is only readable by the end-user and the host, but not the guest.
Specifies the decompression buffer size (in bytes) for the lzma api. The default value is 256 kilobytes.
Scans the directory pointed at 'ast_homedir' to be scanned for archives ending in the value specified by 'ast_bundles' which can override any game asset (except app.cfg). The default is true (yes).
Specifies an interval (in number of milliseconds) of checking for audio device changes as OpenAL does not have an event interface for this. This check is done in the audio manager thread. If a change in the audio device list is detected then the audio is reset automatically, as if the 'areset' console command was used.
Specifies an delay (in number of milliseconds) to suspend the audio thread each tick. Lower values use less CPU usage but may cause audio pops. The audio thread is in charge of managing Source classes and checking for discreprencies.
Specifies the volume of Video classes. 0.0 (mute) to 1.0 (maximum volume).
Setting a value too high may cause artifacts on older OS audio API's.
Specifies whether to use HRTF dynamics on audio output. This could cause strange audio stereo quality issues so it is recommended to disable.
Specifies the audio device number to use. -1 makes sure to use the default device, otherwise it is the index number of a specific audio device to use.
Specifies the maximum number of sources to preallocate. 0 means sources are (de)allocated dynamically. Setting this value to non-zero may improve CPU usage but increases the chances of errors if too many sources are requested.
Specifies the volume of Sample classes. 0.0 (mute) to 1.0 (maximum volume). Setting a value too high may cause artifacts on older OS audio API's.
Specifies the number of buffers to use for Stream classes. We need multiple buffers to make streamed audio playback consistent. Four should always be enough.
Specifies the size (in bytes) of memory to allocate for use with buffering data for the Stream class. Stream classes try to load up as much data in this buffer as possible before dispatching it to the audio renderer. The default is to allocate 32 kilobytes of RAM which should be enough and will need to be raised if any distortions occur in playback.
Specifies the volume of Stream classes. 0.0 (mute) to 1.0 (maximum volume). Setting a value too high may cause artifacts on older OS audio API's.
Specifies the global volume of all class types. 0.0 (mute) to 1.0 (maximum volume). Setting a value too high may cause artifacts on older OS audio API's.
Flags that specify what to auto complete when TAB key is pressed in the console...
[0x0] AC_NONE = Autocompletion is disabled [0x1] AC_COMMANDS = Autocomplete command names [0x2] AC_CVARS = Autocomplete cvar names
A boolean that specifies whether to automatically copy the variable name and value when a cvar name is typed in the console.
A boolean that specifies whether to autoscroll the console to the last newly printed message.
Specifies the background colour of the console texture in the syntax of 0xAARRGGBB or an integral number.
The texture file to load that will be used as the background for the console.
Number of lines to store in the input backlog. A successful command input automatically adds the last command typed into this list.
Specifies the maximum number of lines to keep in the console. Excess messages are discarded automatically to not fill up memory.
Flags specifying how to show CVar values in the console to protect exposure of sensetive information...
[0x0] SF_NONE = Do not show cvars marked as private or protected.
[0x1] SF_CONFIDENTIAL = Show cvars marked as private.
[0x2] SF_PROTECTED = Show cvars marked as protected.
Specifies wether the console is permanantly disabled or not.
Specifies the filename of the FreeType compatible font to load as the console font file.
Specifies the default colour of the console text. See the Console.Colours lookup table for possible values. There are only 16 pre-defined colours to keep compatibility with the system text console.
Specifies manipulation of the loaded font. See the 'Char.Flags' for possible values
Specifies the height of the loaded console FreeType font.
Specifies the amount of padding to add below each line of text rendered.
Specifies any extra padding to add to each FreeType font glyph to prevent pixels from other glyphs spilling into the render due to filtering.
Specifies the maximum character code to end precaching at
Specifies the minimum character code to start precaching from
Specifies the scale adjust of the font. A value not equal to one will cause interpolation to occur so filtering is advised.
Specifies the amount of padding to add after each cahracter rendered.
Specifies the initial size of the texture canvas in pixels. Do not set this more than 1024 pixels unless you know for a fact the GPU will support this value. An exception is thrown if not. Zero means start with enough size for one character.
Specifies the width of the loaded console FreeType font.
Specifies the height of the console in OpenGL mode. 1 means the console is covering the whole screen, and 0 means the console is not showing.
Specifies the time interval in microseconds between input polls. Only applies to the text mode console. The default is 3125 microseconds on windows (31.25 milliseconds) to prevent concurrency slowdowns and 10000 microseconds (10 milliseconds) on anything else.
Specifies the maximum number of characters that are allowed to be typed into the console input buffer.
The primary GLFW console key virtual key code to use to toggle console visibility. It is set to '`' as default on a UK keyboard.
The secondary GLFW console key virtual key code to use to toggle console visibility. It is set to '+-' as default on a US keyboard.
Specifies the maximum number of characters that are allowed on each console output line. It is needed to limit stalling the engine and GPU with very long lines.
The number of lines that are scrolled when pressing CONTROL and PAGEUP or PAGEDOWN keys.
In terminal mode, this is the maximum number of columns to draw. The larger this value is, the more text that can be displayed at once but will increase CPU usage from the operating system.
Disables the X button and close in the application context menu. This does not prevent CONTROL+C/BREAK keys. This only applies to the Windows operating system console only and a nullop on any other system!
The interval in milliseconds where the status bar and title bar are refreshed. The title bar contains basic operating statistics and the status bar is configurable by LUA and contains the input bar when text is being typed.
In terminal mode, this is the maximum number of rows to draw. The larger this value is, the more text that can be displayed at once but will increase CPU usage from the operating system.
The format of the time in the titlebar (see strftime() for details).
Throws an error if the user is running the engine with elevated privileges. This can be one of three values...
0 = The engine is allowed to be run with elevated privileges.
1 = The engine is NOT allowed to be run with elevated privileges.
2 = Same as 1 but ALLOWS when OS's has admin as default (i.e. XP!).
The default value is 2.
Throws an error if there is an executable checksum mismatch. This only applies on Windows executables only as Linux executable does not have a checksum and MacOS uses code signing externally. The default value is 1 on release executable else 0 on beta executable.
Throws an error if a debugger is running at start-up. The default value is 1 on release executable else 0 on beta executable.
Tries to activate an existing window of the same name if another instance is running. On Windows, mutexes are always cleaned up properly even in a crash but not on Linux and MacOS. So just simply remove the app name from /dev/shm and the engine should run again.
When ERR_LUAMODE is set to 1, this specifies the number of LUA script errors that are allowed before an error after this is treated as a critical error. The default value for release executable is 1000 and 10 for beta executable.
Sets how to handle a LUA script error to one of these values...
[0] LEM_IGNORE = Ignore errors and try to continue.
[1] LEM_RESET = Automatically reset on error.
[2] LEM_SHOW = Open console and show error.
[3] LEM_CRITICAL = Terminate engine with error.
The default value is 3 for release executable and 2 for beta executable.
The engine fails to run if the system does not have this amount of free memory available. If this value is zero then the check does not take place else the amount specified is allocated at startup, cleared, the speed of the clear is reported in the log then the memory is freed. The default value is zero.
The engine fails to run if the system does not have this amount of VRAM available.
The size of the audio buffer in seconds. Changing this value only takes effect the next time a 'Video' object is constructed.
For each 'Video' class, this amount of memory is allocated as buffering from disk. Changing this value only takes effect the next time a 'Video' object is constructed.
The amount of time allowed to drift between audio and video before we start speeding up or slowing down audio. Changing this value only takes effect the next time a 'Video' object is constructed.
Enables or disables the ALT+ENTER or OPTION+ENTER combinations to switch between full-screen or windowed mode (Uses value from 'vid_fs').
Specifies to include shared libraries in the log at startup.
Specifies a file to log internal engine messages to. It is used to help debugging. Leave as blank for no log file. It can be set from command-line parameters, the app.cfg file and the user.
Specifies the logging level...
[0] LH_CRITICAL = For reporting only critical messages.
[1] LH_ERROR = For reporting only errors (which halt execution).
[2] LH_WARNING = For reporting only warnings (recoverable errors).
[3] LH_INFO = For reporting useful important messages.
[4] LH_DEBUG = For reporitng other information (debugging).
Specifies the maximum number of lines to keep in the backlog. The log lines are always empty when logging to a file.
Specifies to compile any Lua code and store it in the user database for later retrieval. When loading already compiled raw code, this feature is ignored.
[0] LCC_OFF = Compile Lua code every time and not store.
[1] LCC_FULL = " with full debug information and store result (Best).
[2] LCC_MINIMUM = " with minimum debug information and store result.
The default value is 3 for release executable and 2 for beta executable.
Specifies the last known version of LUA used with the engine. If the current LUA version is different to this then the code cache will be completely deleted so all code is recompiled.
Specifies a fixed random seed that Lua's math.random() function should use. Specify zero to have this value randomised at startup with entropy from the operating system.
Specifies the script to load and execute automatically at startup. It must be a safe filename that does not leave the engines active parent directory.
Makes sure theres room for this many values on the Lua stack.
Sets the internal Lua value of LUA_MASKCOUNT and executes a callback for every such number of operations executed to check to see if the script has been executing for too long. You can see the rate of the operations by using the 'cpu' command in the engine console.
Specifies the limit in seconds of how long a engine frame can be executed for in Lua. Set to zero to disable this feature but it is not recommended as resulting infinite loops in Lua cannot be recovered and will require force termination of the entire process.
Specifies the amount of memory in bytes to reserve for each recv() or send() call. Default is 64k.
Specifies the relative directory to the client certificate store. These are required CA certificates that are used for the basis of every SSL connection. These certificates are loaded and checked at startup and a log warning message is generated if the certificate is not usable.
Specifies the default settings for TLSv1.x connections. The default is use only maximum strength ciphers.
Specifies the default settings for TLSv3 connections. The default is empty which lets OpenSSL decide.
Specifies a socket recv() command timeout in seconds.
Default is 2 minutes.
Specifies a socket send() command timeout in seconds.
Default is 30 seconds.
When using the built-in simple HTTP client, this string is sent as the default 'User-Agent' variable. It is automatically generated if left empty to "Mozilla/5.0 (<EngineName>; <EngineBits>-bit; v<EngineVersion>) <AppName>/<AppVersion>".
Specifies the maximum number of archive objects allowed to be registered by the engine. This includes the archives that are loaded at startup An exception is generated if more archives than this are allocated.
Specifies the maximum number of asset objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of bin objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of clipboard objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of Lua console commands allowed to be registered by the engine.
Specifies the maximum number of initial cvars allowed to be registered by the engine. Initial cvars are in a temporary state, they are used when the corresponding cvar is registered, and passed back to this temporary state when the cvar is unregistered. The temporary state of all initial cvars are then commited to database at exit and on-demand. An exception is generated if more initial cvars than this are allocated.
Specifies the maximum number of cvars allowed to be registered by the engine. This includes the internal default cvars. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of framebuffer objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of file objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of font objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of freetype objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of lua referenced function objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of image objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of json objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of mask objects allowed to be registered by the engine. An exception is generated if more cvars than this are allocated.
Specifies the maximum number of pcm objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of sample objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of shader objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of socket objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of source objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of stat objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of stream objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of texture objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of thread objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Specifies the maximum number of video objects allowed to be registered by the engine. An exception is generated if more objects than this are allocated.
Performs 'pragma auto_vacuum x' when the database is opened to this value.
Specifies the Sql database filename to use. This filename is subject to sandboxing and cannot leave the startup directory. The extension ".udb" is automatically suffixed and cannot be changed. If the database cannot be created than it will be created in a user writable persistence directory which is different depending on which operating system you are using. You can also specify 'MEMORY' to keep the Sqlite database in memory. Failures result in the Sqlite database being stored in memory. Specifying a blank string uses the executables filename without the extension.
Performs a reset of the database depending on the following value...
[0] DC_NONE = Perform no actions. Use current configuration.
[1] DC_OVERWRITE = Overwrite engine variables with defaults.
[2] DC_REFRESH = Completely clear SQL cvars table.
Specifies to automatically erase the database at exit if no cvars or custom tables are written to it by the guest.
Performs 'pragma foreign_keys x' when the database is opened to this value.
Performs 'pragma incremental_vacuum(x)' when the database is opened and sets 'x' to this value.
Performs 'pragma journal_mode x' when the database is opened to this value.
Specifies the number of times a Sql query can be retried before giving up. Set to -1 for infinite. The default value is 1000.
Specifies the number of milliseconds to suspend before retrying the operation. The default value is 1 and the the maximum value is 1000 for safety reasons. Setting to zero disables but yields the calling thread.
Performs 'pragma synchronous x' when the database is opened to this value.
Performs 'pragma temp_store' when the database is opened to this value.
Specifies the API to use. This is only used for troubleshooting purposes only and serves no other purpose. Select 0 (default) for GLFW_OPENGL_API, 1 for GLFW_OPENGL_ES_API or 2 for GLFW_NO_API.
Specified the number of auxiliary swap chain buffers to use. Specify 0 for double-buffering, 1 for triple-buffering or -1 to let the OpenGL driver decide.
Specifies the 32-bit integer (0xAARRGGBB) as the default clear value.
Specifies the major context version to use. This is only used for troubleshooting purposes only and serves no other purpose. The default is 3 with a core profile.
Specifies the minor context version to use. This is only used for troubleshooting purposes only and serves no other purpose. The default is 2 with a core profile.
Specifies to use double-buffering. This is only used for troubleshooting purposes only and serves no other purpose. The default is 1 for yes.
Override alpha component bit-depth. Default is -1 for GLFW_DONT_CARE.
Mainly for troubleshooting or expert purposes. This value is also saved to the configuration database if changed.
Override red component bit-depth. Default is -1 for GLFW_DONT_CARE or 10 on MacOS to prevent gradient banding issues. Mainly for troubleshooting or expert purposes. This value is also saved to the configuration database if changed.
Override red component bit-depth. Default is -1 for GLFW_DONT_CARE or 10 on MacOS to prevent gradient banding issues. Mainly for troubleshooting or expert purposes. This value is also saved to the configuration database if changed.
Override red component bit-depth. Default is -1 for GLFW_DONT_CARE or 10 on MacOS to prevent gradient banding issues. Mainly for troubleshooting or expert purposes. This value is also saved to the configuration database if changed.
Specifies to use a forward compatible context. This is only used for troubleshooting purposes only and serves no other purpose. The default is 1 for yes.
Specifies what full-screen type to use. Specify 0 to keep the engine in a normal window, 1 for exclusive full-screen mode (specified by 'vid_fsmode') or 2 for borderless full-screen mode.
Enables full-scene anti-aliasing. Only needed to smooth the edges of textures if you frequently blit textures at an different angles other than 0, 90, 180 or 270 degrees. This cvar has been semi-disabled as instability occurs with any setting other than the default on a Mac.
Specifies which full-screen mode to use. You can check the log or use 'vmlist' console command to see which resolutions are available on your system. Anything >= -1 means exclusive full-screen mode and -1 makes the engine use the current desktop resolution (default on Mac for now). Use -2 to make the engine use borderless full-screen mode (default on Win/Linux).
Overrides the gamma level. The default is 1 which is to keep the desktop gamma level.
Set to 0 (default) to disable MacOS graphics switching, or 1 to allow MacOS to switch between integral and dedicated graphics.
Locks the main frame buffer size to the app author values specified by 'vid_orwidth' and 'vid_orheight' instead of resizing it to the windows size.
Specifies the monitor id to use. Use the 'mlist' console command to see possible values or just use -1 to let the operating system decide.
Specifies the maximum aspect ratio allowed in the main frame buffer. For example, 1.333333 is 4:3 and 1.777778 is 16:9. Only applies when the 'vid_simplematrix' cvar is set to 0.
Specifies the minmum aspect ratio allowed in the main frame buffer. For example, 1.333333 is 4:3 and 1.777778 is 16:9. Only applies when the 'vid_simplematrix' cvar is set to 0.
Specifies the type of profile to create the context for. This is only used for troubleshooting purposes only and serves no other purpose. Select 0 (default) for GLFW_OPENGL_CORE_PROFILE, 1 for GLFW_OPENGL_COMPAT_PROFILE or 2 for GLFW_OPENGL_ANY_PROFILE.
Specifies texture compression quality. Default is maximum.
Pre-allocates space for the specified number of OpenGL command structures.
There could be FPS issues initially if this value is set too low. Only the app author needs to be concerned with this value and can only be set in the application manifest.
Pre-allocates the specified number of frame buffer names to reserve in the pending frame buffer names deletion list. Only the app author needs to be concerned with this value and can only be set in the application manifest.
Pre-allocates the specified number of texture names to reserve in the pending texture names deletion list. Only the app author needs to be concerned with this value and can only be set in the application manifest.
Specifies the context release behaviour. This is only used for troubleshooting purposes only and serves no other purpose. Select 0 (default) for GLFW_ANY_RELEASE_BEHAVIOR, 1 for GLFW_RELEASE_BEHAVIOR_FLUSH or 2 for GLFW_RELEASE_BEHAVIOR_NONE.
Pre-allocates space for the specified number of frame buffer names. By default we allocate enough room for the main frame buffer and the console frame buffer. There could be FPS issues initially if this value is set too low and many frame buffers are used. Only the app author needs to be concerned with this value and can only be set in the application manifest.
Pre-allocates buffer space for the specified number of GLfloats. There could be FPS issues initially if this value is set too low. Only the app author needs to be concerned with this value and can only be set in the application manifest.
Specifies the robustness strategy of the context. This is only used for troubleshooting purposes only and serves no other purpose. Specify 0 for GLFW_NO_RESET_NOTIFICATION, 1 (default) for GLFW_LOSE_CONTEXT_ON_RESET or 2 for GLFW_NO_ROBUSTNESS.
Set to 0 to not maintain frame buffer aspect ratio, or 1 to allow the main frame buffer to stick to the users preferred aspect ratio (see 'vid_oraspmin' and 'vid_oraspmax).
Specifies the screenshot type, see the command output of 'imgfmts' to see the image types supported and the id's for them. Only entries marked with the 'S' (saveable) token can be used.
Specifies the type of sub-pixel rounding function on the main frame-buffer GLSL shader. Specify 0 for no sub-pixel rounding, 1 to use the floor() function, 2 to use the ceil() function, 3 to use the round() function or 4 to use the roundEven() function.
Sets the texture filter id and equates to the values of the 'Fbo.Filters' table.
Enables vertical synchronisation which helps smooth the frame rate. Set to 0 if you don't care about the longevity of your GPU and make it draw as fast as possible, or 1 to keep it synchronised to your monitors vertical refresh rate. You can also use -1 to use adaptive sync, and 2 to half the refresh rate if you like.
Specifies that the window has alpha which is needed for transparent windows. Default is 0 for no.
Force the window to have an aspect ratio. Specify as a floating point number. i.e. 16.9 for 16:9 or 4.3 for 4:3, etc. or 0 for numeric and/or denominator for freedom for the end user to resize at will.
Specifies if the window should have a titlebar and a border.
Specifies to lock the visibility of the window, otherwise known as 'always on top' or 'Topmost'.
Sets the initial height of the window. This value is saved to the persistence database when changed.
Sets the maximum height of the window. This is only changable at the application configuration file and is not saved to persistence database.
The upper value is clamped by the GPU's maximum texture size which is normally 16384 on all modern GPU's. Specify 0 to use the GPU maximum.
Sets the minimum height of the window. This is only changable at the application configuration file and is not saved to persistence database.
Specify 1 to have the window automatically maximised on creation or 0 to not. The default value is 0.
Specify 1 to have the window automatically minimise when it is not active or 0 to not. The default value is 1.
Specify the default X position of the window. -2 means the centre of the screen and -1 means the default position. Any other value is the actual physical position on the screen. The default value is -2.
Specify the default Y position of the window. -2 means the centre of the screen and -1 means the default position. Any other value is the actual physical position on the screen. The default value is -2.
Specify 1 if the window is allowed to be resized or 0 if not. The default value is 1.
Sets the initial width of the window. This value is saved to the persistence database when changed.
Sets the maximum width of the window. This is only changable at the application configuration file and is not saved to persistence database.
The upper value is clamped by the GPU's maximum texture size which is normally 16384 on all modern GPU's. Specify 0 to use the GPU maximum.
Sets the minimum width of the window. This is only changable at the application configuration file and is not saved to persistence database.