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

◆ Draw()

override void Terraria.GameContent.UI.States.UIAchievementsMenu.Draw ( SpriteBatch spriteBatch)
inlinevirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 105 of file UIAchievementsMenu.cs.

106 {
107 base.Draw(spriteBatch);
108 for (int i = 0; i < _categoryButtons.Count; i++)
109 {
111 {
112 string text = "";
113 text = i switch
114 {
115 3 => Language.GetTextValue("Achievements.ChallengerCategory"),
116 1 => Language.GetTextValue("Achievements.CollectorCategory"),
117 2 => Language.GetTextValue("Achievements.ExplorerCategory"),
118 0 => Language.GetTextValue("Achievements.SlayerCategory"),
119 -1 => Language.GetTextValue("Achievements.NoCategory"),
120 _ => Language.GetTextValue("Achievements.NoCategory"),
121 };
122 float x = FontAssets.MouseText.Value.MeasureString(text).X;
123 Vector2 vector = new Vector2(Main.mouseX, Main.mouseY) + new Vector2(16f);
124 if (vector.Y > (float)(Main.screenHeight - 30))
125 {
126 vector.Y = Main.screenHeight - 30;
127 }
128 if (vector.X > (float)Main.screenWidth - x)
129 {
130 vector.X = Main.screenWidth - 460;
131 }
132 Utils.DrawBorderStringFourWay(spriteBatch, FontAssets.MouseText.Value, text, vector.X, vector.Y, new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor), Color.Black, Vector2.Zero);
133 break;
134 }
135 }
136 SetupGamepadPoints(spriteBatch);
137 }
static string GetTextValue(string key)
Definition Language.cs:15

References Terraria.GameContent.UI.States.UIAchievementsMenu._categoryButtons, Microsoft.Xna.Framework.Color.Black, System.Collections.Generic.List< T >.Count, Terraria.Utils.DrawBorderStringFourWay(), Terraria.Localization.Language.GetTextValue(), Terraria.UI.UIElement.IsMouseHovering, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseTextColor, Terraria.Main.mouseX, Terraria.Main.mouseY, Terraria.Main.screenHeight, Terraria.Main.screenWidth, Terraria.GameContent.UI.States.UIAchievementsMenu.SetupGamepadPoints(), Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Vector2.Zero.