C# Class ScreenManagement.Screens.MenuEntry

Afficher le fichier Open project: giladgray/XNA-ScreenManager Class Usage Examples

Méthodes publiques

Méthode Description
DoClick ( PlayerIndex playerIndex, MenuScreen screen ) : void

Performs the Selected event for this menu entry.

Draw ( SpriteBatch sb, SpriteFont font, Vector2 position, bool isSelected, GameTime gameTime ) : void

Draws the MenuEntry onto the given SpriteBatch using a specified font.

GetHeight ( SpriteFont font ) : float
GetWidth ( SpriteFont font ) : float
MenuEntry ( string text, EventHandler select ) : System

Creates a new MenuEntry that displays some text.

MenuEntry ( string text, Microsoft.Xna.Framework.Graphics.Texture2D background, EventHandler select ) : System

Creates a new MenuEntry that displays text centered on a background texture.

Update ( MenuScreen screen, bool isSelected, GameTime gameTime ) : void

Méthodes protégées

Méthode Description
OnSelectEntry ( PlayerIndex playerIndex, MenuScreen screen ) : void

Method for raising the Selected event.

Method Details

DoClick() public méthode

Performs the Selected event for this menu entry.
public DoClick ( PlayerIndex playerIndex, MenuScreen screen ) : void
playerIndex PlayerIndex index of the player who initiated the action
screen MenuScreen
Résultat void

Draw() public méthode

Draws the MenuEntry onto the given SpriteBatch using a specified font.
public Draw ( SpriteBatch sb, SpriteFont font, Vector2 position, bool isSelected, GameTime gameTime ) : void
sb Microsoft.Xna.Framework.Graphics.SpriteBatch SpriteBatch to draw MenuEntry onto
font Microsoft.Xna.Framework.Graphics.SpriteFont font for menu entry text
position Vector2 coordinates of center of MenuEntry
isSelected bool whether the entry is currently selected in the menu
gameTime Microsoft.Xna.Framework.GameTime snapshot of current game timing
Résultat void

GetHeight() public méthode

public GetHeight ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
Résultat float

GetWidth() public méthode

public GetWidth ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
Résultat float

MenuEntry() public méthode

Creates a new MenuEntry that displays some text.
public MenuEntry ( string text, EventHandler select ) : System
text string
select EventHandler
Résultat System

MenuEntry() public méthode

Creates a new MenuEntry that displays text centered on a background texture.
public MenuEntry ( string text, Microsoft.Xna.Framework.Graphics.Texture2D background, EventHandler select ) : System
text string
background Microsoft.Xna.Framework.Graphics.Texture2D
select EventHandler
Résultat System

OnSelectEntry() protected méthode

Method for raising the Selected event.
protected OnSelectEntry ( PlayerIndex playerIndex, MenuScreen screen ) : void
playerIndex PlayerIndex
screen MenuScreen
Résultat void

Update() public méthode

public Update ( MenuScreen screen, bool isSelected, GameTime gameTime ) : void
screen MenuScreen
isSelected bool
gameTime Microsoft.Xna.Framework.GameTime
Résultat void