2023-02-24 23:46:34 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Common.h"
|
|
|
|
|
#include "Button.h"
|
2023-03-01 21:37:42 -05:00
|
|
|
#include "IndexSprite.h"
|
2023-02-24 23:46:34 -05:00
|
|
|
|
|
|
|
|
class UIMenu
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
//UIMenu() {};
|
|
|
|
|
sf::Font & font;
|
|
|
|
|
UIMenu(sf::Font & _font);
|
2023-08-25 21:57:42 -04:00
|
|
|
UIMenu();
|
2023-02-24 23:46:34 -05:00
|
|
|
std::vector<sf::Text> captions;
|
|
|
|
|
std::vector<Button> buttons;
|
2023-03-01 21:37:42 -05:00
|
|
|
std::vector<IndexSprite> sprites;
|
2023-08-25 21:57:42 -04:00
|
|
|
|
|
|
|
|
/* idea: */ //std::vector<UIDrawable> children; // on the UIBox class?
|
|
|
|
|
|
2023-02-24 23:46:34 -05:00
|
|
|
sf::RectangleShape box;
|
|
|
|
|
bool visible = false;
|
|
|
|
|
int next_text = 10;
|
|
|
|
|
int next_button = 10;
|
|
|
|
|
|
|
|
|
|
void render(sf::RenderWindow & window);
|
|
|
|
|
void refresh();
|
|
|
|
|
void add_caption(const char* text, int size, sf::Color color);
|
|
|
|
|
void add_button(Button b);
|
2023-03-01 21:37:42 -05:00
|
|
|
void add_sprite(IndexSprite s);
|
2023-02-24 23:46:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|