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.
Afficher le fichier Open project: tinco/Farseer-Physics Class Usage Examples

Méthodes publiques

Méthode 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 méthode

public CompareTo ( object obj ) : int
obj object
Résultat int

Draw() public méthode

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

GetHeight() public méthode

Queries how much space this menu entry requires.
public GetHeight ( ) : int
Résultat int

GetWidth() public méthode

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

Initialize() public méthode

public Initialize ( ) : void
Résultat void

InitializeEntries() public static méthode

public static InitializeEntries ( float hiddenX, float visibleX ) : void
hiddenX float
visibleX float
Résultat void

InitializePosition() public méthode

public InitializePosition ( float target, bool visible ) : void
target float
visible bool
Résultat void

IsExitItem() public méthode

public IsExitItem ( ) : bool
Résultat bool

IsSelectable() public méthode

public IsSelectable ( ) : bool
Résultat bool

MenuEntry() public méthode

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
Résultat System

MenuEntry() public méthode

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
Résultat System

Update() public méthode

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

Update() public méthode

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