|
DI-Guy Lua AI SDK
|
A helper class for setting up camera and other buttons on the screen. More...
Public Member Functions | |
| setmetatable (registry,{__mode= 'v'}) | |
Button Creation and Removal Functions | |
| create_var_button (var_name, options) | |
| Creates a button that controls a scenario variable. More... | |
| create_camera_buttons (options) | |
| Creates a button for each camera in scenario. More... | |
| create_ui_button (label_text, options) | |
| Creates a standard text or graphical button. More... | |
| create_multiple_choice_buttons (options,...) | |
| Creates a set of multiple choice buttons. More... | |
| destroy_multiple_choice_buttons () | |
| Destroys the last-created group of multiple choice buttons. More... | |
| show_info_label (name, message, offset) | |
| Creates an informational (non-interactive) label. More... | |
| remove_info_label (name) | |
| Doesn't technically "remove" label; just hides it. More... | |
Public Attributes | |
| registry = {} | |
A helper class for setting up camera and other buttons on the screen.
| luaLabel::create_camera_buttons | ( | options | ) |
Creates a button for each camera in scenario.
The buttons will be laid out vertically. When a user clicks a button, that camera will be selected.
| options | table of options |
| options.x,y | coordinates of first button |
| options.width | width of label |
| options.bg_color | RGBA |
| luaLabel::create_multiple_choice_buttons | ( | options | , |
| ... | |||
| ) |
Creates a set of multiple choice buttons.
The buttons are laid out vertically.
| label_text | name of scenario var |
| options | table of options |
| options.x,y | coordinates of first button |
| options.width | width of label |
| options.height | height of label |
| options.bg_color | RGBA |
| options.image | image file to use as background |
| options.pick_script | script to run when choice made |
| options.arg2,arg3,etc | sequence of button names |
| luaLabel::create_ui_button | ( | label_text | , |
| options | |||
| ) |
Creates a standard text or graphical button.
The button can be in an on state or an off state. Users need to set click-handling script.
| label_text | name of scenario var |
| options | table of options |
| options.x,y | coordinates |
| options.width | width of label |
| options.height | height of label |
| options.margin | margin size |
| options.bg_color | RGBA |
| options.no_text | if true, no text |
| options.initial_state | on or off |
| options.on_text | text to show in "on" state |
| options.off_text | : text to show in "off" state |
| options.image | : image file to use as background |
| options.type | : "toggle" or "trigger" |
| options.on_script | : script to run when button turned on |
| options.off_script | : script to run when button turned off |
| luaLabel::create_var_button | ( | var_name | , |
| options | |||
| ) |
Creates a button that controls a scenario variable.
The button will include +/- clickable labels.
| var_name | name of scenario var |
| options | table of options |
| options.x,y | coordinates |
| options.width | width of label |
| options.color | RGBA |
| luaLabel::destroy_multiple_choice_buttons | ( | ) |
Destroys the last-created group of multiple choice buttons.
| luaLabel::remove_info_label | ( | name | ) |
Doesn't technically "remove" label; just hides it.
| luaLabel::show_info_label | ( | name | , |
| message | , | ||
| offset | |||
| ) |
Creates an informational (non-interactive) label.
The label will go at the bottom of the window.
| name | name of the label |
| message | displayed message |
| offset | offset from edge of screen (vertical) |
| luaLabel::registry = {} |