Hi guys.
I am Currently Trying to Draw a health bar.
I am Drawing a Sprite(Consisting of a Black Rectangle with grey Background) at given co-ordinates, The i Draw another Sprite(simply a red Rectangle) onto this sprite. This works fine. However :
//the Rectangle that holds the full bar
Rectangle rHealth = new Rectangle(531, 200, 55, 14);
//the Rectangle that keeps track of health level
Rectangle rCurHealth = new Rectangle(531, 200, (55/ myTurret.MaxHealth)*myTurret.Health, 14);
spriteBatch.Draw(tHealthbarh, rHealth, rCurHealth, Color.White);
I was Aiming to Draw this By specify that only a Certain amount of the Red Rectangle Should be Drawn as the health Decreases.
the Question is : "Is
spriteBatch.Draw(tHealthbarh, rHealth, rCurHealth, Color.White);
the right spriteBatch.Draw(); function to use as this doesnt seems to redraw the Rectangle