Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Button

A UI button.

Hierarchy

Index

Properties

onClicked

onClicked: MulticastDelegate<(button: this, player: Player) => void>

Called when the button is clicked.

param

The button that was clicked

param

The player who clicked the button

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

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

  • setFontSize(size: number): Button
  • Set the font size.

    Parameters

    • size: number

      The new font size. Default: 12

    Returns Button

setText

  • setText(text: string): Button
  • Set the text of this button.

    Parameters

    • text: string

      The new text

    Returns Button