My Project
Static Public Member Functions | List of all members
View.DrawClass Class Reference

Draw Class containing all the different draw methods More...

Static Public Member Functions

static void DrawUnit (SpriteBatch spriteBatch, Player player)
 
static void DrawPlayerTurn (SpriteBatch spriteBatch, int player, Texture2D playerTurn)
 
static void drawDamagePopup (SpriteBatch spriteBatch, SpriteFont font)
 
static void drawHighlightNodes (SpriteBatch spriteBatch, Graph graph, Texture2D moveableNode, Texture2D attackableNode)
 
static void drawDropDownMenu (SpriteBatch spriteBatch)
 
static void drawInventoryMenu (SpriteBatch spriteBatch, SpriteFont font)
 
static void drawUnitsAtGameOver (SpriteBatch spriteBatch)
 
static void drawEndTurnButton (SpriteBatch spriteBatch, Texture2D endTurnButton)
 
static void drawAttackConfirm (SpriteBatch spriteBatch, SpriteFont font, SpriteFont largeFont, SpriteFont largestFont, Graph graph)
 
static void drawInfoScreen (SpriteBatch spriteBatch, Unit unit, SpriteFont font, SpriteFont largeFont)
 
static void drawGameOverMenu (SpriteBatch spriteBatch, Texture2D gameOver, Texture2D backGround, SpriteFont largestFont)
 
static void drawTurnTransition (SpriteBatch spriteBatch, Texture2D player1Transition, Texture2D player2Transition)
 

Detailed Description

Draw Class containing all the different draw methods

Member Function Documentation

§ drawAttackConfirm()

static void View.DrawClass.drawAttackConfirm ( SpriteBatch  spriteBatch,
SpriteFont  font,
SpriteFont  largeFont,
SpriteFont  largestFont,
Graph  graph 
)
inlinestatic

Draws the attack confirmation screen. All the damage calculations, 1 set each for each player: AttackType, damageDealt, hitCOunt, hitRate, critRate, HP and equipped weapons are all printed to the screen. To make sure the damage numbers are properly displayed for which player's unit is attacking, and which is defending, the method will check for whose player's turn it currently is. The method will also draw the attack confirm button. Negative numbers for stats are handled in DamageClass.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
fontThe small font to be used.
largeFontThe larger font to be used.
largestFontThe largest font to be used.
graphThe current game graph.

§ drawDamagePopup()

static void View.DrawClass.drawDamagePopup ( SpriteBatch  spriteBatch,
SpriteFont  font 
)
inlinestatic

Draws the Damage pop up numbers from attacking. If GameState currentPlayerDamagePopup is true, draw the damage dealt by attacking player on top of the enemy unit. If GameState enemyPlayerDamagePopup is true, draw the damage received by defender on top of the recipient.
Exceptions:

  • This function assumes that the last time damage calculation was calculated and stored corresponds to the last attacking and defending unit
    Parameters
    spriteBatchThe spitebatch used to draw 2D bitmap to screen.
    fontthe font to be used.

§ drawDropDownMenu()

static void View.DrawClass.drawDropDownMenu ( SpriteBatch  spriteBatch)
inlinestatic

Draws all active buttons for the currently selected unit. The 4 possible active button is Attack, Move, Item and Wait.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.

§ drawEndTurnButton()

static void View.DrawClass.drawEndTurnButton ( SpriteBatch  spriteBatch,
Texture2D  endTurnButton 
)
inlinestatic

Draws end turn button.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
endTurnButtonEnd turn button texture2D.

§ drawGameOverMenu()

static void View.DrawClass.drawGameOverMenu ( SpriteBatch  spriteBatch,
Texture2D  gameOver,
Texture2D  backGround,
SpriteFont  largestFont 
)
inlinestatic

Draw the Game over menu. A game over button texture, the string "Game Over", which player won, and a darkened background is drawn to screen.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
gameOverThe game over button Texture2D.
backgroundThe background Texture2D.
largestFontThe largest font to be used.

§ drawHighlightNodes()

static void View.DrawClass.drawHighlightNodes ( SpriteBatch  spriteBatch,
Graph  graph,
Texture2D  moveableNode,
Texture2D  attackableNode 
)
inlinestatic

Draws the highlighted nodes. If a unit has yet to move, and unit is selected, all moveable nodes are highlighted blue, with the max attack range nodes highlighted red. Otherwise if a unit is selected, and has finished moving, only display the attackable nodes from the unit's current position.
Exceptions:

  • If a unit has no moveable nodes, no squares will be highlighted blue
    Parameters
    spriteBatchThe spitebatch used to draw 2D bitmap to screen.
    graphThe current game graph.
    moveableNodeThe texture for moveableNode.
    attackableNodeThe texture for attackableNode.

§ drawInfoScreen()

static void View.DrawClass.drawInfoScreen ( SpriteBatch  spriteBatch,
Unit  unit,
SpriteFont  font,
SpriteFont  largeFont 
)
inlinestatic

Draws character information popup. If it is player 1's turn, the popup will be on the bottom left screen. Otherwise it will show up on right side of the screen. The stats Level, Strength, Int, Skill, Speed, Defense, Resistance, HP and charInfoBackground texture are all drawn to screen.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
unitThe unit to print information of.
fontThe small font to be used.
largeFontThe larger font to be used.

§ drawInventoryMenu()

static void View.DrawClass.drawInventoryMenu ( SpriteBatch  spriteBatch,
SpriteFont  font 
)
inlinestatic

Draws the Inventory Menu for the selected unit. This method will loop through all possible inventory slots, and display them if the slot if the button for that slot is both active, and has an item. The name of the item is drawn to screen along with the button.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
fontThe font used to draw the text.

§ DrawPlayerTurn()

static void View.DrawClass.DrawPlayerTurn ( SpriteBatch  spriteBatch,
int  player,
Texture2D  playerTurn 
)
inlinestatic

This method draws who's player turn it currently is. The method takes in the texture containing that info, spriteBatch and the int for the player's whose turn it is. The method will print the texture for player 1 on left side of screen if it is currently player 1's turn, otherwise it will print it on right side.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
playerThe current player.
turnInfoThe Texture2D containing the text on which player's turn it currently is.

§ drawTurnTransition()

static void View.DrawClass.drawTurnTransition ( SpriteBatch  spriteBatch,
Texture2D  player1Transition,
Texture2D  player2Transition 
)
inlinestatic

Draws a turn transition image to screen. player1Transition is if GameState is player1, otherwise player2Transition is drawn.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
player1TransitionThe player 1 transition texture2D.
player2TransitionThe player 2 transition texture2D.

§ DrawUnit()

static void View.DrawClass.DrawUnit ( SpriteBatch  spriteBatch,
Player  player 
)
inlinestatic

This method draws the unit sprites, by taking in spriteBatch, and the Player who's units are to be drawn along with their healthbar. All the player's units will then be looped through, and drawn to screen if such unit is alive. The healthbar location is directly above the character x coord of unit +1. The healthbar will be 30 pixels wide, and be scaled in accordance with the unit's current HP by using a rectangle.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.
playerThe player's unit to draw.

§ drawUnitsAtGameOver()

static void View.DrawClass.drawUnitsAtGameOver ( SpriteBatch  spriteBatch)
inlinestatic

Redraws units for game over state. This method loops through all of player 1 and 2's units, and redraws them with a darker shade to match the darker game over screen.

Parameters
spriteBatchThe spitebatch used to draw 2D bitmap to screen.

The documentation for this class was generated from the following file: