Beispiel #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, SpriteEffects.None, 0f);
#if Debug
            RectClass.DrawBorder(Game1.pixel, spriteBatch, BoundingBox, 1, Color.Red, Color.Gray * 0.3f);
#endif
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Texture, Position, SourceRectangle, Color, Rotation, Origin, Scale, SpriteEffects.None, 0f);
#if debug
            RectClass.DrawBorder(Game1.pixel, spriteBatch, BoundingBox, 2, Color.Red, Color.Blue * 0.3f);
#endif
        }
Beispiel #3
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            foreach (Projectile item in this.projectiles)
            {
                item.Draw(spriteBatch);
            }
            spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, SpriteEffects.None, 0f);
#if debug
            RectClass.DrawBorder(Game1.pixel, spriteBatch, BoundingBox, 1, Color.Red, Color.Gray * 0.3f);
#endif
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            //spriteBatch.Draw(this.texture,new Rectangle((int)this.position.X,(int)this.position.Y,this.width,this.height),Color.Red);//1
            // spriteBatch.Draw(this.texture, this.position, Color.Purple);//2
            // spriteBatch.Draw(this.texture, new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), Color.Blue);//3
            // spriteBatch.Draw(this.texture, this.position, sourceRectangle, Color.Green);//4
            // spriteBatch.Draw(this.texture, new Rectangle((int)this.position.X, (int)this.position.Y, this.width, this.height), sourceRectangle, Color.Orange, rotation, origin, SpriteEffects.None, 0.0f);//5
            // spriteBatch.Draw(this.texture, position, sourceRectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0.0f);//6
            spriteBatch.Draw(this.texture, this.position, sourceRectangle, Color.White, rotation, origin, new Vector2(scale, scale), SpriteEffects.None, 0.0f);//7

#if Debug
            RectClass.DrawBorder(Game1.pixel, spriteBatch, Bounds, 1, Color.Red, Color.Gray * 0.5f);
#endif
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
#if debug
            RectClass.DrawBorder(Game1.pixel, spriteBatch, BoundingBox, 1, Color.Red, Color.Gray * 0.3f);
            //spriteBatch.DrawString(Game1.debugFont, damagePosition.ToString(), new Vector2(100, 100), Color.Black);
#endif
            #region Zombie draw
            if (alive)
            {
                #region Healthbar draw
                spriteBatch.Draw(Game1.HealthBar, new Rectangle((int)HealthBarPosition.X, (int)HealthBarPosition.Y, ZombieHealthBarWidthBackground, Game1.HealthBar.Height), Color.Black);
                spriteBatch.Draw(Game1.HealthBar, new Rectangle((int)HealthBarPosition.X, (int)HealthBarPosition.Y, ZombieHealthBarWidth, Game1.HealthBar.Height), Color.Red);
                #endregion
                spriteBatch.Draw(texture, bloodPosition, hitSourceRectangle, color, rotation, new Vector2(90, 40), scale, SpriteEffects.None, 0f);
                spriteBatch.Draw(texture, new Rectangle((int)this.position.X, (int)this.position.Y, (int)(WIDTH * scale), (int)(HEIGHT * scale)), sourceRectangle, Color.White, rotation, origin, SpriteEffects.None, 0f);
                if (displayingDamagePoints && Game1.ScreenSize.Contains((int)damagePosition.X, (int)damagePosition.Y))
                {
                    spriteBatch.DrawString(Game1.debugFont, DamageTaken.ToString(), this.DamagePosition, Color.Black, 0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0f);
                }
            }
            else if (!alive)
            {
                int     Dwidth  = 120;
                int     Dheight = 80;
                Vector2 Dorgin  = new Vector2(Dwidth / 2, Dheight / 2);

                spriteBatch.Draw(Game1.SSZombieDeathAnmation, new Rectangle((int)this.position.X, (int)this.position.Y, (int)(Dwidth * scale), (int)(Dheight * scale)),
                                 new Rectangle(DeathFrame * Dwidth, 0, Dwidth, Dheight),
                                 Color.White,
                                 rotation,
                                 Dorgin,
                                 SpriteEffects.None,
                                 0f);
            }
            #endregion
        }