protected override void LoadContent() { spriteBatch = new ExtendedSpriteBatch(GraphicsDevice); smallFont = Content.Load <BitmapFont>("fonts/Small"); iconFont = Content.Load <BitmapFont>("fonts/Icons"); engine.SetNextMap(MAPNAME1); engine.SetNextPlayer("Hugentobler", PLAYERNAME2); engine.Start(); }
public void BeginFrame(ExtendedSpriteBatch batch) { BeginFrame(); this.batch = batch; game.GraphicsDevice.SetRenderTarget(view); this.batch.Begin(Microsoft.Xna.Framework.Graphics.SpriteSortMode.Deferred, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise); }
public void EndFrame(ExtendedSpriteBatch batch) { batch.End(); Microsoft.Xna.Framework.Rectangle dst = new Microsoft.Xna.Framework.Rectangle(0, 0, Width, Height); Microsoft.Xna.Framework.Rectangle src = new Microsoft.Xna.Framework.Rectangle(0, 0, view.Width, view.Height); game.GraphicsDevice.SetRenderTarget(null); batch.Begin(Microsoft.Xna.Framework.Graphics.SpriteSortMode.Immediate, Microsoft.Xna.Framework.Graphics.BlendState.Opaque); batch.Draw(view, dst, src, Microsoft.Xna.Framework.Color.White); batch.End(); this.batch = null; EndFrame(); }
public override void SetTarget(Texture tex) { var tx = tex.GetTexture(); Microsoft.Xna.Framework.Graphics.RenderTarget2D currentView = tx as Microsoft.Xna.Framework.Graphics.RenderTarget2D; batch = game.SpriteBatch; batch.End(); game.GraphicsDevice.SetRenderTarget(currentView); batch.Begin(Microsoft.Xna.Framework.Graphics.SpriteSortMode.Deferred, Microsoft.Xna.Framework.Graphics.BlendState.AlphaBlend, Microsoft.Xna.Framework.Graphics.SamplerState.PointClamp, Microsoft.Xna.Framework.Graphics.DepthStencilState.None, Microsoft.Xna.Framework.Graphics.RasterizerState.CullCounterClockwise); }