C# Class ScreenManagement.Screens.MenuEntry

Show file Open project: giladgray/XNA-ScreenManager Class Usage Examples

Public Methods

Method 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

Protected Methods

Method Description
OnSelectEntry ( PlayerIndex playerIndex, MenuScreen screen ) : void

Method for raising the Selected event.

Method Details

DoClick() public method

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
return void

Draw() public method

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
return void

GetHeight() public method

public GetHeight ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
return float

GetWidth() public method

public GetWidth ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
return float

MenuEntry() public method

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

MenuEntry() public method

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
return System

OnSelectEntry() protected method

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

Update() public method

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