ChoiceLabel

Package: Libraries.Interface.Controls · Inherits from: Libraries.Game.Graphics.Label, Libraries.Interface.Item, Libraries.Interface.Controls.Control, Libraries.Interface.Item2D, Libraries.Language.Object

The label inside a Checkbox or a RadioButton. It shows its control's focus as a line under its text, without taking the focus itself.

Example Code

use Libraries.Interface.Controls.ChoiceLabel
use Libraries.Interface.Controls.Checkbox

class Main
action Main
    Checkbox box
    ChoiceLabel label
    label:SetOwner(box)
    label:SetText("Remember me")
end
end

Actions

GetFocusColor()

This action returns the color of the focus line under the text. It is the owner's focus border color, which is the accent color, when the owner has one. Otherwise it is the label's own focus color.

Returns

Libraries.Game.Graphics.ColorGroup: The color used for the focus line.

IsShowingFocus()

This action returns whether the focus line under the text should show now. For a radio button, it follows the radio button's own choice focus, which is also on while it is the selected button in a focused group. For any other owner, it is on while the owner has the focus in a running game.

Returns

boolean: True if the focus line should show.

SetOwner(Libraries.Interface.Controls.Control choice)

This action sets the control whose focus this label shows.

Parameters

ShowsFocusIndicator()

This action returns whether this label draws a focus line under its text. It does once it belongs to a control, set with SetOwner.

Returns

boolean: True if the label has an owner whose focus it shows.

UsesFocusUnderline()

This action returns true, so this label shows its owner's focus as a line under its text instead of a box around it.

Returns

boolean: True, since the focus is shown as an underline.

Inherited Actions

53 actions from Libraries.Game.Graphics.Label
253 actions from Libraries.Interface.Controls.Control
59 actions from Libraries.Interface.Item
195 actions from Libraries.Interface.Item2D
3 actions from Libraries.Language.Object