Пример #1
0
        public void Draw(SpriteBatch spriteBatch, Vector2 Position)
        {
            Rectangle sourceRectangle;
            
            Texture2D Texture = Texture2DStorage.GetBombSpriteSheet();

            if (currentFrame == 0)
            {
                sourceRectangle = new Rectangle(0, 0, 16, Texture.Height);
                destinationRectangle = new Rectangle((int)Position.X+10, (int)Position.Y-10, 40, 80);
            }
            else 
            {
                sourceRectangle = new Rectangle(16 + (Texture.Width - 16)/3*(currentFrame-1), 0, (Texture.Width - 16)/3, Texture.Height);
                destinationRectangle = new Rectangle((int)Position.X, (int)Position.Y, 60, 60);
            }

            
           





            spriteBatch.Draw(Texture, destinationRectangle, sourceRectangle, Color.White);//use Texture2DStorage class to load texture2D
        }
Пример #2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     if (exist)
     {
         GetSprite.Draw(Texture2DStorage.GetBombSpriteSheet(), spriteBatch, Position);
     }
 }