C# Class PrinceGame.MenuScreen

Inheritance: GameScreen
Mostra file Open project: salvadorc17/Prince-Monogame Class Usage Examples

Public Methods

Method Description
Draw ( GameTime gameTime ) : void

Draws the menu.

HandleInput ( GameTime gameTime, InputState input ) : void

Responds to user input, changing the selected entry and accepting or cancelling the menu.

MenuScreen ( string menuTitle ) : System

Constructor.

Update ( GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen ) : void

Updates the menu.

Protected Methods

Method Description
OnCancel ( PlayerIndex playerIndex ) : void

Handler for when the user has cancelled the menu.

OnCancel ( object sender, PlayerIndexEventArgs e ) : void

Helper overload makes it easy to use OnCancel as a MenuEntry event handler.

OnSelectEntry ( int entryIndex, PlayerIndex playerIndex ) : void

Handler for when the user has chosen a menu entry.

UpdateMenuEntryLocations ( ) : void

Allows the screen the chance to position the menu entries. By default all menu entries are lined up in a vertical list, centered on the screen.

Method Details

Draw() public method

Draws the menu.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

HandleInput() public method

Responds to user input, changing the selected entry and accepting or cancelling the menu.
public HandleInput ( GameTime gameTime, InputState input ) : void
gameTime Microsoft.Xna.Framework.GameTime
input InputState
return void

MenuScreen() public method

Constructor.
public MenuScreen ( string menuTitle ) : System
menuTitle string
return System

OnCancel() protected method

Handler for when the user has cancelled the menu.
protected OnCancel ( PlayerIndex playerIndex ) : void
playerIndex PlayerIndex
return void

OnCancel() protected method

Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
protected OnCancel ( object sender, PlayerIndexEventArgs e ) : void
sender object
e PlayerIndexEventArgs
return void

OnSelectEntry() protected method

Handler for when the user has chosen a menu entry.
protected OnSelectEntry ( int entryIndex, PlayerIndex playerIndex ) : void
entryIndex int
playerIndex PlayerIndex
return void

Update() public method

Updates the menu.
public Update ( GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen ) : void
gameTime Microsoft.Xna.Framework.GameTime
otherScreenHasFocus bool
coveredByOtherScreen bool
return void

UpdateMenuEntryLocations() protected method

Allows the screen the chance to position the menu entries. By default all menu entries are lined up in a vertical list, centered on the screen.
protected UpdateMenuEntryLocations ( ) : void
return void