C# Class GameStateManagement.MenuScreen

Base class for screens that contain a menu of options. The user can move up and down to select an entry, or cancel to back out of the screen.
Inheritance: GameScreen
Afficher le fichier Open project: GarethIW/LDEngine Class Usage Examples

Méthodes publiques

Méthode Description
Draw ( GameTime gameTime ) : void

Draws the menu.

HandleInput ( InputState input ) : void

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

LoadContent ( ) : void
MenuScreen ( string menuTitle ) : System

Constructor.

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

Updates the menu.

Méthodes protégées

Méthode Description
GetMenuEntryHitBounds ( MenuEntry entry ) : Rectangle

Allows the screen to create the hit bounds for a particular menu entry.

OnCancel ( object sender, EventArgs e ) : void

Handler for when the user has cancelled the menu.

OnSelectEntry ( int entryIndex ) : 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 méthode

Draws the menu.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
Résultat void

GetMenuEntryHitBounds() protected méthode

Allows the screen to create the hit bounds for a particular menu entry.
protected GetMenuEntryHitBounds ( MenuEntry entry ) : Rectangle
entry MenuEntry
Résultat Microsoft.Xna.Framework.Rectangle

HandleInput() public méthode

Responds to user input, changing the selected entry and accepting or cancelling the menu.
public HandleInput ( InputState input ) : void
input InputState
Résultat void

LoadContent() public méthode

public LoadContent ( ) : void
Résultat void

MenuScreen() public méthode

Constructor.
public MenuScreen ( string menuTitle ) : System
menuTitle string
Résultat System

OnCancel() protected méthode

Handler for when the user has cancelled the menu.
protected OnCancel ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void

OnSelectEntry() protected méthode

Handler for when the user has chosen a menu entry.
protected OnSelectEntry ( int entryIndex ) : void
entryIndex int
Résultat void

UnloadContent() public méthode

public UnloadContent ( ) : void
Résultat void

Update() public méthode

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

UpdateMenuEntryLocations() protected méthode

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
Résultat void