public void Draw(SpriteBatch spriteBatch, GunLevelUnit gunLevel, GunExperienceUnit currentExperience, GunExperienceUnit levelExpereince) { levelSprite.Draw(spriteBatch, Units.TileToGame(LevelDrawX), DrawY); number.number = Convert.ToInt32(gunLevel); number.LoadNumber(); number.Draw(spriteBatch, LevelNumberDrawX, DrawY); experienceBarSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY); if (currentExperience < levelExpereince) { fillSprite.SetPercentageWidth((float)currentExperience / (float)levelExpereince); fillSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY); } else { maxSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY); } if (flashTimer.Active && flashTimer.CurrentTime.Ticks / FlashPeriod.Ticks % 2 == 0) { flashSprite.Draw(spriteBatch, ExperienceBarDrawX, DrawY); } }
public void Draw(SpriteBatch spriteBatch) { if (timer.Expired) { return; } if (type == NumberType.Damage) { NumberSprite number = NumberSprite.DamageNumber(Content, val); number.LoadNumber(); number.DrawCentered(spriteBatch, centerX, centerY + offsetY); } else { NumberSprite number = NumberSprite.ExperienceNumber(Content, val); number.LoadNumber(); number.DrawCentered(spriteBatch, centerX, centerY + offsetY); } }