Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define IN_MENU 0
- #define IN_GAME 1
- namespace game {
- class State
- {
- public:
- State(sf::RenderWindow *window)
- {
- this->window = window;
- this->location = IN_MENU;
- menu.addButton(game::Button(100, 100, 400, 200, "test"));
- }
- void setLocation(int where)
- {
- location = where;
- }
- void update(float dt)
- {
- menu.update(sf::Mouse::getPosition(*window));
- }
- void draw()
- {
- menu.draw(*window);
- }
- private:
- int location;
- sf::RenderWindow *window;
- game::Menu menu;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment