-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.h
More file actions
57 lines (38 loc) · 1.02 KB
/
Menu.h
File metadata and controls
57 lines (38 loc) · 1.02 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Button.h"
class Menu
{
private:
//
protected:
sf::Font& font;
sf::Text menuText;
sf::RectangleShape background;
sf::RectangleShape container;
sf::Texture logoTexture;
sf::Sprite logoSprite;
// std::map<std::string, gui::Button*> buttons;
std::map<const gui::ButtonName, gui::Button*> buttons;
// protected: Functions:
void initTexture(sf::Texture& texture, const std::string file_path);
public:
// Constructors and Destructors:
Menu(sf::VideoMode& video_mode, sf::Font& font);
virtual ~Menu();
// Accessors:
// std::map<std::string, gui::Button*>& getButtons();
std::map<const gui::ButtonName, gui::Button*>& getButtons();
// Functions:
const bool isButtonPressed(const gui::ButtonName name);
void addButton
(
const gui::ButtonName name,
const float y,
const float width,
const float height,
const unsigned char_size,
const std::string text
);
virtual void update(const sf::Vector2i& mouse_position, const float& dt) = 0;
virtual void render(sf::RenderTarget* target) = 0;
};