public void DrawGame() { GraphicsDevice.SetRenderTarget(rtBase); //GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, null, null, null, null, camera.get_transformation(GraphicsDevice)); //SpriteHandler.sprites["fall"].Draw(rand, spriteBatch, camera, new Vector2(0, 0), 1, 0, Vector2.Zero, Color.White, 1f, SpriteEffects.None); ////SpriteHandler.sprites["teste"].Draw(rand, spriteBatch, camera, new Vector2(40, 40), 1, 0, Vector2.Zero, Color.White, 1f, SpriteEffects.None); //SpriteHandler.sprites["teste"].Draw(rand, spriteBatch, camera, new Vector2(0, 0), 1, 0, Vector2.Zero, Color.White, 1f, SpriteEffects.None); //spriteBatch.Draw(cats, new Vector2(-400, -400), Color.White); //spriteBatch.Draw(ballTexture, ball.position, Color.White); SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position, 1f, 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); spriteBatch.End(); }
protected void DrawBlurSource() { GraphicsDevice.SetRenderTarget(rtBlurSource); GraphicsDevice.Clear(Color.Transparent); fx_textureToBlurSource.CurrentTechnique.Passes[0].Apply(); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, fx_textureToBlurSource, camera.get_transformation(GraphicsDevice)); SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position - ball.movement, GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, (int)ball.movementPrev.X, (int)ball.movementPrev.Y), 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); /* * SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position, GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 100, 120), 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); * SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position - new Vector2(0, 200), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 100, -120), 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); * SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position - new Vector2(200, 0), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, -100, 120), 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); * SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position - new Vector2(200, 200), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, -100, -120), 0f, Vector2.Zero, Color.White, 1f, SpriteEffects.None); */ //Draw a blur source //SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position, GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 50, 120), 0f, Vector2.Zero, GetBlurSourceParams(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 50, 120), 1f, SpriteEffects.None); //SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position + new Vector2(150 - SpriteHandler.sprites["teste"].width, -120 + SpriteHandler.sprites["teste"].height), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 150, -120), 0f, Vector2.Zero, GetBlurSourceParams(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 150, 120), 1f, SpriteEffects.None); //SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position + new Vector2(-150 + SpriteHandler.sprites["teste"].width, -120 + SpriteHandler.sprites["teste"].height), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, -150, -120), 0f, Vector2.Zero, GetBlurSourceParams(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 150, 120), 1f, SpriteEffects.None); //SpriteHandler.Draw("teste", rand, spriteBatch, camera, ball.position + new Vector2(-150 + SpriteHandler.sprites["teste"].width, 120 - SpriteHandler.sprites["teste"].height), GetBlurSourceScale(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, -150, 120), 0f, Vector2.Zero, GetBlurSourceParams(SpriteHandler.sprites["teste"].width, SpriteHandler.sprites["teste"].height, 150, 120), 1f, SpriteEffects.None); spriteBatch.End(); }