Button#

class UI.Button()#

A button that the user can click. Added to a UI.Canvas or a UI.Panel.

Base class: UI.Control
Button.getText()#

The text for the button.

Property:

Read-only, cannot be set

Return type:

UI.Text

Button.getClicked()#
Button.setClicked(value)#

Whether the button has been clicked.

Property:

Can be read or written

Return type:

boolean

Note

This property is set to true when the user clicks the button. A client script should reset the property to false in order to detect subsequent button presses.

Button.getPressed()#

Whether the user is holding the button down right now.

Property:

Read-only, cannot be set

Return type:

boolean

Note

True from the button being pressed until the pointer is released, however far it has moved by then. Polling this repeats an action for as long as the button is held, for nudging a value; UI.Button.getClicked() reports each completed click instead.