class MenuWindow -
More...
#include <MenuWindow.hpp>
|
ClientGameEngine * | gameEnginePtr = nullptr |
|
std::unique_ptr< TextureDisplayer > | backgroundTexture |
|
std::unique_ptr< TextureDisplayer > | quitTexture |
|
sf::Font | menuFont |
|
std::vector< Button > | menuButtons |
|
std::vector< Button > | newGameButtons |
|
std::vector< Button > * | currentMenu |
|
std::vector< sf::Text > | menuTexts |
|
std::vector< sf::Text > | newGameTexts |
|
std::vector< sf::Text > * | currentText |
|
sf::Font | titleMenuFont |
|
◆ MenuWindow()
MenuWindow::MenuWindow |
( |
| ) |
|
◆ clickAction()
bool MenuWindow::clickAction |
( |
sf::Vector2i |
clickPoint, |
|
|
int |
index, |
|
|
bool |
isOnButton |
|
) |
| |
Do the action corresponding to a click on a particular button.
- Parameters
-
clickPoint | cursor coordonate |
index | index of the testing button |
◆ connectToGame()
bool MenuWindow::connectToGame |
( |
std::string |
gameID | ) |
|
connect to the server
- Parameters
-
◆ getCurrentTime()
long MenuWindow::getCurrentTime |
( |
bool |
timeSecond = true | ) |
|
Function that deteck where the user click and what to send to the engine.
- Parameters
-
timeSecond | is a boolean used to |
◆ loadButton()
void MenuWindow::loadButton |
( |
Json::Value & |
data | ) |
|
Load all the button from a JSon.
- Parameters
-
data | where the data is stored |
◆ loadText()
void MenuWindow::loadText |
( |
Json::Value & |
data | ) |
|
Load all the text of a Button from a JSon.
- Parameters
-
data | where the data is stored |
◆ menuEventHappened()
bool MenuWindow::menuEventHappened |
( |
sf::Event & |
event | ) |
|
Test events and do actions corresponding to the event.
- Parameters
-
event | pointer to the event |
◆ setButtonPosition()
sf::Vector2f MenuWindow::setButtonPosition |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
Calcul the position of a button.
- Parameters
-
x | value comming from the JSon file |
y | value comming from the JSon file |
◆ setButtonSize()
sf::Vector2f MenuWindow::setButtonSize |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
Calcul the size of a button.
- Parameters
-
width | value comming from the JSon file |
height | value comming from the JSon file |
◆ setXAxisButtonTextPosition()
int MenuWindow::setXAxisButtonTextPosition |
( |
float |
offset | ) |
|
Calcul the x offset of the text of a button.
- Parameters
-
offset | x offset of the text |
◆ setYAxisButtonTextPosition()
int MenuWindow::setYAxisButtonTextPosition |
( |
float |
offset | ) |
|
Calcul the y offset of the text of a button.
- Parameters
-
offset | y offset of the text |
◆ startMenu()
void MenuWindow::startMenu |
( |
| ) |
|
Loop that look for events to happend and call displayWindow()
- Parameters
-
clientWindow | is window that comes from the engine |
quitGame | is the function used to quit the menu, it is load as an attribut |
◆ writeChar()
void MenuWindow::writeChar |
( |
std::string |
ch | ) |
|
Add a letter to the selected button.
- Parameters
-
The documentation for this class was generated from the following files: