Button#
- class Button#
A button that the user can click. Added to a
Canvasor aPanel.Base class:ControlInherited Members
From
Control:interactable,color,tooltipFrom
Object:rect_transform,layout_element,visible,remove()
- clicked#
Whether the button has been clicked.
- Attribute:
Can be read or written
- Return type:
bool
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.
- pressed#
Whether the user is holding the button down right now.
- Attribute:
Read-only, cannot be set
- Return type:
bool
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;
Button.clickedreports each completed click instead.