public void Draw(Batcher2D batcher, int x, int y) { if (_texture != null) { X = x - Width / 2; Y = y - Height / 2; batcher.SetBlendState(_checkerBlend.Value); batcher.SetStencil(_stencil.Value); batcher.Draw2D(_texture, X, Y, new Vector3(20, 1, 0)); batcher.SetBlendState(null); batcher.SetStencil(null); } }
public void Draw(Batcher2D batcher, int x, int y) { if (_texture != null) { X = x - Width / 2; Y = y - Height / 2; //batcher.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, new Vector4(0, 0, 0, 1), 0, 0); batcher.Begin(); batcher.SetStencil(_stencil.Value); //batcher.SetBlendState(_checkerBlend.Value); BlendState.AlphaBlend.ColorWriteChannels = ColorWriteChannels.Alpha; batcher.Draw2D(_texture, X, Y, Vector3.Zero); BlendState.AlphaBlend.ColorWriteChannels = ColorWriteChannels.All; //batcher.SetBlendState(null); batcher.SetStencil(null); batcher.End(); } }