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

◆ DrawLifeBarText()

static void Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet.DrawLifeBarText ( SpriteBatch spriteBatch,
Vector2 topLeftAnchor )
inlinestaticprivate

Definition at line 166 of file HorizontalBarsPlayerResourcesDisplaySet.cs.

167 {
168 Vector2 vector = topLeftAnchor + new Vector2(130f, -20f);
169 Player localPlayer = Main.LocalPlayer;
170 Color color = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor);
171 string text = Lang.inter[0].Value + " " + localPlayer.statLifeMax2 + "/" + localPlayer.statLifeMax2;
172 Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(text);
173 DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[0].Value, vector + new Vector2((0f - vector2.X) * 0.5f, 0f), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f);
174 DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, localPlayer.statLife + "/" + localPlayer.statLifeMax2, vector + new Vector2(vector2.X * 0.5f, 0f), color, 0f, new Vector2(FontAssets.MouseText.Value.MeasureString(localPlayer.statLife + "/" + localPlayer.statLifeMax2).X, 0f), 1f, SpriteEffects.None, 0f);
175 }
static void DrawString(this SpriteBatch spriteBatch, DynamicSpriteFont spriteFont, string text, Vector2 position, Color color)

References Microsoft.Xna.Framework.Graphics.Color, ReLogic.Graphics.DynamicSpriteFontExtensionMethods.DrawString(), Terraria.Lang.inter, Terraria.Main.LocalPlayer, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.mouseTextColor, Terraria.Player.statLife, Terraria.Player.statLifeMax2, Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Vector2.X.

Referenced by Terraria.GameContent.UI.ResourceSets.HorizontalBarsPlayerResourcesDisplaySet.Draw().