Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
UIResourcePackInfoButton.cs
Go to the documentation of this file.
4using Terraria.IO;
5using Terraria.UI;
6
8
10{
12
14
16
18 {
19 get
20 {
21 return _resourcePack;
22 }
23 set
24 {
25 _resourcePack = value;
26 }
27 }
28
29 public UIResourcePackInfoButton(T text, float textScale = 1f, bool large = false)
30 : base(text, textScale, large)
31 {
32 _BasePanelTexture = Main.Assets.Request<Texture2D>("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode)1);
33 _hoveredBorderTexture = Main.Assets.Request<Texture2D>("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode)1);
34 }
35
36 protected override void DrawSelf(SpriteBatch spriteBatch)
37 {
38 if (_drawPanel)
39 {
40 CalculatedStyle dimensions = GetDimensions();
41 int num = 10;
42 int num2 = 10;
43 Utils.DrawSplicedPanel(spriteBatch, _BasePanelTexture.Value, (int)dimensions.X, (int)dimensions.Y, (int)dimensions.Width, (int)dimensions.Height, num, num, num2, num2, Color.Lerp(Color.Black, _color, 0.8f) * 0.5f);
44 if (base.IsMouseHovering)
45 {
46 Utils.DrawSplicedPanel(spriteBatch, _hoveredBorderTexture.Value, (int)dimensions.X, (int)dimensions.Y, (int)dimensions.Width, (int)dimensions.Height, num, num, num2, num2, Color.White);
47 }
48 }
49 DrawText(spriteBatch);
50 }
51}
UIResourcePackInfoButton(T text, float textScale=1f, bool large=false)
void DrawText(SpriteBatch spriteBatch)
static IAssetRepository Assets
Definition Main.cs:209
CalculatedStyle GetDimensions()
Definition UIElement.cs:382
static void DrawSplicedPanel(SpriteBatch sb, Texture2D texture, int x, int y, int w, int h, int leftEnd, int rightEnd, int topEnd, int bottomEnd, Color c)
Definition Utils.cs:1964
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491