Skip to content

Button

Deprecated

This element has been deprecated in favor of a Prefab-based solution. See GenericUI_Prefab_Button. The element continues to be available for backwards compatibility.

The GenericUI_Element_Button button element implements a typical button form element. It may be disabled (preventing user interaction) and will fire a contextual event if it is activated while not disabled.

GenericUI_Element_Button Class

Inherits from GenericUI_Element.

Methods

IsEnabled
function GenericUI_Element_Button:IsEnabled()
   -> boolean

Returns whether the button is enabled.

SetEnabled
function GenericUI_Element_Button:SetEnabled(enabled)

Sets the button's enabled state. Enabled buttons are interactable.

@param enabled boolean

SetText
function GenericUI_Element_Button:SetText(text, textY)

Sets the button's text.

@param text string

@param textY number? Vertical offset for the text. Use for centering.

SetType
function GenericUI_Element_Button:SetType(buttonType)

Sets the button's visuals.

@param buttonType GenericUI_Element_Button_Type