ZForms documentation/RadioButton

A button element where one of a set of buttons is on at any given time. Used for when the user should be able to select one option.

RadioController
Radio buttons in ZForms use an associated class, RadioController, which is a simple wrapper around an int:

This class is used to allow multiple radio buttons to keep track of a shared value, which they then use to determine whether to render as active or inactive. The value at RadioController.curVal should be used by a menu to determine what the user has clicked, either by polling the controller or by receiving it as part of a radio button event.

If you need to associate data other than ints with a radio button selection, a good way to do this is simply to use an array with the data you need to store, and use curVal as an index.

Usage
Sets the textures used for the four button states.

Usage
Configures the radio button's member variables.

Parameters

 * variable: The RadioController for this radio button, as discussed above. Different radio buttons in the same "set" should be given the same controller.
 * value: The RadioController value associated with this radio button. When clicked, the button will set variable.curVal to this, and the button with variable.curVal == variable will be drawn as active.
 * inactive: The texture used when the button isn't hovered or clicked.
 * hover: The texture used when the button is hovered over but not clicked.
 * click: The texture used when the button is clicked.
 * disabled: The texture used when the button is disabled.
 * text: The text the button displays.
 * fnt: The font used to display text. Defaults to smallfont.
 * textScale: The scale to display the text at.
 * textColor: The color to display the text in.
 * alignment: Where the text on the button is aligned to.
 * cmdHandler: The handler the button sends events to.
 * command: The command used for the handler.

Usage
Creates a radio button element.

Parameters

 * pos: The element's XY coords.
 * size: The element's size.
 * variable: The RadioController for this radio button, as discussed above. Different radio buttons in the same "set" should be given the same controller.
 * value: The RadioController value associated with this radio button. When clicked, the button will set variable.curVal to this, and the button with variable.curVal == variable will be drawn as active.
 * inactive: The texture used when the button isn't hovered or clicked.
 * hover: The texture used when the button is hovered over but not clicked.
 * click: The texture used when the button is clicked.
 * disabled: The texture used when the button is disabled.
 * text: The text the button displays.
 * fnt: The font used to display text. Defaults to smallfont.
 * textScale: The scale to display the text at.
 * textColor: The color to display the text in.
 * alignment: Where the text on the button is aligned to.
 * cmdHandler: The handler the button sends events to.
 * command: The command used for the handler.