.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.UI Button ====== .. class:: Button A button that the user can click. Added to a :type:`Canvas` or a :type:`Panel`. | Base class: :type:`Control` .. container:: inherited-members .. rubric:: Inherited Members * From :type:`Control`: :prop:`Interactable `, :prop:`Color `, :prop:`Tooltip ` * From :type:`Object`: :prop:`RectTransform `, :prop:`LayoutElement `, :prop:`Visible `, :meth:`Remove ` .. property:: Text Text { get; } The text for the button. :Game Scenes: All .. property:: bool Clicked { get; set; } Whether the button has been clicked. :Game Scenes: All .. 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. .. property:: bool Pressed { get; } Whether the user is holding the button down right now. :Game Scenes: All .. 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; :prop:`Button.Clicked` reports each completed click instead.