Пример #1
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (mouseDown)
     {
         SelectRectangle.Draw(spriteBatch, selectRectangle);
     }
 }
Пример #2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     _sprite.Draw(spriteBatch);
     if (_selected)
     {
         SelectRectangle.Draw(spriteBatch, _sprite.Rectangle);
     }
 }
Пример #3
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (_mouseDown)
     {
         //spriteBatch.Draw(_texture,_selectRectangle, new Color(255,255,255,180));
         SelectRectangle.Draw(spriteBatch, _selectRectangle);
     }
 }
Пример #4
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (information.HitPoints > 0)
            {
                if (selected)
                {
                    SelectRectangle.Draw(spriteBatch, new Rectangle(rectangle.X, rectangle.Y, width, height));
                }

                if (shoot && animations.currentAnimation == AnimationType.ATTACKING)
                {
                    if (information.Type == Util.Units.TROLL_AXETHROWER)
                    {
                        spriteBatch.Draw(missileTroll, missilePosition + new Vector2(15, 15), new Rectangle(5, 5, 19, 20), Color.White, angle, new Vector2(9.5f, 10), 1f, SpriteEffects.None, 0);
                    }
                    else if (information.Type == Util.Units.ELVEN_ARCHER)
                    {
                        spriteBatch.Draw(missileElven, missilePosition + new Vector2(15, 15), new Rectangle(19, 4, 3, 30), Color.White, angle, new Vector2(1.5f, 15), 1f, SpriteEffects.None, 0);
                    }
                }

                //SelectRectangle.DrawLine(spriteBatch, position, finalGoal);
            }

            if (workState != WorkigState.WORKING)
            {
                Color color = Color.White;
                //           if (managerUnits.index % 2 == 0)
                //               color = Color.Red;
                //           else if (managerUnits.index % 2 == 1)
                //color = Color.Blue;
                //else if (managerUnits.index == 2)
                //                color = Color.Green;
                //else if (managerUnits.index == 3)
                //color = Color.Yellow;

                if (information.HitPoints > 0 && information.HitPoints < information.HitPointsTotal)
                {
                    progress.Draw(spriteBatch);
                }

                if (animations.FlipX())
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, color, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
                }
                else if (animations.FlipY())
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, color, 0, Vector2.Zero, 1, SpriteEffects.FlipVertically, 0);
                }
                else
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, color);
                }
            }
        }
Пример #5
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if (selected)
            {
                SelectRectangle.Draw(spriteBatch, healthArea, Color.Yellow);
            }

            if (index > -1)
            {
                SelectRectangle.Draw(spriteBatch, managerUnits.units[index].rectangle, Color.YellowGreen);
            }
        }
Пример #6
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (isBuilding && !isPlaceSelected)
            {
                spriteBatch.Draw(texture[textureName], position, new Rectangle(animations.Last().x, animations.Last().y, animations.Last().width, animations.Last().height), Color.White);
            }
            else if ((isBuilding && isPlaceSelected && isStartBuilding) || isWorking)
            {
                Color color = Color.White;
                if (managerUnits != null)
                {
                    //              if (managerUnits.index % 2 == 0)
                    //                  color = Color.Red;
                    //              else if (managerUnits.index % 2 == 1)
                    //color = Color.Blue;
                    //else if (managerUnits.index == 2)
                    //	color = Color.Green;
                    //else if (managerUnits.index == 3)
                    //color = Color.Yellow;
                }

                if (information.HitPoints <= 0)
                {
                    color = Color.Black;
                }

                spriteBatch.Draw(texture[textureName], position, animations.rectangle, color);

                if ((progress.start && !progress.finish) || (progress.finish && information.HitPoints < information.HitPointsTotal))
                {
                    progress.Draw(spriteBatch);
                }
            }

            if (selected)
            {
                SelectRectangle.Draw(spriteBatch, rectangle);

                if (!unselected)
                {
                    SelectRectangle.DrawTarget(spriteBatch, new Rectangle(unitDestination.X * 32, unitDestination.Y * 32, 32, 32));
                }
            }
        }
Пример #7
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (isBuilding && !isPlaceSelected)
            {
                spriteBatch.Draw(texture, position, new Rectangle(animations.Last().x, animations.Last().y, animations.Last().width, animations.Last().height), Color.White);
            }
            else if ((isBuilding && isPlaceSelected && isStartBuilding) || isWorking)
            {
                spriteBatch.Draw(texture, position, animations.rectangle, Color.White);
            }

            if (selected)
            {
                SelectRectangle.Draw(spriteBatch, rectangle);

                if (!unselected)
                {
                    SelectRectangle.DrawTarget(spriteBatch, new Rectangle(target.X * 32, target.Y * 32, 32, 32));
                }
            }
        }
Пример #8
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            if (information.HitPoints > 0)
            {
                if (selected)
                {
                    SelectRectangle.Draw(spriteBatch, new Rectangle(rectangle.X, rectangle.Y, 32, 32));
                }

                if (shoot && animations.currentAnimation == AnimationType.ATTACKING)
                {
                    if (information.Type == Util.Units.TROLL_AXETHROWER)
                    {
                        spriteBatch.Draw(missileTroll, missilePosition + new Vector2(15, 15), new Rectangle(5, 5, 19, 20), Color.White, angle, new Vector2(9.5f, 10), 1f, SpriteEffects.None, 0);
                    }
                    else if (information.Type == Util.Units.ELVEN_ARCHER)
                    {
                        spriteBatch.Draw(missileElven, missilePosition + new Vector2(15, 15), new Rectangle(19, 4, 3, 30), Color.White, angle, new Vector2(1.5f, 15), 1f, SpriteEffects.None, 0);
                    }
                }
            }


            if (workState != WorkigState.WORKING)
            {
                if (animations.FlipX())
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipHorizontally, 0);
                }
                else if (animations.FlipY())
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, Color.White, 0, Vector2.Zero, 1, SpriteEffects.FlipVertically, 0);
                }
                else
                {
                    spriteBatch.Draw(texture[animations.currentAnimation], position, animations.rectangle, Color.White);
                }
            }
        }