Example #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(screen, new Rectangle(0, 0, screen.Width, screen.Height), Color.White);
            spriteBatch.DrawString(font, "Evolution:", new Vector2(65, 55), Color.ForestGreen);
            spriteBatch.DrawString(font, "Survival of the Fittest", new Vector2(65, 110), Color.LightGreen);

            SinglePlayer.Draw(spriteBatch);
            MultiPlayer.Draw(spriteBatch);
            QuitGame.Draw(spriteBatch);
        }
Example #2
0
        public void Draw()
        {
            if (!HasFrame)
            {
                return;
            }

            _subtractButton.Draw();
            _addButton.Draw();
            _text.Draw(KeyFrame.Duration.ToString(CultureInfo.InvariantCulture), _durationPosition);
        }
Example #3
0
        public override void Draw(GameTime gameTime, Point mousePos)
        {
            titleBox.Draw(gameTime, -1);
            Drawing.DrawHorizontalLine(titleBox.FilledBound.Bottom, Color.Gray, Bounds);

            mainArea.Draw(Color.Gray, Bounds);


            startButton.Draw(gameTime, mousePos);
            backButton.Draw(gameTime, mousePos);
        }
Example #4
0
 public void Render()
 {
     BaseGame.Device.Clear(Color.LightSkyBlue);
     spriteBatch = (SpriteBatch)BaseGame.SpriteMgr.alphaSprite;
     spriteBatch.Draw(bgTexture, Vector2.Zero, bgRect, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, LayerDepth.BackGround);
     roomList.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     rankList.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btnEnter.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btnCreate.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btnRank.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
 }
Example #5
0
 public void Render()
 {
     BaseGame.Device.Clear(Color.LightSkyBlue);
     spriteBatch = (SpriteBatch)BaseGame.SpriteMgr.alphaSprite;
     spriteBatch.Draw(bgTexture, Vector2.Zero, bgRect, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, LayerDepth.BackGround);
     spriteBatch.Draw(npTexture, new Vector2(230, 401), new Rectangle(0, 0, 88, 46), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0f);
     namebox.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     passbox.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btnLogin.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btnClear.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
 }
Example #6
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            var font      = Game.Content.Load <SpriteFont>("Fonts/Main");
            var titleFont = Game.Content.Load <SpriteFont>("Fonts/Scores");

            const int BUTTON_WIDTH  = 100;
            const int BUTTON_HEIGHT = 20;

            var logoSize = titleFont.MeasureString(TITLETEXT);

            _spriteBatch.DrawString(titleFont, TITLETEXT,
                                    new Vector2(Game.GraphicsDevice.Viewport.Bounds.Center.X - logoSize.X / 2, 100), Color.White);
            _spriteBatch.DrawString(font, "(demo)",
                                    new Vector2(Game.GraphicsDevice.Viewport.Bounds.Center.X - logoSize.X / 2 + logoSize.X, 100),
                                    Color.Wheat);

            _startButton.Title = UiResources.StartGameButtonTitle;
            _startButton.Rect  = new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2, 150,
                                               BUTTON_WIDTH, BUTTON_HEIGHT);
            _startButton.Draw(_spriteBatch);

            _switchLanguageButton.Title = UiResources.SwitchLanguagebuttonTitle;
            _switchLanguageButton.Rect  = new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2,
                                                        200, BUTTON_WIDTH, BUTTON_HEIGHT);
            _switchLanguageButton.Draw(_spriteBatch);

            _spriteBatch.DrawString(font, Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName,
                                    new Vector2(_switchLanguageButton.Rect.Right + 5, _switchLanguageButton.Rect.Top), Color.White);

            _switchResolutionButton.Title = UiResources.SwitchResolutionButtonTitle;
            _switchResolutionButton.Rect  =
                new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2, 250, BUTTON_WIDTH,
                              BUTTON_HEIGHT);
            _switchResolutionButton.Draw(_spriteBatch);

            _leaderBoardButton.Title = UiResources.LeaderBoardButtonTitle;
            _leaderBoardButton.Rect  = new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2,
                                                     300, BUTTON_WIDTH, BUTTON_HEIGHT);
            _leaderBoardButton.Draw(_spriteBatch);

            var graphicsManager = ((LivGame)Game).Graphics;

            _spriteBatch.DrawString(font,
                                    $"{graphicsManager.PreferredBackBufferWidth} x {graphicsManager.PreferredBackBufferHeight}",
                                    new Vector2(_switchResolutionButton.Rect.Right + 5, _switchResolutionButton.Rect.Top), Color.White);

            _spriteBatch.End();
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            var font = _uiContentStorage.GetButtonFont();

            _spriteBatch.DrawString(font, "Генерация мира", new Vector2(100, 100), Color.White);

            _generateButton.Draw(_spriteBatch);

            _spriteBatch.End();
        }
Example #8
0
        public void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();

            background.Draw(gameTime);
            banner.Draw(gameTime);

            play.Draw(gameTime);
            options.Draw(gameTime);
            help.Draw(gameTime);
            quit.Draw(gameTime);

            spriteBatch.DrawString(spriteFont, "Version: 1.0", new Vector2(690, 575), Color.White);

            spriteBatch.End();
        }
