C# Class PathfindingTest.UI.HUD

Inheritance: MouseClickListener
Afficher le fichier Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Méthodes publiques

Свойство Type Description
color Color
hudTex Texture2D
miniMapTex Texture2D
player Player
sf SpriteFont

Méthodes publiques

Méthode Description
CountUnits ( ) : void

Count the different unit/building types selected. Checks what objects to load in the HUD.

DefineMiniMapRectangle ( ) : Rectangle

Defines the space the minimap is using

DefineRectangle ( ) : Rectangle

Defines the space the HUD is using.

HUD ( Player p, Color c ) : System

Sets the textures to use for the HUD. Creates new instances of needed components. Sets variables to their default values.

IncrementStartCommandXY ( float startX ) : void
IncrementStartObjectXY ( float startX ) : void
IsMouseOverBuilding ( ) : Boolean

Checks whether the mouse is hovering over an object on the HUD.

MouseClickListener ( MouseEvent me ) : void

Used for creating units and buildings respectively.

Update ( KeyboardState ks, MouseState ms ) : void

Checks whether the HUD should be hidden or not. (if the player this HUD belongs to is not the player that is watching) Loads the objects to display according to selected units/buildings.

Private Methods

Méthode Description
Draw ( SpriteBatch sb ) : void

Draws the HUD and the objects required.

LoadCommands ( ) : void

Method Details

CountUnits() public méthode

Count the different unit/building types selected. Checks what objects to load in the HUD.
public CountUnits ( ) : void
Résultat void

DefineMiniMapRectangle() public méthode

Defines the space the minimap is using
public DefineMiniMapRectangle ( ) : Rectangle
Résultat Microsoft.Xna.Framework.Rectangle

DefineRectangle() public méthode

Defines the space the HUD is using.
public DefineRectangle ( ) : Rectangle
Résultat Microsoft.Xna.Framework.Rectangle

HUD() public méthode

Sets the textures to use for the HUD. Creates new instances of needed components. Sets variables to their default values.
public HUD ( Player p, Color c ) : System
p PathfindingTest.Players.Player The player this HUD belongs to
c Color The desired color for this HUD
Résultat System

IncrementStartCommandXY() public méthode

public IncrementStartCommandXY ( float startX ) : void
startX float
Résultat void

IncrementStartObjectXY() public méthode

public IncrementStartObjectXY ( float startX ) : void
startX float
Résultat void

IsMouseOverBuilding() public méthode

Checks whether the mouse is hovering over an object on the HUD.
public IsMouseOverBuilding ( ) : Boolean
Résultat Boolean

MouseClickListener() public méthode

Used for creating units and buildings respectively.
public MouseClickListener ( MouseEvent me ) : void
me MouseEvent The MouseEvent to use
Résultat void

Update() public méthode

Checks whether the HUD should be hidden or not. (if the player this HUD belongs to is not the player that is watching) Loads the objects to display according to selected units/buildings.
public Update ( KeyboardState ks, MouseState ms ) : void
ks KeyboardState Default KeyboardState
ms MouseState Default MouseState
Résultat void

Property Details

color public_oe property

public Color color
Résultat Color

hudTex public_oe property

public Texture2D hudTex
Résultat Texture2D

miniMapTex public_oe property

public Texture2D miniMapTex
Résultat Texture2D

player public_oe property

public Player player
Résultat Player

sf public_oe property

public SpriteFont sf
Résultat SpriteFont