DI-Guy Lua AI SDK
 All Classes Files Functions Variables Groups Pages
luaLabel Class Reference

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 = {}
 

Detailed Description

A helper class for setting up camera and other buttons on the screen.

Member Function Documentation

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.

Parameters
optionstable of options
options.x,ycoordinates of first button
options.widthwidth of label
options.bg_colorRGBA
luaLabel::create_multiple_choice_buttons ( options  ,
  ... 
)

Creates a set of multiple choice buttons.

The buttons are laid out vertically.

Parameters
label_textname of scenario var
optionstable of options
options.x,ycoordinates of first button
options.widthwidth of label
options.heightheight of label
options.bg_colorRGBA
options.imageimage file to use as background
options.pick_scriptscript to run when choice made
options.arg2,arg3,etcsequence 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.

Parameters
label_textname of scenario var
optionstable of options
options.x,ycoordinates
options.widthwidth of label
options.heightheight of label
options.marginmargin size
options.bg_colorRGBA
options.no_textif true, no text
options.initial_stateon or off
options.on_texttext 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
Returns
The button
luaLabel::create_var_button ( var_name  ,
options   
)

Creates a button that controls a scenario variable.

The button will include +/- clickable labels.

Parameters
var_namename of scenario var
optionstable of options
options.x,ycoordinates
options.widthwidth of label
options.colorRGBA
Returns
The button
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::setmetatable ( registry  ,
{__mode= 'v'}   
)
luaLabel::show_info_label ( name  ,
message  ,
offset   
)

Creates an informational (non-interactive) label.

The label will go at the bottom of the window.

Parameters
namename of the label
messagedisplayed message
offsetoffset from edge of screen (vertical)

Member Data Documentation

luaLabel::registry = {}

The documentation for this class was generated from the following file: