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

◆ DrawSelf()

override void Terraria.GameContent.UI.Elements.UIGenProgressBar.DrawSelf ( SpriteBatch spriteBatch)
inlineprotectedvirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 54 of file UIGenProgressBar.cs.

55 {
57 {
58 bool flag = WorldGen.crimson;
59 if (WorldGen.drunkWorldGen && Main.rand.Next(2) == 0)
60 {
61 flag = !flag;
62 }
65 CalculatedStyle dimensions = GetDimensions();
66 int completedWidth = (int)(_visualOverallProgress * (float)_longBarWidth);
67 int completedWidth2 = (int)(_visualCurrentProgress * (float)_smallBarWidth);
68 Vector2 vector = new Vector2(dimensions.X, dimensions.Y);
69 Color color = default(Color);
70 color.PackedValue = (flag ? 4286836223u : 4283888223u);
71 DrawFilling2(spriteBatch, vector + new Vector2(20f, 40f), 16, completedWidth, _longBarWidth, color, Color.Lerp(color, Color.Black, 0.5f), new Color(48, 48, 48));
72 color.PackedValue = 4290947159u;
73 DrawFilling2(spriteBatch, vector + new Vector2(50f, 60f), 8, completedWidth2, _smallBarWidth, color, Color.Lerp(color, Color.Black, 0.5f), new Color(33, 33, 33));
75 r.X -= 8;
76 spriteBatch.Draw(flag ? _texOuterCrimson.Value : _texOuterCorrupt.Value, r.TopLeft(), Color.White);
77 spriteBatch.Draw(_texOuterLower.Value, r.TopLeft() + new Vector2(44f, 60f), Color.White);
78 }
79 }
void Draw(Texture2D texture, Vector2 position, Color color)
void DrawFilling2(SpriteBatch spritebatch, Vector2 topLeft, int height, int completedWidth, int totalWidth, Color filled, Color separator, Color empty)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Terraria.GameContent.UI.Elements.UIGenProgressBar._longBarWidth, Terraria.GameContent.UI.Elements.UIGenProgressBar._smallBarWidth, Terraria.GameContent.UI.Elements.UIGenProgressBar._targetCurrentProgress, Terraria.GameContent.UI.Elements.UIGenProgressBar._targetOverallProgress, Terraria.GameContent.UI.Elements.UIGenProgressBar._texOuterCorrupt, Terraria.GameContent.UI.Elements.UIGenProgressBar._texOuterCrimson, Terraria.GameContent.UI.Elements.UIGenProgressBar._texOuterLower, Terraria.GameContent.UI.Elements.UIGenProgressBar._visualCurrentProgress, Terraria.GameContent.UI.Elements.UIGenProgressBar._visualOverallProgress, Microsoft.Xna.Framework.Color.Black, Terraria.WorldGen.crimson, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.GameContent.UI.Elements.UIGenProgressBar.DrawFilling2(), Terraria.WorldGen.drunkWorldGen, Terraria.UI.UIElement.GetDimensions(), ReLogic.Content.Asset< T >.IsLoaded, Microsoft.Xna.Framework.Color.Lerp(), Terraria.Main.rand, Terraria.UI.CalculatedStyle.ToRectangle(), ReLogic.Content.Asset< T >.Value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, Terraria.UI.CalculatedStyle.X, and Terraria.UI.CalculatedStyle.Y.