C# Класс ScreenManagement.Screens.MenuEntry

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
OnSelectEntry ( PlayerIndex playerIndex, MenuScreen screen ) : void

Method for raising the Selected event.

Описание методов

DoClick() публичный Метод

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
Результат void

Draw() публичный Метод

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
Результат void

GetHeight() публичный Метод

public GetHeight ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
Результат float

GetWidth() публичный Метод

public GetWidth ( SpriteFont font ) : float
font Microsoft.Xna.Framework.Graphics.SpriteFont
Результат float

MenuEntry() публичный Метод

Creates a new MenuEntry that displays some text.
public MenuEntry ( string text, EventHandler select ) : System
text string
select EventHandler
Результат System

MenuEntry() публичный Метод

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
Результат System

OnSelectEntry() защищенный Метод

Method for raising the Selected event.
protected OnSelectEntry ( PlayerIndex playerIndex, MenuScreen screen ) : void
playerIndex PlayerIndex
screen MenuScreen
Результат void

Update() публичный Метод

public Update ( MenuScreen screen, bool isSelected, GameTime gameTime ) : void
screen MenuScreen
isSelected bool
gameTime Microsoft.Xna.Framework.GameTime
Результат void