using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace MonoGame.Extended.NuclexGui.Controls.Desktop { public class GuiButtonControl : GuiPressableControl { /// Text that will be shown on the button public string Text; public Texture2D Texture; public Rectangle SourceRectangle; /// Will be triggered when the button is pressed public event EventHandler Pressed; /// Called when the button is pressed protected override void OnPressed() { if (Pressed != null) Pressed(this, EventArgs.Empty); } public GuiButtonControl() : base() { SourceRectangle = new Rectangle(); } } }