C# Класс PathfindingTest.UI.HUD

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

Открытые свойства

Свойство Тип Описание
color Color
hudTex Texture2D
miniMapTex Texture2D
player Player
sf SpriteFont

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

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

Приватные методы

Метод Описание
Draw ( SpriteBatch sb ) : void

Draws the HUD and the objects required.

LoadCommands ( ) : void

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

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

Count the different unit/building types selected. Checks what objects to load in the HUD.
public CountUnits ( ) : void
Результат void

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

Defines the space the minimap is using
public DefineMiniMapRectangle ( ) : Rectangle
Результат Microsoft.Xna.Framework.Rectangle

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

Defines the space the HUD is using.
public DefineRectangle ( ) : Rectangle
Результат Microsoft.Xna.Framework.Rectangle

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

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

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

public IncrementStartCommandXY ( float startX ) : void
startX float
Результат void

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

public IncrementStartObjectXY ( float startX ) : void
startX float
Результат void

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

Checks whether the mouse is hovering over an object on the HUD.
public IsMouseOverBuilding ( ) : Boolean
Результат Boolean

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

Used for creating units and buildings respectively.
public MouseClickListener ( MouseEvent me ) : void
me MouseEvent The MouseEvent to use
Результат void

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

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

Описание свойств

color публичное свойство

public Color color
Результат Color

hudTex публичное свойство

public Texture2D hudTex
Результат Texture2D

miniMapTex публичное свойство

public Texture2D miniMapTex
Результат Texture2D

player публичное свойство

public Player player
Результат Player

sf публичное свойство

public SpriteFont sf
Результат SpriteFont