Пример #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            switch (GameStateManager.currentState.ToLower())
            {
            case "overworldstate":
                spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend, null, null, null, null, camera.GetTransformation());
                break;

            case "shooterstate":
            case "introsecondstate":
            case "planetstate":
            case "stationstate":
                spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend);
                break;

            default:
                spriteBatch.Begin();
                break;
            }

            stateManager.Draw(spriteBatch);
            missionManager.Draw(spriteBatch);
            tutorialManager.Draw(spriteBatch);

            if (!PopupHandler.TextBufferEmpty &&
                !ZoomMap.IsMapOn)
            {
                popupHandler.Draw(spriteBatch);
            }
            else if (ZoomMap.IsMapOn)
            {
                ZoomMap.DrawOverlay(spriteBatch, stateManager.overworldState.GetZoomObjects);
            }

            helper.Draw(spriteBatch);
            beaconMenu.Draw(spriteBatch);

            if (showFPS && !ZoomMap.IsMapOn && !stateManager.overworldState.IsBurnOutEndingActivated)
            {
                if (GameStateManager.currentState == "OverworldState")
                {
                    spriteBatch.DrawString(fontManager.GetFont(14), "Fps: " + fps.ToString(),
                                           new Vector2((camera.cameraPos.X + ScreenCenter.X) - fontManager.GetFont(14).MeasureString("Fps: " + fps.ToString()).X,
                                                       camera.cameraPos.Y - ScreenCenter.Y) + fontManager.FontOffset,
                                           fontManager.FontColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f);
                }
                else
                {
                    spriteBatch.DrawString(fontManager.GetFont(14), "Fps: " + fps.ToString(),
                                           new Vector2(Game1.ScreenSize.X - fontManager.GetFont(14).MeasureString("Fps: " + fps.ToString()).X,
                                                       0) + fontManager.FontOffset,
                                           fontManager.FontColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f);
                }
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }