C# Class FarseerPhysics.Samples.ScreenSystem.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.
Show file Open project: tinco/Farseer-Physics Class Usage Examples

Public Methods

Method Description
CompareTo ( object obj ) : int
Draw ( ) : void

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

GetHeight ( ) : int

Queries how much space this menu entry requires.

GetWidth ( ) : int

Queries how wide the entry is, used for centering on the screen.

Initialize ( ) : void
InitializeEntries ( float hiddenX, float visibleX ) : void
InitializePosition ( float target, bool visible ) : void
IsExitItem ( ) : bool
IsSelectable ( ) : bool
MenuEntry ( MenuScreen menu, string text, EntryType type, GameScreen screen ) : System

Constructs a new menu entry with the specified text.

MenuEntry ( string text, PhysicsDemoScreen screen, Microsoft.Xna.Framework.Graphics.Texture2D preview ) : System

Constructs a new menu entry with the specified text.

Update ( bool isSelected, GameTime gameTime ) : void

Updates the menu entry.

Update ( bool isSelected, bool isHovered, GameTime gameTime ) : void

Updates the menu entry.

Method Details

CompareTo() public method

public CompareTo ( object obj ) : int
obj object
return int

Draw() public method

Draws the menu entry. This can be overridden to customize the appearance.
public Draw ( ) : void
return void

GetHeight() public method

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

GetWidth() public method

Queries how wide the entry is, used for centering on the screen.
public GetWidth ( ) : int
return int

Initialize() public method

public Initialize ( ) : void
return void

InitializeEntries() public static method

public static InitializeEntries ( float hiddenX, float visibleX ) : void
hiddenX float
visibleX float
return void

InitializePosition() public method

public InitializePosition ( float target, bool visible ) : void
target float
visible bool
return void

IsExitItem() public method

public IsExitItem ( ) : bool
return bool

IsSelectable() public method

public IsSelectable ( ) : bool
return bool

MenuEntry() public method

Constructs a new menu entry with the specified text.
public MenuEntry ( MenuScreen menu, string text, EntryType type, GameScreen screen ) : System
menu MenuScreen
text string
type EntryType
screen GameScreen
return System

MenuEntry() public method

Constructs a new menu entry with the specified text.
public MenuEntry ( string text, PhysicsDemoScreen screen, Microsoft.Xna.Framework.Graphics.Texture2D preview ) : System
text string
screen PhysicsDemoScreen
preview Microsoft.Xna.Framework.Graphics.Texture2D
return System

Update() public method

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

Update() public method

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