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

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

Inheritance diagram for FloatCounterMenuItem:
MenuItem

Member Functions

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

Detailed Description

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

Constructor Documentation

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

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

Constructor.

Example:

floatcountermenuitem = FloatCounterMenuItem.new(name, startingVal, step, minVal, maxVal, decimalPlaces, units, minText, help)
...
levelgen:addItem(floatcountermenuitem)
Menu item for entering a floating value, with increment and decrement controls.
Definition: UIMenuItems__cpp.h:29
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.
decimalPlacesThe number of decimal places of accuracy to use.
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 = FloatCounterMenuItem.new("Angle", 1.5, 0.1, 0.1, 100, 3, "radians", "", "Angle of object to rotate")