コード例 #1
0
ファイル: Shop.cs プロジェクト: Dubzer/BloodSim
 public void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(backgound, backgroundRectangle, Color.White);
     card0.Draw(spriteBatch);
     card1.Draw(spriteBatch);
     card2.Draw(spriteBatch);
     spriteBatch.Draw(topTexture, topRectangle, Color.White);
     spriteBatch.DrawString(fontBold, "Магазин", new Vector2(10, 4), Color.Black);
     spriteBatch.DrawString(fontRegular, "У вас: " + money + "R", new Vector2(12, 48), Color.Black);
     InGameNotification.Draw(spriteBatch);
 }
コード例 #2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(new Color(123, 17, 17));
            spriteBatch.Begin();
            {
                switch (gameState)
                {
                case State.PauseMenu:
                    background.Draw(spriteBatch);
                    for (int i = 0; i < cellList.Count; i++)
                    {
                        cellList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < bacteriumList.Count; i++)
                    {
                        bacteriumList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < leikoList.Count; i++)
                    {
                        leikoList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < wallList.Count; i++)
                    {
                        wallList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < tromboList.Count; i++)
                    {
                        tromboList[i].Draw(spriteBatch);
                    }

                    pauseMenu.Draw(spriteBatch);
                    break;

                case State.Playing:
                    background.Draw(spriteBatch);
                    for (int i = 0; i < cellList.Count; i++)
                    {
                        cellList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < bacteriumList.Count; i++)
                    {
                        bacteriumList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < leikoList.Count; i++)
                    {
                        leikoList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < wallList.Count; i++)
                    {
                        wallList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < tromboList.Count; i++)
                    {
                        tromboList[i].Draw(spriteBatch);
                    }

                    hud.Draw(spriteBatch);
                    shopButton.Draw(spriteBatch);
                    pauseButton.Draw(spriteBatch);

                    ClearAll();
                    break;

                case State.Shop:
                    background.Draw(spriteBatch);
                    for (int i = 0; i < cellList.Count; i++)
                    {
                        cellList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < bacteriumList.Count; i++)
                    {
                        bacteriumList[i].Draw(spriteBatch);
                    }

                    for (int i = 0; i < leikoList.Count; i++)
                    {
                        leikoList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < wallList.Count; i++)
                    {
                        wallList[i].Draw(spriteBatch);
                    }
                    for (int i = 0; i < tromboList.Count; i++)
                    {
                        tromboList[i].Draw(spriteBatch);
                    }

                    shop.Draw(spriteBatch);
                    closeShopButton.Draw(spriteBatch);
                    break;

                case State.MainMenu:
                    mainMenu.Draw(spriteBatch);
                    break;

                case State.Defeat:
                    endMenu.Draw(spriteBatch);
                    break;

                case State.Victory:
                    endMenu.Draw(spriteBatch);
                    break;
                }
                InGameNotification.Draw(spriteBatch); //  Отрисовка уведомлений
                cursor.Draw(spriteBatch);             // Отрисовка курсора
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }