Bitfighter  021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
CounterMenuItem Class Reference

Menu item for entering a numeric value, with increment and decrement controls.

Inheritance diagram for CounterMenuItem:
MenuItem

Member Functions

CounterMenuItem(name, startingVal, step, minVal, maxVal, units, minText, help)
 Constructor.
 

Detailed Description

Menu item for entering a numeric value, with increment and decrement controls.

Constructor Documentation

◆ CounterMenuItem.new(name, startingVal, step, minVal, maxVal, units, minText, help)

Arg types: name: string, startingVal: num, step: num, minVal: num, maxVal: num, units: string, minText: string, help: string  |  returns CounterMenuItem

Constructor.

Example:

countermenuitem = CounterMenuItem.new(name, startingVal, step, minVal, maxVal, units, minText, help)
...
levelgen:addItem(countermenuitem)
Menu item for entering a numeric value, with increment and decrement controls.
Definition: UIMenuItems__cpp.h:23
Parameters
nameThe text shown on the menu item.
startingValThe starting value of the menu item.
stepThe amount by which to increase or decrease the value when the arrow keys are used.
minValThe minimum allowable value that can be entered.
maxValThe maximum allowable value that can be entered.
unitsThe units to be shown alongside the numeric item. Pass "" if you don't want to display units.
minTextThe text shown on the menu item when the minimum value has been reached. Pass "" to simply display the minimum value.
helpA bit of help text.

The MenuItem will return the value entered.

For example:

m = CounterMenuItem.new("Wall Thickness", 50, 1, 1, 50, "grid units", "", "Thickness of wall to be created")