public virtual void Draw(SpriteBatch spriteBatch, Vector2 Position)
        {
            Rectangle sourceRectangle;


            if (currentFrame < 5)
            {
                sourceRectangle      = new Rectangle(0, 0, 96, 96);
                destinationRectangle = new Rectangle((int)GlobalDefinitions.Position.X, (int)GlobalDefinitions.Position.Y, 96, 96);
            }


            else
            {
                sourceRectangle      = new Rectangle(96, 0, 96, 96);
                destinationRectangle = new Rectangle((int)GlobalDefinitions.Position.X, (int)GlobalDefinitions.Position.Y, 96, 96);
            }

            spriteBatch.Draw(Texture2DStorage.GetDownMovingLinkSpriteSheet(), destinationRectangle, sourceRectangle, Color.White);//use Texture2DStorage class to load texture2D
        }
Beispiel #2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     GetSprite.Draw(Texture2DStorage.GetDownMovingLinkSpriteSheet(), spriteBatch, GlobalDefinitions.Position);
 }