Example #9
0
        public void Render()
        {
            //nameList.Draw(BaseGame.SpriteMgr.alphaSprite, 1.0f);
            //scoreList.Draw(BaseGame.SpriteMgr.alphaSprite, 1.0f);
            //BaseGame.SpriteMgr.alphaSprite.Draw(bgTexture, new Rectangle(0, 0, 800, 600), null, Color.White, 0, new Vector2(0, 0), SpriteEffects.None, LayerDepth.BackGround);

            BaseGame.RenderEngine.FontMgr.DrawInScrnCoord("得分榜", new Vector2(270, 50), 3.0f, Color.Red, LayerDepth.UI, GameFonts.HDZB);


            for (int i = 0; i < names.Length; i++)
            {
                BaseGame.RenderEngine.FontMgr.DrawInScrnCoord(names[i], new Vector2(200, 200 + i * 30), 1.0f, colors[i], LayerDepth.UI, GameFonts.Comic);
                BaseGame.RenderEngine.FontMgr.DrawInScrnCoord(scores[i].ToString(), new Vector2(550, 200 + i * 30), 1.0f, colors[i], LayerDepth.UI, GameFonts.Comic);
            }
            btn.Draw(BaseGame.SpriteMgr.alphaSprite, 1.0f);
        }
Example #10
0
        public static void Draw(SpriteBatch spriteBatch)
        {
            //spriteBatch.Draw(background, new Rectangle(0, 0, AdamGame.UserResWidth, AdamGame.UserResHeight), Color.White);

            FontHelper.DrawWithOutline(spriteBatch, _font8, TMBAW_Game.Producers, new Vector2(5, 5), 3, Color.White, Color.Black);
            FontHelper.DrawWithOutline(spriteBatch, _font8, TMBAW_Game.Version, new Vector2(5, 20), 3, Color.White, Color.Black);


            string title = "There Must Be Another Way";

            FontHelper.DrawWithOutline(spriteBatch, FontHelper.Fonts[2], title, new Vector2(TMBAW_Game.UserResWidth / 2 - FontHelper.Fonts[2].MeasureString(title).X / 2, 120), 1, Color.White, Color.DarkGray);

            switch (CurrentMenuState)
            {
            case MenuState.Main:
                _chooseLevel.Draw(spriteBatch);
                _quit.Draw(spriteBatch);
                _options.Draw(spriteBatch);
                _multiplayer.Draw(spriteBatch);
                _storyModeButton.Draw(spriteBatch);
                break;

            case MenuState.StoryMode:
                SaveSelector.Draw(spriteBatch);
                break;

            case MenuState.LevelSelector:
                _levelSelection.Draw(spriteBatch);
                break;

            case MenuState.Options:
                if (!OptionsMenu.IsActive)
                {
                    CurrentMenuState = MenuState.Main;
                }
                break;

            case MenuState.MultiplayerLobby:
                Lobby.Draw(spriteBatch);
                break;

            case MenuState.MultiplayerSession:
                _startMultiplayerGame.Draw(spriteBatch);
                _backButton.Draw(spriteBatch);
                break;
            }
        }
Example #11
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            _startButton.Draw(_spriteBatch);
            _switchLanguageButton.Draw(_spriteBatch);

            var font = Game.Content.Load <SpriteFont>("Fonts/Main");

            _spriteBatch.DrawString(font, "Title", new Vector2(50, 100), Color.White);
            _spriteBatch.DrawString(font, Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName,
                                    new Vector2(150, 100), Color.White);

            _spriteBatch.End();
        }
Example #12
0
        /// <inheritdoc />
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            _goToMainMenu.Draw(_spriteBatch);

            _spriteBatch.DrawString(
                spriteFont: _uiContentStorage.GetMenuItemFont(),
                text: UiResources.LeaderboardMenuTitle,
                position: new Vector2(x: LEADERBOARD_MENU_TITLE_POSITION_X, y: LEADERBOARD_MENU_TITLE_POSITION_Y),
                color: Color.White);
            //TODO: draw table leader board
            //TODO: draw menu to add record to leader board table

            _spriteBatch.End();
        }
