Beispiel #1
0
        //----------------------------------------------------------------------
        public void Draw()
        {
            MenuScreen.Draw();

            if (mPopupStack.Count > 0)
            {
                PopupScreen.Draw();
            }
        }
 public override void Draw(GameTime gameTime)
 {
     spriteBatch.Begin();
     if (gameState == GameState.Menu)
     {
         menuScreen.Draw(spriteBatch);
     }
     else if (gameState == GameState.Play)
     {
         gameScreen.Draw(spriteBatch);
     }
     base.Draw(gameTime);
     spriteBatch.End();
 }
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            if (currentGameState == GameState.PLAY)
            {
                IsMouseVisible = false;
                // draw objects
                //spriteBatch.Begin();
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null,
                                  null, null, camera.transform);
                //testExMap.Draw(spriteBatch);
                base.Draw(gameTime);

                spriteBatch.End();
            }

            if (currentGameState == GameState.START)
            {
                //spriteBatch.Begin();
                splashScreen.Draw(gameTime);
                //spriteBatch.End();
            }

            if (currentGameState == GameState.MENU)
            {
                menuScreen.Draw(gameTime);
                IsMouseVisible = true;
            }

            if (currentGameState == GameState.PAUSE)
            {
                pauseScreen.Draw(gameTime);
            }

            if (currentGameState == GameState.WIN || currentGameState == GameState.LOSE)
            {
                endScreen.Draw(gameTime);
            }

            if (currentGameState == GameState.TUT)
            {
                tutScreen.Draw(gameTime);
            }

            //draw hud
            if (currentGameState == GameState.PLAY)
            {
                elements.Draw(spriteBatch);

                spriteBatch.Begin();
                if (objShow)
                {
                    if (gameObj == Objective.Scientist)
                    {
                        spriteBatch.DrawString(objFont, "objective: find the scientist",
                                               new Vector2(32, 32), Color.Black);
                    }
                    if (gameObj == Objective.Scientist2)
                    {
                        spriteBatch.DrawString(objFont, "objective: get back to the scientist",
                                               new Vector2(32, 32), Color.Black);
                    }
                    if (gameObj == Objective.Cure)
                    {
                        spriteBatch.DrawString(objFont, "objective: find the cure",
                                               new Vector2(32, 32), Color.Black);
                    }
                    if (gameObj == Objective.Bomb)
                    {
                        spriteBatch.DrawString(objFont, "objective: find and arm the bomb",
                                               new Vector2(32, 32), Color.Black);
                    }
                    if (gameObj == Objective.Helicopter1 || gameObj == Objective.Helicopter2)
                    {
                        spriteBatch.DrawString(objFont, "objective: get to the helicopter",
                                               new Vector2(32, 32), Color.Black);
                    }
                    if (gameObj == Objective.Elimination)
                    {
                        spriteBatch.DrawString(objFont, "objective: eliminate " + objEliminate + " hostiles",
                                               new Vector2(32, 32), Color.Black);
                    }
                }
                spriteBatch.End();
            }
        }
Beispiel #4
0
 public override void Draw(Gdk.Drawable d, Cairo.Context g, int width, int height, bool screenChanged)
 {
     _screen.Draw(d, g, width, height, screenChanged);
 }