Main class of gui. More...
#include <primitiveGui.h>
Public Member Functions | |
pGui () | |
void | addWidget (pWidget *widget) |
void | addWindow (pWindow *window) |
void | update (sf::Event &event, const sf::Window &window) |
void | changeOnTopWindow (pWindow *window) |
Public Attributes | |
int | windowOnTopId |
Index of window on top. | |
Friends | |
class | pWindow |
Main class of gui.
This class inherits of sf::Drawable class from SFML.
This class contains all widgets, set it's unique index, handles events and draw widgets on main window.
Method update(...) must be call in event loop otherwise widgets will not be able to recive events:
After clear main window you must draw gui
pGui::pGui | ( | ) |
Default constructor.
void pGui::addWidget | ( | pWidget * | widget | ) |
Add widget to gui.
*widget |
void pGui::addWindow | ( | pWindow * | window | ) |
Add window widget to gui.
*window |
void pGui::changeOnTopWindow | ( | pWindow * | window | ) |
If you use windows you can set the window on top.
*window |
void pGui::update | ( | sf::Event & | event, |
const sf::Window & | window | ||
) |
Update gui, check widgets events
event | |
window |