Example #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);


            // TODO: Add your drawing code here
            //UI


            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            terrain.Draw(GraphicsDevice, cam);
            foreach (ClsTank tank in tanks)
            {
                tank.DrawModel(cam);
            }

            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;

            spriteBatch.Begin();
            foreach (UIWidget widget in uiElements.Values)
            {
                widget.Draw(spriteBatch);
            }
            spriteBatch.End();

            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.BlendState        = BlendState.Opaque;
            base.Draw(gameTime);
        }