# MontyHallGame.MontyHallBackgroundScreen Class Reference

The background screen sits behind all the other menu screens. It draws a background image that remains fixed in place regardless of whatever transitions the screens on top of it may be doing. More...

Inheritance diagram for MontyHallGame.MontyHallBackgroundScreen:

List of all members.

## Public Member Functions
| MontyHallBackgroundScreen ()
| Constructor.
override void | LoadContent ()
| Loads graphics content for this screen. The background texture is quite big, so we use our own local ContentManager to load it. This allows us to unload before going from the menus into the game itself, wheras if we used the shared ContentManager provided by the Game class, the content would remain loaded forever.
override void | UnloadContent ()
| Unloads graphics content for this screen.
override void | Update (GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
| Updates the background screen. Unlike most screens, this should not transition off even if it has been covered by another screen: it is supposed to be covered, after all! This overload forces the coveredByOtherScreen parameter to false in order to stop the base Update method wanting to transition off.
override void | Draw (GameTime gameTime)
| Draws the background screen.

## Detailed Description

The background screen sits behind all the other menu screens. It draws a background image that remains fixed in place regardless of whatever transitions the screens on top of it may be doing.

Definition at line 21 of file MontyHallBackgroundScreen.cs.

## Constructor & Destructor Documentation

MontyHallGame.MontyHallBackgroundScreen.MontyHallBackgroundScreen | ( |  | ) |

Constructor.

Definition at line 36 of file MontyHallBackgroundScreen.cs.

    00037         {
    00038             TransitionOnTime = TimeSpan.FromSeconds(0.5);
    00039             TransitionOffTime = TimeSpan.FromSeconds(0.5);
    00040         }

## Member Function Documentation

override void MontyHallGame.MontyHallBackgroundScreen.Draw | ( | GameTime | gameTime | ) | `[virtual]`

Draws the background screen.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 92 of file MontyHallBackgroundScreen.cs.

    00093         {
    00094             SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
    00095             Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
    00096             Rectangle fullscreen = new Rectangle(0, 0, viewport.Width, viewport.Height);
    00097             byte fade = TransitionAlpha;
    00098
    00099             spriteBatch.Begin(SpriteBlendMode.None);
    00100
    00101             spriteBatch.Draw(backgroundTexture, fullscreen,
    00102                              new Color(fade, fade, fade));
    00103
    00104             spriteBatch.End();
    00105         }

override void MontyHallGame.MontyHallBackgroundScreen.LoadContent | ( |  | ) | `[virtual]`

Loads graphics content for this screen. The background texture is quite big, so we use our own local ContentManager to load it. This allows us to unload before going from the menus into the game itself, wheras if we used the shared ContentManager provided by the Game class, the content would remain loaded forever.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 50 of file MontyHallBackgroundScreen.cs.

    00051         {
    00052             if (content == null)
    00053             {
    00054                 content = new ContentManager(ScreenManager.Game.Services, "Content");
    00055             }
    00056
    00057             backgroundTexture = content.Load<Texture2D>(@"Sprites\background");
    00058         }

override void MontyHallGame.MontyHallBackgroundScreen.UnloadContent | ( |  | ) | `[virtual]`

Unloads graphics content for this screen.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 64 of file MontyHallBackgroundScreen.cs.

    00065         {
    00066             content.Unload();
    00067         }

override void MontyHallGame.MontyHallBackgroundScreen.Update | ( | GameTime | gameTime,
|  | bool | otherScreenHasFocus,
|  | bool | coveredByOtherScreen |
| ) |  |  | `[virtual]`

Updates the background screen. Unlike most screens, this should not transition off even if it has been covered by another screen: it is supposed to be covered, after all! This overload forces the coveredByOtherScreen parameter to false in order to stop the base Update method wanting to transition off.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 82 of file MontyHallBackgroundScreen.cs.

    00084         {
    00085             base.Update(gameTime, otherScreenHasFocus, false);
    00086         }

The documentation for this class was generated from the following file:

- C:/Users/Andreas Schiffler/Desktop/SVN/NewGamePhysics/MontyHallGame/Screens/MontyHallBackgroundScreen.cs