# PendulumGame.PendulumHelpScreen Class Reference

This screen implements the game help. More...

Inheritance diagram for PendulumGame.PendulumHelpScreen:

List of all members.

## Public Member Functions
| PendulumHelpScreen (string[] screenMessage)
| Constructor of the screen.
override void | LoadContent ()
| Load graphics content for the game.
override void | UnloadContent ()
| Unload graphics content used by the screen.
override void | Update (GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
| Updates the state of the screen.
override void | HandleInput (InputState input)
| Lets the game respond to player input. Unlike the Update method, this will only be called when the gameplay screen is active.
override void | Draw (GameTime gameTime)
| Draws the gameplay screen.

## Detailed Description

This screen implements the game help.

Definition at line 24 of file PendulumHelpScreen.cs.

## Constructor & Destructor Documentation

PendulumGame.PendulumHelpScreen.PendulumHelpScreen | ( | string[] | screenMessage | ) |

Constructor of the screen.

Parameters:

  | screenMessage | The help message to display.

Definition at line 47 of file PendulumHelpScreen.cs.

    00048         {
    00049             // Store screen message
    00050             this.messages.AddRange(screenMessage);
    00051
    00052             // Add exit message
    00053             string[] exitMessage = { "", "", "[Key] or (Button) to return to Main Menu" };
    00054             this.messages.AddRange(exitMessage);
    00055
    00056             TransitionOnTime = TimeSpan.FromSeconds(0.5);
    00057             TransitionOffTime = TimeSpan.FromSeconds(0.5);
    00058         }

## Member Function Documentation

override void PendulumGame.PendulumHelpScreen.Draw | ( | GameTime | gameTime | ) | `[virtual]`

Draws the gameplay screen.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 142 of file PendulumHelpScreen.cs.

    00143         {
    00144             Color paneColor = new Color(4, 4, 4);
    00145             Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
    00146             Rectangle backgroundPane =
    00147                 new Rectangle(
    00148                     10, 10, viewport.Width - 20, viewport.Height - 20);
    00149             ScreenManager.SpriteBatch.Begin();
    00150             ScreenManager.SpriteBatch.Draw(this.paneTexture, backgroundPane, new Color(paneColor, 128));
    00151             ScreenManager.SpriteBatch.End();
    00152
    00153             // Draw messages
    00154             this.infoMessages.Draw(gameTime);
    00155
    00156             // If the game is transitioning on or off, fade it out to black.
    00157             if (TransitionPosition > 0)
    00158             {
    00159                 ScreenManager.FadeBackBufferToBlack(255 - TransitionAlpha);
    00160             }
    00161
    00162             base.Draw(gameTime);
    00163         }

override void PendulumGame.PendulumHelpScreen.HandleInput | ( | InputState | input | ) | `[virtual]`

Lets the game respond to player input. Unlike the Update method, this will only be called when the gameplay screen is active.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 115 of file PendulumHelpScreen.cs.

    00116         {
    00117             if (input == null)
    00118             {
    00119                 throw new ArgumentNullException("input");
    00120             }
    00121
    00122             if (input.IsInputCancel(null) || input.IsDisconnected(null))
    00123             {
    00124                 ScreenManager.AddScreen(new PendulumPauseMenuScreen(), null);
    00125             }
    00126             else
    00127             {
    00128                 PlayerIndex playerIndex;
    00129
    00130                 // Back to main menu
    00131                 if (input.IsMenuSelect(null, out playerIndex))
    00132                 {
    00133                     ScreenManager.RemoveScreen(this);
    00134                     ScreenManager.AddScreen(new PendulumMainMenuScreen(), null);
    00135                 }
    00136             }
    00137         }

override void PendulumGame.PendulumHelpScreen.LoadContent | ( |  | ) | `[virtual]`

Load graphics content for the game.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 63 of file PendulumHelpScreen.cs.

    00064         {
    00065             // Create message display object
    00066             Vector2 messagesOrigin = new Vector2(
    00067                 ScreenManager.GraphicsDevice.Viewport.Width * 0.05f,
    00068                 ScreenManager.GraphicsDevice.Viewport.Height * 0.05f);
    00069             this.infoMessages = new InfoMessages(
    00070                 this.ScreenManager,
    00071                 this.messages,
    00072                 messagesOrigin);
    00073             this.infoMessages.Scale = 0.5f;
    00074
    00075             // Reset game time
    00076             ScreenManager.Game.ResetElapsedTime();
    00077
    00078             // Create translucent pane rectangle
    00079             if (this.paneTexture == null)
    00080             {
    00081                 // New background texture
    00082                 this.paneTexture = TextureHelpers.Create(ScreenManager.GraphicsDevice, new Color(64, 64, 64));
    00083             }
    00084         }

override void PendulumGame.PendulumHelpScreen.UnloadContent | ( |  | ) | `[virtual]`

Unload graphics content used by the screen.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 89 of file PendulumHelpScreen.cs.

    00090         {
    00091         }

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

Updates the state of the screen.

Reimplemented from NewGamePhysics.StateManager.GameScreen.

Definition at line 100 of file PendulumHelpScreen.cs.

    00102         {
    00103             base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
    00104
    00105             if (IsActive)
    00106             {
    00107                 this.infoMessages.Update(gameTime);
    00108             }
    00109         }

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

- C:/Users/Andreas Schiffler/Desktop/SVN/NewGamePhysics/PendulumGame/Screens/PendulumHelpScreen.cs