Example #13
0
        public void Render()
        {
            BaseGame.Device.Clear(Color.LightSkyBlue);
            spriteBatch = (SpriteBatch)BaseGame.SpriteMgr.alphaSprite;
            spriteBatch.Draw(bgTexture, Vector2.Zero, bgRect, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, LayerDepth.BackGround);
            spriteBatch.Draw(rlTexture, new Vector2(50, 102), new Rectangle(0, 0, 79, 18), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0f);
            spriteBatch.Draw(riTexture, new Vector2(300, 102), new Rectangle(0, 0, 145, 18), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0f);

            //roomList.Clear();
            roomList.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            rankList.Draw(BaseGame.SpriteMgr.alphaSprite, 1);

            btnEnter.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            btnCreate.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            btnRank.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            btnRefresh.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            if (bInRoom)
            {
                Monitor.Enter(heads);

                for (int i = 0; i < playerCount; i++)
                {
                    if (heads.Count >= i + 1)
                    {
                        spriteBatch.Draw(heads[i], new Vector2(334, 157 + i * 140), new Rectangle(0, 0, 70, 70), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, LayerDepth.UI - 0.1f);
                    }
                    BaseGame.FontMgr.DrawInScrnCoord("Name: " + userNames[i], new Vector2(335, 230 + i * 140), Control.fontScale, Color.Black, 0f, Control.fontName);
                    BaseGame.FontMgr.DrawInScrnCoord("Score: " + scores[i], new Vector2(335, 245 + i * 140), Control.fontScale, Color.Black, 0f, Control.fontName);
                    BaseGame.FontMgr.DrawInScrnCoord("Rank:  " + ranks[i], new Vector2(335, 260 + i * 140), Control.fontScale, Color.Black, 0f, Control.fontName);
                }
                Monitor.Exit(heads);
            }

            if (bInRoom)
            {
                if (bIsHost)
                {
                    btnStart.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
                }
                btnQuit.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
            }
        }
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            var font = _uiContentStorage.GetButtonFont();

            const string TITLE_TEXT    = "Генерация мира";
            var          titleTextSize = font.MeasureString(TITLE_TEXT);

            _spriteBatch.DrawString(font, TITLE_TEXT,
                                    new Vector2(Game.GraphicsDevice.Viewport.Bounds.Center.X - titleTextSize.X / 2, 100), Color.White);

            _generateButton.Rect = new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2, 150,
                                                 BUTTON_WIDTH, BUTTON_HEIGHT);
            _generateButton.Draw(_spriteBatch);

            _spriteBatch.End();
        }
        public override void Draw(GameTime gameTime, Point mousePos)
        {
            if (!delayTimer.IsRunning)
            {
                delayTimer.Start();
            }
            if (!totalTimer.IsRunning)
            {
                totalTimer.Start();
            }

            var speed          = progress / totalTimer.ElapsedMilliseconds;
            var msLeftEstimate = (1 - progress) / speed;

            if (speed > 0 && totalTimer.ElapsedMilliseconds > 500)
            {
                timeLeftSamples.Enqueue(msLeftEstimate / 1000);
            }
            while (timeLeftSamples.Count > 60 * 2.5f)
            {
                timeLeftSamples.Dequeue();
            }

            progressBar.FillColor = Color.RoyalBlue.Interpolate(Color.Red, delayTimer.ElapsedMilliseconds / 15000f);
            if (delayTimer.ElapsedMilliseconds > 600)
            {
                //Debug.WriteLine(delayTimer.ElapsedMilliseconds);
                SetProgressDisplay(Color.White.Interpolate(Color.Red, delayTimer.ElapsedMilliseconds / 10000f));
            }

            messageBox.Draw(gameTime, mousePos);
            progressBar.Draw(gameTime, mousePos);
            percentBox.Draw(gameTime, mousePos);
            timeLeftBox.Draw(gameTime, mousePos);
            currentTaskBox.Draw(gameTime, mousePos);
            cancelButton?.Draw(gameTime, mousePos);
        }
        /// <inheritdoc />
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            _spriteBatch.Begin();

            var scoresFont = _uiContentStorage.GetScoresFont();
            var titleSize  = scoresFont.MeasureString(UiResources.LeaderboardMenuTitle);

            _spriteBatch.DrawString(
                scoresFont,
                UiResources.LeaderboardMenuTitle,
                new Vector2(Game.GraphicsDevice.Viewport.Bounds.Center.X - titleSize.X / 2,
                            LEADERBOARD_MENU_TITLE_POSITION_Y),
                Color.White);

            _goToMainMenuButton.Rect = new Rectangle(Game.GraphicsDevice.Viewport.Bounds.Center.X - BUTTON_WIDTH / 2,
                                                     LEADERBOARD_MENU_TITLE_POSITION_Y + (int)titleSize.Y + 5, BUTTON_WIDTH, BUTTON_HEIGHT);
            _goToMainMenuButton.Draw(_spriteBatch);

            DrawScoreTable(_goToMainMenuButton.Rect.Bottom);

            _spriteBatch.End();
        }
Example #17
0
 public void Render()
 {
     BaseGame.Device.Clear(Color.LightSkyBlue);
     rulesList.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
     btn.Draw(BaseGame.SpriteMgr.alphaSprite, 1);
 }
Example #18
0
 public override void Draw(GameTime gameTime, SpriteBatch batch)
 {
     batch.Begin();
     cont.Draw(batch);
     batch.End();
 }
Example #19
0
 public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     Load.Draw(gameTime, spriteBatch);
     New.Draw(gameTime, spriteBatch);
 }
Example #20
0
 public void Render()
 {
     BaseGame.Device.Clear(Color.BurlyWood);
     aiList.Draw(BaseGame.SpriteMgr.alphaSprite, 1f);
     btn.Draw(BaseGame.SpriteMgr.alphaSprite, 1f);
 }
Example #21
0
 public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     LevelEditor.Draw(gameTime, spriteBatch);
     save.Draw(gameTime, spriteBatch);
     exit.Draw(gameTime, spriteBatch);
 }