// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. using System; namespace FlaxEngine.GUI { /// /// Button control /// public class Button : ContainerControl { /// /// The default height fro the buttons. /// public const float DefaultHeight = 24.0f; /// /// True if button is being pressed (by mouse or touch). /// protected bool _isPressed; /// /// The font. /// protected FontReference _font; /// /// Button text property. /// [EditorOrder(10), Tooltip("The button label text.")] public string Text { get; set; } /// /// Gets or sets the font used to draw button text. /// [EditorDisplay("Style"), EditorOrder(2000)] public FontReference Font { get => _font; set => _font = value; } /// /// Gets or sets the custom material used to render the text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data. /// [EditorDisplay("Style"), EditorOrder(2000), Tooltip("Custom material used to render the text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.")] public MaterialBase TextMaterial { get; set; } /// /// Gets or sets the color used to draw button text. /// [EditorDisplay("Style"), EditorOrder(2000)] public Color TextColor; /// /// Event fired when user clicks on the button. /// public event Action Clicked; /// /// Event fired when user clicks on the button. /// public event Action