Esempio n. 1
0
 public void DrawFrame()
 {
     if (CurrentAnimation != null)
     {
         if (Shader != null)
         {
             Game.SpriteBatch.End();
             Game.SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied);
             Shader.Apply();
         }
         Game.SpriteBatch.Draw(
             CurrentAnimation.SpriteSheet,
             new Vector2(Owner.Body.BoxCollider.X, Owner.Body.BoxCollider.Y) - CurrentAnimation.Offset,
             CurrentAnimation.GetDrawRect(_drawIndex),
             Color.White,
             0,
             Vector2.Zero,
             1f,
             Facing == Orientation.Right ? SpriteEffects.None : SpriteEffects.FlipHorizontally,
             LayerDepth
             );
         if (Shader != null)
         {
             Game.SpriteBatch.End();
             Game.SpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied);
         }
     }
 }