Return information about the Storyboard runtime environment. The input can be either a single string containing the key to look up or a table of keys for variables to match. The following table describes the available keys:


The version of this engine as a string value. The format of the string is four version numbers separated by dots:


The target operating system


The target processor


The name of the graphics rendering technology being used.


The dimensions of the screen width


The dimensions of the screen height


The name of the currently active screen


The rendering capabilities. Currently the only defined capability is "3d" if 3D rendering is supported


Platform memory statistics for the engine. The results are returned in a table with string keys, indicating the type of memory value being reported, and number values in bytes. Not all platforms support querying all statistics so this field may be nil or the individual field values may be set to 0 indicating that the platform can not provide the requested level of detail.

The key process_used returns the number of bytes of memory that is being used by the Storyboard Engine process.

The key heap_used returns the number of bytes of memory that is specifically being used by the heap. This number is usually smaller than the process memory and does not typically include large memory allocations for display framebuffers or memory mapped files.


The current application's IO channel name.

Parameters: key A string or a table of strings to look up. Returns: If a single string is provided as an input argument, just a single data value for that argument is returned If a table is provided as an input argument, then a table with key/value pairs corresponding to the keys of the input argument and the results they provide. Example:

-- Get the target OS for dynamic module loading
local os = gre.env("target_os")
print("Running on target OS: " .. tostring(os))

-- Report on the Storyboard version and rendering technology
local info = gre.env({"version", "renderer"})
local msg = string.format("Storyboard version %s (%s renderer)",\
            info.version, info.renderer)
Was this article helpful?
0 out of 0 found this helpful