예제 #1
0
파일: GUI.cs 프로젝트: GoodSky/game-nuggets
        public void Draw(SpriteBatch spriteBatch)
        {
            // Draw the Control ribbon
            spriteBatch.Draw(controlRibbon, new Rectangle(0, Game.GAME_HEIGHT, controlRibbon.Width, controlRibbon.Height), Color.White);

            // Draw the Info Box
            spriteBatch.Draw(infoBox, new Rectangle(9, 491, infoBox.Width, infoBox.Height), Color.White);
            if (infoText != null)
            {
                spriteBatch.DrawString(font, infoText, new Vector2(14, 496), Color.Black);
            }

            // Draw the Building Box
            spriteBatch.Draw(buildingBox, new Rectangle(234, 491, buildingBox.Width, buildingBox.Height), Color.White);
            //foreach (ImageButton b in buildboxButtons)
            for (int i = 0; i < 6; ++i)
            {
                buildboxButtons[i / 3, i % 3].Draw(spriteBatch);
            }
            buildboxArrays[ActiveMenu / 3, ActiveMenu % 3].Draw(spriteBatch);

            // Draw the Energy Box
            int energyX = 665;
            int energyY = 491;

            spriteBatch.Draw(energyBox, new Rectangle(energyX, energyY, energyBox.Width, energyBox.Height), Color.White);
            spriteBatch.DrawString(font, GameState.state.Energy.ToString(), new Vector2(energyX + 33, energyY + 24), Color.Black);

            spriteBatch.DrawString(font, "+" + GameState.state.EnergyGain.ToString(), new Vector2(energyX + 10, energyY + 50), Color.Green);
            spriteBatch.DrawString(font, "-" + GameState.state.EnergyLoss.ToString(), new Vector2(energyX + 65, energyY + 50), Color.Red);

            // Draw the Menu Button
            MenuButton.Draw(spriteBatch);
        }
예제 #2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            // Draw the Bottom Background Bar
            spriteBatch.Draw(BottomBar, new Rectangle(0, Game.GAME_HEIGHT - 15, BottomBar.Width, BottomBar.Height), Color.White);

            // Draw the Info Box
            if (infoTitle != null)
            {
                spriteBatch.DrawString(largeFont, infoTitle, new Vector2(10, 494), Color.Black);
            }

            if (infoText != null)
            {
                spriteBatch.DrawString(smallFont, infoText, new Vector2(10, 519), Color.Black);
            }

            // Draw the Evo Blocks Area
            Epoch1.Draw(spriteBatch);
            Epoch2.Draw(spriteBatch);
            Epoch3.Draw(spriteBatch);

            foreach (ImageButton ib in EvoButton)
            {
                if (ib != null)
                {
                    ib.Draw(spriteBatch);
                }
            }

            RemoveDNA.Draw(spriteBatch);

            // Draw the Energy Box
            spriteBatch.Draw(EnergyPointer, new Rectangle(590, 563, EnergyPointer.Width, EnergyPointer.Height), Color.White);

            spriteBatch.DrawString(smallFont, "Current Status:", new Vector2(510, 495), Color.Black);

            // These values are somewhat arbitrary
            int net = GameState.state.EnergyGain - GameState.state.EnergyLoss;

            if (net <= -5)
            {
                spriteBatch.DrawString(smallFont, "Dying", new Vector2(615, 495), Color.Red);
            }
            else if (net >= 5)
            {
                spriteBatch.DrawString(smallFont, "Growing", new Vector2(615, 495), Color.Green);
            }
            else
            {
                spriteBatch.DrawString(smallFont, "Stable", new Vector2(615, 495), Color.Black);
            }

            spriteBatch.DrawString(smallFont, "-" + GameState.state.EnergyLoss.ToString(), new Vector2(520, 526), Color.Red);
            spriteBatch.DrawString(smallFont, "+" + GameState.state.EnergyGain.ToString(), new Vector2(662, 526), Color.Green);

            // Draw the Menu Butons
            Options.Draw(spriteBatch);
            Quit.Draw(spriteBatch);
        }
예제 #3
0
        public override void DrawAfterEntities(SpriteBatch spritebatch)
        {
            spritebatch.Begin();

            button.Draw(spritebatch);

            spritebatch.End();
        }
예제 #4
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(screen, new Rectangle(0, 0, screen.Width, screen.Height), Color.White);

            if (!haveUserName)
            {
                return;
            }

            chatArea.Draw(spriteBatch);
            playerArea.Draw(spriteBatch);

            // ChallengeButton.Draw(spriteBatch);
            BackButton.Draw(spriteBatch);
        }