-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenuState.h
More file actions
36 lines (31 loc) · 830 Bytes
/
Copy pathMainMenuState.h
File metadata and controls
36 lines (31 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//Class for main menu of the game that inherits from state class
#pragma once
#include "GameState.h"
#include "Button.h"
using namespace std;
using namespace sf;
class MainMenuState :public State
{
private:
//Variables
Texture backgroundTexture;
RectangleShape background;
Font font;
map<string, Button*> buttons;
//Functions
void initVariables();
void initBackground();
void initFonts();
void initkeybinds();
void initButtons();
public:
//Constructors/Destructors
MainMenuState(RenderWindow* window, map<string, int>* supportedKeys, stack<State*>* states);
virtual ~MainMenuState();
//Functions
void updateinput(const float& dt);
void updateButtons();
void update(const float& dt, RenderTarget* target = nullptr );
void renderButtons(RenderTarget& target);
void render(RenderTarget* target = nullptr);
};