1 using Microsoft.Xna.Framework.Graphics;
2 using Terraria.GameContent.UI.Elements;
5 namespace Loot.UI.Common.Controls.Button
7 internal class GuiImageButton : GuiButton
9 public UIImageButton Button {
get; }
11 public delegate
void WhenClickedEvent(UIMouseEvent evt, UIElement listeningElement, UIImageButton btn);
12 public event WhenClickedEvent WhenClicked;
14 internal GuiImageButton(ButtonType buttonType, Texture2D texture) : base(buttonType)
16 Button =
new UIImageButton(texture);
17 Button.Width.Set(Width.Pixels, 0);
18 Button.Height.Set(Height.Pixels, 0);
19 Button.OnClick += (evt, element) => WhenClicked?.Invoke(evt, element, Button);