Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ProvideUIElement()

UIElement Terraria.GameContent.Bestiary.FlavorTextBestiaryInfoElement.ProvideUIElement ( BestiaryUICollectionInfo info)
inline

Implements Terraria.GameContent.Bestiary.IBestiaryInfoElement.

Definition at line 19 of file FlavorTextBestiaryInfoElement.cs.

20 {
21 if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2)
22 {
23 return null;
24 }
25 UIPanel obj = new UIPanel(Main.Assets.Request<Texture2D>("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode)1), null, 12, 7)
26 {
27 Width = new StyleDimension(-11f, 1f),
28 Height = new StyleDimension(109f, 0f),
29 BackgroundColor = new Color(43, 56, 101),
30 BorderColor = Color.Transparent,
31 Left = new StyleDimension(3f, 0f),
32 PaddingLeft = 4f,
33 PaddingRight = 4f
34 };
35 UIText uIText = new UIText(Language.GetText(_key), 0.8f)
36 {
37 HAlign = 0f,
38 VAlign = 0f,
40 Height = StyleDimension.FromPixelsAndPercent(0f, 1f),
41 IsWrapped = true
42 };
43 AddDynamicResize(obj, uIText);
44 obj.Append(uIText);
45 return obj;
46 }
static LocalizedText GetText(string key)
Definition Language.cs:10
static Color Transparent
Definition Color.cs:76
static StyleDimension FromPixelsAndPercent(float pixels, float percent)

References Terraria.GameContent.Bestiary.FlavorTextBestiaryInfoElement._key, Terraria.GameContent.Bestiary.FlavorTextBestiaryInfoElement.AddDynamicResize(), Terraria.Main.Assets, Microsoft.Xna.Framework.Graphics.Color, Terraria.UI.StyleDimension.FromPixelsAndPercent(), Terraria.Localization.Language.GetText(), and Microsoft.Xna.Framework.Color.Transparent.