Lua API  0.4.0
Game Engine
 All Files Functions
System.lua File Reference

Functions

 centerCursor ()
 Sets the cursor to the center of the screen. More...
 
 hideCursor ()
 Hides the cursor. More...
 
 showCursor ()
 Shows the cursor. More...
 
 getWindowScale ()
 Retrieves the current window resolution. More...
 
 getSystemTick ()
 Returns the number of milliseconds that passed since the application started. More...
 
 quit ()
 Quits the game. More...
 
 dofile (file)
 Includes a file into script for execution. More...
 

Function Documentation

centerCursor ( )

Sets the cursor to the center of the screen.

dofile ( file  )

Includes a file into script for execution.

Parameters
fileThe file to execute.

Will look for scripts in "$PROJECT_DIR/scripts". The example would load "$PROJECT_DIR/scripts/filename.lua".

Example:

dofile("filename.lua")
getSystemTick ( )

Returns the number of milliseconds that passed since the application started.

Returns
The current tick count.
getWindowScale ( )

Retrieves the current window resolution.

Returns
The resolution as a vec2.

Example:

resolution = getWindowScale()
print("The window has a resolution of " .. resolution[1] .. "x" .. resolution[2])
hideCursor ( )

Hides the cursor.

quit ( )

Quits the game.

The player will terminate, the editor will return to an editing environment.

showCursor ( )

Shows the cursor.