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

◆ DrawInGame()

void Terraria.UI.InGamePopups.AchievementUnlockedPopup.DrawInGame ( SpriteBatch sb,
Vector2 bottomAnchorPosition )
inline

Implements Terraria.UI.IInGameNotification.

Definition at line 95 of file InGamePopups.cs.

96 {
97 float opacity = Opacity;
98 if (opacity > 0f)
99 {
100 float num = Scale * 1.1f;
101 Vector2 size = (FontAssets.ItemStack.Value.MeasureString(_title) + new Vector2(58f, 10f)) * num;
102 Rectangle r = Utils.CenteredRectangle(bottomAnchorPosition + new Vector2(0f, (0f - size.Y) * 0.5f), size);
103 Vector2 mouseScreen = Main.MouseScreen;
104 bool num2 = r.Contains(mouseScreen.ToPoint());
105 Utils.DrawInvBG(c: num2 ? (new Color(64, 109, 164) * 0.75f) : (new Color(64, 109, 164) * 0.5f), sb: sb, R: r);
106 float num3 = num * 0.3f;
107 Vector2 vector = r.Right() - Vector2.UnitX * num * (12f + num3 * (float)_achievementIconFrame.Width);
108 sb.Draw(_achievementTexture.Value, vector, _achievementIconFrame, Color.White * opacity, 0f, new Vector2(0f, _achievementIconFrame.Height / 2), num3, SpriteEffects.None, 0f);
109 sb.Draw(_achievementBorderTexture.Value, vector, null, Color.White * opacity, 0f, new Vector2(0f, _achievementIconFrame.Height / 2), num3, SpriteEffects.None, 0f);
110 Utils.DrawBorderString(color: new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor / 5, Main.mouseTextColor) * opacity, sb: sb, text: _title, pos: vector - Vector2.UnitX * 10f, scale: num * 0.9f, anchorx: 1f, anchory: 0.4f);
111 if (num2)
112 {
113 OnMouseOver();
114 }
115 }
116 }
void Draw(Texture2D texture, Vector2 position, Color color)
static Asset< DynamicSpriteFont > ItemStack
Definition FontAssets.cs:8
bool Contains(int x, int y)
Definition Rectangle.cs:92

References Terraria.UI.InGamePopups.AchievementUnlockedPopup._achievementBorderTexture, Terraria.UI.InGamePopups.AchievementUnlockedPopup._achievementIconFrame, Terraria.UI.InGamePopups.AchievementUnlockedPopup._achievementTexture, Terraria.UI.InGamePopups.AchievementUnlockedPopup._title, Terraria.Utils.CenteredRectangle(), Microsoft.Xna.Framework.Graphics.Color, Microsoft.Xna.Framework.Rectangle.Contains(), Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.Utils.DrawBorderString(), Terraria.Utils.DrawInvBG(), Microsoft.Xna.Framework.Rectangle.Height, Terraria.GameContent.FontAssets.ItemStack, Terraria.Main.MouseScreen, Terraria.Main.mouseTextColor, Terraria.UI.InGamePopups.AchievementUnlockedPopup.OnMouseOver(), Terraria.UI.InGamePopups.AchievementUnlockedPopup.Opacity, Microsoft.Xna.Framework.Rectangle.Right, Terraria.UI.InGamePopups.AchievementUnlockedPopup.Scale, ReLogic.Content.Asset< T >.Value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Rectangle.Width.