C# Class PantheonPrototype.HUD

This is the wrapper class for all information that will go into the HUD. It will have HUDItems in it, thad can be added at will and drawn all at once.
Exibir arquivo Open project: Bacon41/PantheonPrototype Class Usage Examples

Protected Properties

Property Type Description
HUDcoords Vector2
SCREEN_HEIGHT int
SCREEN_WIDTH int
background Microsoft.Xna.Framework.Graphics.Texture2D
backing Microsoft.Xna.Framework.Graphics.Texture2D
danger int
font Microsoft.Xna.Framework.Graphics.SpriteFont
graphicsDevice GraphicsDevice
hudItems List

Public Methods

Method Description
AddItem ( String img, int x, int y, Microsoft.Xna.Framework.Content.ContentManager content ) : void

This is the method to add more items to the HUD. Accepts a string that defines an image in the preloaded content, X and Y HUD coordinates, and a content manager.

AddItem ( String text, int x, int y, SpriteFont font ) : void

An overload funtion to just draw a string instead of an image. Accepts a string that defines an image in the preloaded content and X and Y HUD coordinates.

Draw ( SpriteBatch spriteBatch, SpriteFont font ) : void

The method to draw all of the different HUDItems.

HUD ( GraphicsDevice graphicsDevice, Microsoft.Xna.Framework.Content.ContentManager Content, int WIDTH, int HEIGHT, SpriteFont font ) : System
Update ( GameTime gameTime, Pantheon gameReference, Level level ) : void

The method to update all of the HUDItems' information.

Method Details

AddItem() public method

This is the method to add more items to the HUD. Accepts a string that defines an image in the preloaded content, X and Y HUD coordinates, and a content manager.
public AddItem ( String img, int x, int y, Microsoft.Xna.Framework.Content.ContentManager content ) : void
img String
x int
y int
content Microsoft.Xna.Framework.Content.ContentManager
return void

AddItem() public method

An overload funtion to just draw a string instead of an image. Accepts a string that defines an image in the preloaded content and X and Y HUD coordinates.
public AddItem ( String text, int x, int y, SpriteFont font ) : void
text String
x int
y int
font Microsoft.Xna.Framework.Graphics.SpriteFont
return void

Draw() public method

The method to draw all of the different HUDItems.
public Draw ( SpriteBatch spriteBatch, SpriteFont font ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The object that we will use to draw to the screen.
font Microsoft.Xna.Framework.Graphics.SpriteFont
return void

HUD() public method

public HUD ( GraphicsDevice graphicsDevice, Microsoft.Xna.Framework.Content.ContentManager Content, int WIDTH, int HEIGHT, SpriteFont font ) : System
graphicsDevice GraphicsDevice
Content Microsoft.Xna.Framework.Content.ContentManager
WIDTH int
HEIGHT int
font Microsoft.Xna.Framework.Graphics.SpriteFont
return System

Update() public method

The method to update all of the HUDItems' information.
public Update ( GameTime gameTime, Pantheon gameReference, Level level ) : void
gameTime Microsoft.Xna.Framework.GameTime The object that holds all the time information.
gameReference Pantheon
level Level
return void

Property Details

HUDcoords protected_oe property

protected Vector2 HUDcoords
return Vector2

SCREEN_HEIGHT protected_oe property

protected int SCREEN_HEIGHT
return int

SCREEN_WIDTH protected_oe property

protected int SCREEN_WIDTH
return int

background protected_oe property

protected Texture2D,Microsoft.Xna.Framework.Graphics background
return Microsoft.Xna.Framework.Graphics.Texture2D

backing protected_oe property

protected Texture2D,Microsoft.Xna.Framework.Graphics backing
return Microsoft.Xna.Framework.Graphics.Texture2D

danger protected_oe property

protected int danger
return int

font protected_oe property

protected SpriteFont,Microsoft.Xna.Framework.Graphics font
return Microsoft.Xna.Framework.Graphics.SpriteFont

graphicsDevice protected_oe property

protected GraphicsDevice graphicsDevice
return GraphicsDevice

hudItems protected_oe property

All of the different HUDItems that will need to be drawn. More or less can be registered.
protected List hudItems
return List