Пример #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice device = graphics.GraphicsDevice;

            spriteBatch.Begin();
            // Draw texture
            spriteBatch.Draw(mapTexture, GraphicsDevice.Viewport.Bounds, Color.White);
            //spriteBatch.Draw(mapTexture, mapPosition, Color.White);
            foreach (TireMark tireMark in tireMarks)
            {
                tireMark.Draw(spriteBatch);
            }

            // Draw motors
            foreach (Motor motorek in motors)
            {
                motorek.Draw(spriteBatch);
            }

            //draw checkpoints
            DrawCheckpoints();

            spriteBatch.DrawString(fontArial10, winner.ToString(), new Vector2(graphics.GraphicsDevice.Viewport.Width / 3.3F, graphics.GraphicsDevice.Viewport.Height / 2.5F), Color.White);
            if (showFps)
            {
                fpsMonitor.Draw(spriteBatch, fontArial10, new Vector2(20, 20), Color.White);
            }

            spriteBatch.End();


            base.Draw(gameTime);
        }
Пример #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.WhiteSmoke);

            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

            switch (TileGrid.GameState)
            {
            case GameStates.Menu:
                menuManager.Draw(spriteBatch);
                bannerManager.Draw(spriteBatch, true);
                break;

            case GameStates.Lobby:
                menuManager.Draw(spriteBatch);
                networkingManager.Draw(spriteBatch);
                bannerManager.Draw(spriteBatch, true);
                break;

            case GameStates.QuitGame:
                menuManager.Draw(spriteBatch);
                tileManager.Draw(spriteBatch);
                TileGrid.Draw(spriteBatch);
                bannerManager.Draw(spriteBatch, false);
                animationManager.Draw(spriteBatch);
                break;

            case GameStates.Playing:
                tileManager.Draw(spriteBatch);
                TileGrid.Draw(spriteBatch);
                bannerManager.Draw(spriteBatch, false);
                animationManager.Draw(spriteBatch);
                break;
            }
            fpsMonitor.Draw(spriteBatch);

            spriteBatch.End();

            if (screenshotManager.NewShot)
            {
                screenshotManager.SaveScreenshot();
            }

            base.Draw(gameTime);
        }