This class generate a button for the GUI.
More...
#include <Button.h>
|
| Button (std::string texturename, unsigned int x_pos, unsigned int y_pos, std::string nextStatus, std::string myStatus) |
|
void | load_Texture (std::string name) |
|
sf::Sprite | get_Button_Sprite () |
|
void | eventHandler (const sf::Event &event, std::string &status, const sf::Vector2f &mouse_pos) |
|
void | setFunction (std::function< void()> func) |
|
void | setPosition (float x_pos, float y_pos) |
|
This class generate a button for the GUI.
Button::Button |
( |
std::string |
texturename, |
|
|
unsigned int |
x_pos, |
|
|
unsigned int |
y_pos, |
|
|
std::string |
nextStatus, |
|
|
std::string |
myStatus |
|
) |
| |
- Parameters
-
texturename | is the name of the texture of the button |
x_pos | is the x coordinate of the sprite in the window |
y_pos | is the y coordinate of the sprite in the window |
nextStatus | is the status of the GUI after the Button was clicked |
- Returns
- a Button with a texture on a specific position
void Button::eventHandler |
( |
const sf::Event & |
event, |
|
|
std::string & |
status, |
|
|
const sf::Vector2f & |
mouse_pos |
|
) |
| |
This function handle events
- Parameters
-
event | a Event which will describe the event that will happen |
status | is the status of the current GUI |
mouse_pos | the current mouse position |
sf::Sprite Button::get_Button_Sprite |
( |
| ) |
|
void Button::load_Texture |
( |
std::string |
name | ) |
|
This function load a new texture for the Button.
- Parameters
-
name | is the name of the new texture |
void Button::setFunction |
( |
std::function< void()> |
func | ) |
|
set the function of the Button
void Button::setPosition |
( |
float |
x_pos, |
|
|
float |
y_pos |
|
) |
| |
set a new position for the Button
- Parameters
-
x_pos | is the new x-coordinate |
y_pos | is the new y-coordinate |
The documentation for this class was generated from the following files:
- src/visualization/Button.h
- src/visualization/Button.cc