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(); }
public void Clear() { Draw.SetTarget(this); Draw.Clear(); Engine.Instance.GraphicsDevice.SetRenderTarget(null); }
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)); }
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); }