//-------- // D R A W //-------- protected override void Draw(GameTime gameTime) { GraphicsDevice.SetRenderTarget(MainTarget); GraphicsDevice.Clear(Color.TransparentBlack); quadBatch.Begin(tex, BlendState.AlphaBlend); quadBatch.DrawTail(tailRec, Color.White, mpos, bones, 1f); quadBatch.End(); // DRAW MAINTARGET TO BACKBUFFER GraphicsDevice.SetRenderTarget(null); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.LinearWrap, DepthStencilState.None, RasterizerState.CullNone); spriteBatch.Draw(MainTarget, desktopRect, Color.White); spriteBatch.End(); base.Draw(gameTime); }
// D R A W protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.TransparentBlack); quadBatch.Begin(tex, BlendState.NonPremultiplied); // draw character first quadBatch.Draw(pixel, screenpos - new Vector2(4, 4), new Vector2(0.5f, 0.5f), 9.5f, player_body.Rotation, Color.Red); // draw grass grassChain[0].Draw(gras1, 1.2f, 0f, 10f, 20f, rotate_base: true); grassChain[1].Draw(gras2, 1f, 0f, 0f, 30f, rotate_base: false); grassChain[2].Draw(gras3, 1.3f, 0f, 20f, 40f, rotate_base: true); // draw big grass as foreground quadBatch.Draw(BigGrass, new Vector2(300, 600 - 20), Color.White); quadBatch.End(); base.Draw(gameTime); }