-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_menu.h
32 lines (27 loc) · 887 Bytes
/
main_menu.h
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
#ifndef MAIN_MENU_H
#define MAIN_MENU_H
#include <string>
#include <memory>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
class MainMenu
{
public:
MainMenu( std::shared_ptr<sf::RenderWindow> window,
std::shared_ptr<sf::Texture> bg );
~MainMenu();
int run( void );
private:
std::shared_ptr<sf::RenderWindow> _window;
std::shared_ptr<sf::Texture> _background_texture;
sf::Texture _start_button_up_texture, _start_button_down_texture,
_join_button_up_texture, _join_button_down_texture;
sf::Image _background_image;
sf::Sprite _main_menu_bg, _start_button_sprite, _join_button_sprite;
// This function handles which texture is loaded for the buttons
// it returns which button it is on, returns zero if not on a button
int mouse_over_box();
int event_handler( int button_hovered );
};
#endif /*MAIN_MENU_H*/