C# Class GameStateManagement.MenuEntry

Helper class represents a single entry in a MenuScreen. By default this just draws the entry text string, but it can be customized to display menu entries in different ways. This also provides an event that will be raised when the menu entry is selected.
ファイルを表示 Open project: GarethIW/LDEngine Class Usage Examples

Public Properties

Property Type Description
Position Vector2
bounds Microsoft.Xna.Framework.Rectangle
selectionFade float

Public Methods

Method Description
Click ( int x, int y ) : void
Draw ( MenuScreen screen, bool isSelected, GameTime gameTime ) : void

Draws the menu entry. This can be overridden to customize the appearance.

GetHeight ( MenuScreen screen ) : int

Queries how much space this menu entry requires.

Left ( ) : void
MenuEntry ( string text, bool isEnabled ) : System

Constructs a new menu entry with the specified text.

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

Updates the menu entry.

Protected Methods

Method Description
OnSelectEntry ( ) : void

Method for raising the Selected event.

Method Details

Click() public method

public Click ( int x, int y ) : void
x int
y int
return void

Draw() public method

Draws the menu entry. This can be overridden to customize the appearance.
public Draw ( MenuScreen screen, bool isSelected, GameTime gameTime ) : void
screen MenuScreen
isSelected bool
gameTime Microsoft.Xna.Framework.GameTime
return void

GetHeight() public method

Queries how much space this menu entry requires.
public GetHeight ( MenuScreen screen ) : int
screen MenuScreen
return int

Left() public method

public Left ( ) : void
return void

MenuEntry() public method

Constructs a new menu entry with the specified text.
public MenuEntry ( string text, bool isEnabled ) : System
text string
isEnabled bool
return System

OnSelectEntry() protected method

Method for raising the Selected event.
protected OnSelectEntry ( ) : void
return void

Right() public method

public Right ( ) : void
return void

Update() public method

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

Property Details

Position public_oe property

public Vector2 Position
return Vector2

bounds public_oe property

public Rectangle,Microsoft.Xna.Framework bounds
return Microsoft.Xna.Framework.Rectangle

selectionFade public_oe property

Tracks a fading selection effect on the entry.
The entries transition out of the selection effect when they are deselected.
public float selectionFade
return float