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

◆ DrawBareBonesBar()

static void Terraria.GameContent.UI.BigProgressBar.BigProgressBarHelper.DrawBareBonesBar ( SpriteBatch spriteBatch,
float lifePercent )
inlinestatic

Definition at line 12 of file BigProgressBarHelper.cs.

13 {
14 Rectangle rectangle = Utils.CenteredRectangle(Main.ScreenSize.ToVector2() * new Vector2(0.5f, 1f) + new Vector2(0f, -50f), new Vector2(400f, 20f));
15 Rectangle destinationRectangle = rectangle;
16 destinationRectangle.Inflate(2, 2);
17 Texture2D value = TextureAssets.MagicPixel.Value;
18 Rectangle value2 = new Rectangle(0, 0, 1, 1);
19 Rectangle destinationRectangle2 = rectangle;
20 destinationRectangle2.Width = (int)((float)destinationRectangle2.Width * lifePercent);
21 spriteBatch.Draw(value, destinationRectangle, value2, Color.White * 0.6f);
22 spriteBatch.Draw(value, rectangle, value2, Color.Black * 0.6f);
23 spriteBatch.Draw(value, destinationRectangle2, value2, Color.LimeGreen * 0.5f);
24 }
void Draw(Texture2D texture, Vector2 position, Color color)
void Inflate(int horizontalAmount, int verticalAmount)
Definition Rectangle.cs:84

References Microsoft.Xna.Framework.Color.Black, Terraria.Utils.CenteredRectangle(), Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Microsoft.Xna.Framework.Rectangle.Inflate(), Microsoft.Xna.Framework.Color.LimeGreen, Terraria.GameContent.TextureAssets.MagicPixel, Terraria.Main.ScreenSize, Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Color.White.