Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CheckBox

Check box UI element

Hierarchy

Index

Properties

onCheckStateChanged

onCheckStateChanged: MulticastDelegate<(checkBox: this, player: Player, isChecked: boolean) => void>

Called when the check state changes.

param

The check box for which the state changed.

param

The player who initiated the change. undefined if the state was changed through setIsChecked.

param

The new check state of the check box.

Methods

getOwningObject

getParent

  • getParent(): Widget | undefined
  • Return the widget that contains this widget, for example a border that wraps a check box. Returns undefined if this object has no parent.

    Returns Widget | undefined

getText

  • getText(): string
  • Return the currently displayed text.

    Returns string

isChecked

  • isChecked(): boolean
  • Return whether the check box is currently checked

    Returns boolean

isEnabled

  • isEnabled(): boolean

setEnabled

  • setEnabled(enabled: boolean): Widget
  • Set whether the widget is enabled. When a widget is disabled, users can't interact with it and it is greyed out. When a widget that contains other widgets (like VerticalBox) is disabled, all its children behave as if disabled, too. By default, widgets are enabled.

    Parameters

    • enabled: boolean

      Whether to enable the widget.

    Returns Widget

setFontSize

  • Set the font size.

    Parameters

    • size: number

      The new font size. Default: 12

    Returns CheckBox

setIsChecked

  • setIsChecked(checked: boolean): CheckBox
  • Set whether the check box is currently checked

    Parameters

    • checked: boolean

      The new checked state

    Returns CheckBox

setText

  • Set the displayed text. Can include "\n" to indicate new lines.

    Parameters

    • text: string

      The new text

    Returns CheckBox