Loving Cube Engine API documentation

Introduction and table of contents - The init file - The Main object - Importing new textures - Importing 3D meshes - New data types - List of instantiable objects - List of static objects


The init file

The init file is a very simple INI configuration file, that you can put in the same folder than the executable as name "init.ini". It may contain the following fields, all optional:

Variable nameDescriptionTaken in consideration in a Windows Store app
lua_file_pathThe path of the main Lua file, relative to the executable.yes
window_titleThe window title, if it is windowed.no
window_widthThe window width in pixel units, if it is windowed.no
window_heightThe window height in pixel units, if it is windowed.no
is_fullscreenIf "true", the window is started as full screen mode. Window size is set to the current desktop resolution.no
change_desktop_resolutionIf "true", the desktop resolution is set to (window_width,window_height).no
app_data_folder_basenameThe name of the subdirectory in %AppData% which will contain the user application data.yes
default_font_img_pathThe path of the image used for rendering 2D text.yes
virtual_size_enableIf enabled, use virtual_width and virtual_height to define the number of virtual pixels within the window, disregarding the real window size. Everything 2D (sprites, text, ...) will be stretched to fill in this virtual viewport. Note that Misc.getWindowSize() will then return the virtual size and not the real window size any more. It also works in fullscreen mode, as a way to "change" the resolution.yes
virtual_width(Used only if virtual_size_enable is true.) The virtual width of the window, in pixel units.yes
virtual_height(Used only if virtual_size_enable is true.) The virtual height of the window, in pixel units.yes
virtual_size_allow_ratio_deformation(Used only if virtual_size_enable is true.) If true, allow the image to be deformed whenever the ratio of the virtual window (virtual_width/virtual_height) does not match the ratio of the real window (window_width/window_height). If false, preserve the ratio and add borders accordingly to fill the window.yes
virtual_size_border_colorIf virtual_size_allow_ratio_deformation is false, define the color of borders (R,G,B,A components, comma-separated)yes
default_background_colorDefault background color, used for loading baryes
default_foreground_colorDefault foreground color, used for loading baryes

The default values are:

lua_file_path=data/main.lua
window_title=Loving Cube Engine Application
window_width=1024
window_height=768
is_fullscreen=false
app_data_folder_basename=LovingCubeEngine
default_font_img_path=data/default_font.png
virtual_size_enable=false
virtual_width=-1
virtual_height=-1
virtual_size_allow_ratio_deformation=false
virtual_size_border_color=128,128,128,255
default_background_color=0,0,0,255
default_foreground_color=255,255,255,255

Command-line options

The executables support these options. The command-line options have priority over the init.ini file.