Beispiel #1
0
 private void UpdateBuffer()
 {
     Draw.SetTarget(canvas);
     Engine.Instance.GraphicsDevice.Clear(Color.Transparent);
     Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone, null, Matrix.Identity);
     for (int x = -offsetX; x < canvas.Width; x += clipRect.Width)
     {
         for (int y = -offsetY; y < canvas.Height; y += clipRect.Height)
         {
             Draw.SpriteBatch.Draw(source.Texture2D, new Vector2(x, y), clipRect, Color.White);
         }
     }
     Draw.SpriteBatch.End();
 }
Beispiel #2
0
 public void Clear()
 {
     Draw.SetTarget(this);
     Draw.Clear();
     Engine.Instance.GraphicsDevice.SetRenderTarget(null);
 }
Beispiel #3
0
 public void BeginTiling(BlendState blendState, int offsetX, int offsetY)
 {
     Draw.SetTarget(Canvas);
     Engine.Instance.GraphicsDevice.Clear(Color.Transparent);
     Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, blendState, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone, null, Matrix.CreateTranslation(offsetX, offsetY, 0));
 }
Beispiel #4
0
 public void BeginTiling(BlendState blendState)
 {
     Draw.SetTarget(Canvas);
     Engine.Instance.GraphicsDevice.Clear(Color.Transparent);
     Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, blendState, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone);
 }