Game engine variables - Protovision/io-lua GitHub Wiki
If you include config.lua in your game folder, that file can set variables used by the game engine by using the Get and Set functions. Game engine variables can also be set through the command line.
The following variables should only be set through the command line before the application starts:
-
base - Filename of zip file containing common assets that can be used by all games. By default, base refers to base.zip within the directory of the game engine executable.
-
game - Filename of zip file containing the assets and lua files for the current game. By default, game refers to game.zip within the directory of the game engine executable.
-
datapath - Path of where the game can store data. By default, datapath refers to: $HOME/.local/share/protovision/io-lua on Linux, $HOME/Library/Application Support/protovision/io-lua on Mac OS X, and %appdata%\protovision\io-lua on Windows. Your Lua application may read or write files in the datapath directory.
To set a variable through the command line, pass in the "+set" followed by the variable name and then the value. For example, to set gamepath to ./projects/mygame pass in: +set gamepath ./projects/mygame
The following variables can be set from config.lua (or the command-line):
- title - Window title (default: "io-lua application")
- fps - Maximum frames per second (default: 85)
- fontsize - Default font size for pre-loaded fonts (default: 12)
- fontfamily - Default font family to use for DrawText (default: FONT_SANS)
- fgcolor - Default foreground color for DrawText (default: 0x000000FF)
- bgcolor - Initial background color of game window (default 0xFFFFFFFF)
- memblocks - Number of blocks in Lua's memory pool (default: 4096)
- memsize - Size of each block in Lua's memory pool (default: 65536 (64 kb))
- v_width - Window width in pixels (default: 640)
- v_height - Window height in pixels (default: 480)
- v_driver - Index of video driver to use
- v_renderer - Index of render driver to use
- v_fullscreen - 1 or 0 for fullscreen (default: 0)
- v_grab - 1 or 0 for disabling mouse input from leaving the window (default: 0)
- s_volume - Initial volume of sound. 0.0 is mute, 1.0 is full volume, there is no enforced volume limit
- s_driver - Index of sound driver to use
- s_device - Index of sound device to use for playback
- s_freq - Speed of sound playback
- s_format - Bit size of sound samples (8, 16, or 32)
- s_channels - 1 for mono, 2 for stereo
- s_samples - Audio buffer size in samples