Пример #1
0
 public virtual void Draw(SpriteBatch spriteBatch)
 {
     if (Health > 0)
     {
         spriteBatch.Draw(img, drawRect, currentColor);
         spriteBatch.Draw(eyeImg, eyeRect, Color.White);
         if (HasShield)
         {
             spriteBatch.Draw(Utilities.AlienShieldImg, shieldRect, Color.White);
         }
         if (ShowHealthbar)
         {
             healthBar.Draw(spriteBatch, GameInfo.GetColorForAmount((int)Health, (int)healthBar.MaxValue),
                            Color.Transparent);
         }
         if (isMechAlien)
         {
             spriteBatch.Draw(mechImg, mechRect, Color.White);
         }
     }
     else
     {
         spriteBatch.Draw(img, drawRect, Color.White * alpha);
         spriteBatch.Draw(eyeImg, eyeRect, Color.White * alpha);
     }
 }
 public void Draw(SpriteBatch spriteBatch)
 {
     if (Firing)
     {
         spriteBatch.Draw(laserImg, laserRect, Color.DarkRed);
     }
     spriteBatch.Draw(img, new Rectangle(drawRect.X + xOffset, drawRect.Y + yOffset, drawRect.Width, drawRect.Height),
                      Color.White);
     healthBar.Draw(spriteBatch, GameInfo.GetColorForAmount(Health, INIT_HEALTH), Color.White);
 }
Пример #3
0
 public void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(bgImg, bgRect, Color.White);
     spriteBatch.DrawString(font, questText, questTextLoc, Color.White);
     progressBar.Draw(spriteBatch, Color.Lime, Color.White);
     closeButton.Draw(spriteBatch);
     skipButton.Draw(spriteBatch);
     spriteBatch.Draw(coinIcon, coinRect, Color.White);
     spriteBatch.DrawString(font, rewardString, rewardLoc, Color.Goldenrod);
 }
        public void Draw(SpriteBatch spriteBatch, User user)
        {
            sweeper.Draw(spriteBatch);
            spriteBatch.Draw(bgImg, bgTopRect, Color.Gray);
            spriteBatch.Draw(bgImg, bgBottomRect, GameInfo.Planet.GroundColor);
            sweeperButton.Draw(spriteBatch);
            rapidFireButton.Draw(spriteBatch);
            healthBar.Draw(spriteBatch, GameInfo.GetColorForAmount((int)healthBar.Value, (int)healthBar.MaxValue), Color.White);
            progressBar.Draw(spriteBatch, Color.RoyalBlue, Color.Transparent);
            for (int i = 0; i <= projImgs.Count - 1; i++)
            {
                if (projImgs[i] != null && projAmounts[i] > 0)
                {
                    spriteBatch.Draw(projImgs[i], projRects[i], Color.White);
                }
            }
            if (showingToolTip)
            {
                spriteBatch.Draw(bgImg, toolTipRect, Color.Gray);
                spriteBatch.DrawString(mediumFont, toolTip, toolTipLoc, Color.White);
            }
            Color usernameColor = Color.White;

            if (!(user.AvatarR == user.AvatarG && user.AvatarR == user.AvatarB &&
                  user.AvatarR <= 200))
            {
                // The above checks if all the username colors are equal (creating a gray shade that
                // is hard to see against the background).
                // However, shades above the value of 200 are allowed
                usernameColor = new Color(user.AvatarR, user.AvatarG, user.AvatarB);
            }
            spriteBatch.DrawString(bigFont, username, usernamePos, usernameColor);
            if (projAmounts[0] != 0)
            {
                // If the the first slot is empty, then they all are
                spriteBatch.Draw(highlightedImg, highlightedRect, Color.White);
            }
            for (int i = 0; i <= projImgs.Count - 1; i++)
            {
                // Draw the counts after the hightlight rectangle so that we can see them on selected projectiles
                if (projImgs[i] != null && projAmounts[i] > 0)
                {
                    spriteBatch.DrawString(mediumFont, projAmountStrings[i], projAmountPositions[i], Color.Black);
                }
            }
            DrawUserInfoDisplay(spriteBatch, user);
            DrawLives(spriteBatch, user, true);
        }
 public void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(img, drawRect, Color.White);
     healthBar.Draw(spriteBatch, Color.Lime, Color.Transparent);
 }