Exemple #1
0
 /// <summary>
 /// Draw method
 /// </summary>
 /// <param name="timeSinceLastFrame">How long its been since the last time Draw was called</param>
 public void Draw(double timeSinceLastFrame)
 {
     try
     {
         mWorld.Draw(timeSinceLastFrame);
     }
     catch (Exception e)
     {
         mLogger.Warn("Error drawing world", e);
     }
 }
 public void Draw(SpriteBatch spriteBatch)
 {
     if (thisManager.IsHiddenWorld)
     {
         TreeNewBee.SuperMarioBros.Instance.GraphicsDevice.Clear(Color.Blue);
     }
     else
     {
         TreeNewBee.SuperMarioBros.Instance.GraphicsDevice.Clear(Color.CornflowerBlue);
     }
     world.Draw(spriteBatch);
 }
Exemple #3
0
 protected override void Render()
 {
     if (_gameState == MyExampleState.Game)
     {
         var view = Window.GetView();
         _world.Draw(Window);
         Window.SetView(view);
     }
     else
     {
         _menu.Draw(Window);
     }
 }
        /// <summary>
        /// Draws the gameplay screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            // This game has a blue background. Why? Because!
            ScreenManager.GraphicsDevice.Clear(ClearOptions.Target,
                                               Color.CornflowerBlue, 0, 0);

            // Our player and enemy are both actually just text strings.
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;

            spriteBatch.Begin();

            currentWorld.Draw(gameTime, spriteBatch);
            MainCharacter.Instance.Draw(gameTime, spriteBatch);

            spriteBatch.End();

            // If the game is transitioning on or off, fade it out to black.
            if (TransitionPosition > 0 || pauseAlpha > 0)
            {
                float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, pauseAlpha / 2);

                ScreenManager.FadeBackBufferToBlack(alpha);
            }
        }
 public void Draw(SpriteBatch spriteBatch)
 {
     TreeNewBee.SuperMarioBros.Instance.GraphicsDevice.Clear(Color.Blue);
     world.Draw(spriteBatch);
 }