Public Member Functions | Protected Attributes | Static Protected Attributes

MainMenu Class Reference

Main menu class. More...

#include <MainMenu.h>

Inheritance diagram for MainMenu:
Menu

List of all members.

Public Member Functions

 MainMenu (CIwFVec2 screenDimensions)
 ~MainMenu () override
int Update ()
void Draw () override

Protected Attributes

CIw2DImage * m_singleplayerButton
 Singleplayer button image.
CIw2DImage * m_multiplayerButton
 Multiplayer button image.
CIw2DImage * m_tutorialButton
 Tutorial button image.
CIw2DImage * m_highscoreButton
 Highscore button image.
CIw2DImage * m_singleplayerButtonHighlighted
 Singleplayer highlighted button image.
CIw2DImage * m_multiplayerButtonHighlighted
 Multiplayer highlighted button image.;.
CIw2DImage * m_tutorialButtonHighlighted
 Tutorial highlighted button image.
CIw2DImage * m_highscoreButtonHighlighted
 Highscore highlighted button image.
CIw2DImage * m_gameLogo
 Game logo image.
CIw2DImage * m_quitButton
 Quit button image.
CIwFVec2 m_screenDimensions
 Screen dimensions in pixels.
CIwFVec2 m_singleplayerButtonPosition
 Position of the singleplayer button.
CIwFVec2 m_multiplayerButtonPosition
 Position of the multiplayer button.
CIwFVec2 m_tutorialButtonPosition
 Position of the tutorial button.
CIwFVec2 m_highscoreButtonPosition
 Position of the highscore button.
CIwFVec2 m_gameLogoPosition
 Position of the game logo.
CIwFVec2 m_quitButtonPosition
 Position of the quit button.
bool m_singleplayerHighlighted
 Is the singleplayer button being hovered over?
bool m_multiplayerHighlighted
 Is the multiplayer button being hovered over?
bool m_tutorialHighlighted
 Is the tutorial button being hovered over?
bool m_highscoreHighlighted
 Is the highscore button being hovered over?

Static Protected Attributes

static const int m_quitDiameter = 75
 Diameter of the quit button.

Detailed Description

Main menu class.

The game's main menu. Update returns an int representing the new gamestate if the user clicks a button.


Constructor & Destructor Documentation

MainMenu::MainMenu ( CIwFVec2  screenDimensions  ) 

Constructor.

Create a new main menu.

Parameters:
[in] screenDimensions Pixel dimensions of the screen.
MainMenu::~MainMenu (  )  [override]

Destructor.

Destroy the menu and release all associated memory.


Member Function Documentation

void MainMenu::Draw (  )  [override, virtual]

Draw.

Draw the menu and buttons.

Reimplemented from Menu.

int MainMenu::Update (  ) 

Update.

Check for user input and return the new game state (if any).

Returns:
int new gamestate (if any).

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations