Sets one or more items in the engine’s data manager. Each index and value in the table passed in will be set in the data manager using the index’s name as the key.
function lua_fuc( mapargs, stringargs ) local data_table = {} data_table["variable_name"] = "variable data" gre.set_data( data_table ) end
Gets one or more data entries from the data manager. Each value passed in as a parameter has a lookup in the data manager using the value as the key. This function returns a table using all the values as indexes and the corresponding value is the data returned from the data manager. A nil is returned for any values that do not match a key in the data manager.
function get_data_fuc( mapargs, stringargs ) local data_table = {} data_table = gre.get_data("variable_name") print("variable_name = "..data_table["variable_name"]) end
Send an event to the application or to a Storyboard IO channel. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
To send to the event to the application :
gre.send_event("my_event")
To send the event to a Storyboard IO channel via parameters:
gre.send_event("my_event", “io_channel_name”)
Send an event to a targeted model element (control, layer instance or screen). channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Send an event with custom data to the application or to a Storyboard IO channel. data is a lua table where the indexes match the values from the format string. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Send a touch event to the application at the co-ordinates passed in through the parameters. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Send a key_up event to the application with the scancode passed in the parameters. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the global Lua variable "GREIONAME" is set to a string value, then that value will be used as the channel name, otherwise ...
If the script is being run within the Storyboard Engine (as opposed to via the standalone Lua interpreter) then the channel used will be the one associated with the application, otherwise ...
If the environment variable GREIONAME is set then it will be used.
Send a key_down event to the application with the scancode passed in the parameters. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Send a key_repeat event to the application with the scancode passed in the parameters. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Force a screen redraw. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.
Move a layer to a new position. Key_name is the name of the layer or a variable. Setting dx and or dy will move the layer by the specified delta from its current position. Dx and dy can be 0 to set an absolute position using x and y.
Move a layer to a new position. Key_name is the name of the control or a variable. Setting dx and or dy will move the layer by the specified delta from its current position. Dx and dy can be 0 to set an absolute position using x and y.
Get attributes for a control. Key name is the name of the control or a variable. Tags can be a list of the following values:
x, y, hidden, active
A table with the results is returned.
function check_if_hidden() local dk_data = {} -- check if my_control is currently hidden dk_data = gre.get_control_attrs("my_control", "hidden") if dk_data["hidden"] == 1 then print("my_control is currently hidden") else print("my_control is currently visible") end end
Get attributes for a layer. Key name is the name of the layer or a variable. Tags can be a list of the following values:
x, y, alpha, hidden, active
A table with the results is returned.
Get attributes for a table. Key name is the name of the control or a variable. Tags can be any of the control tags mentioned in section 6.1.12 and any of the following values:
rows : The number of rows in the table
cols: The number of columns in the table
visible_rows: The number of visible rows
visible_cols: the number of visible columns
active_row: The active cell row
active_col: The active cell column
row: The row index of the upper left column
col: The column index of the upper left column
Set attributes for a control. Key name is the name of the control or a variable. Table contains the tags and values for the attributes to set.
x, y, width, height, hidden, active
function set_control_hidden() local dk_data = {} dk_data["hidden"] == 1 gre.set_control_attrs("my_control", dk_data) end
Set attributes for a layer. Key name is the name of the layer or a variable. Table contains the tags and values for the attributes to set.
alpha, hidden, active
Set attributes for a layer globally on all instances of the layer on all screens. Key name is the name of the layer or a variable. Table contains the tags and values for the attributes to set.
alpha, hidden, active
Calculate the area in pixels which the given string will occupy on the screen. Optionally calculate how many characters can fit into a predefined screen area.
Parameters:
string The string to render
font The name of the font to render int
font_size The size of the font to render in
string_length The length of the string to render or 0 for all (optional)
width a clip size for the string, used to calculate how many characters can fit in an area
Returns:
A table containing the following values:
"nchars" number of characters that will fit in clip if specified
"width" string width clipped by clip
"height" string height cliped by clip
Send QUIT event to application to force shutdown. channel is an optional parameter and if channel is not passed then the channel will be chosen as follows:
If the environment variable GREIONAME is set then it will be used otherwise the default channel is used.