Window centering and positioning added.

This commit is contained in:
2023-10-06 15:00:27 -05:00
parent ce1a2adf81
commit c1d64e7bd1
7 changed files with 18 additions and 14 deletions
+3 -1
View File
@@ -18,10 +18,11 @@ class Menu:IAttributable{
std::vector<MenuComponent*>displayComponents; //Components that are only for displaying purposes.
safemap<std::string,MenuComponent*>components; //A friendly way to interrogate any component we are interested in.
vi2d selection={-1,-1};
vf2d pos; //Specify the upper-left corner of the window. Using CENTERED will always put this where the upper-left corner would center the window.
vf2d size; //Size in tiles (24x24), every menu will be tile-based
public:
Menu();
Menu(vf2d size);
Menu(vf2d pos,vf2d size);
void AddComponent(std::string key,MenuComponent*button);
void Update(Crawler*game);
void Draw(Crawler*game);
@@ -30,6 +31,7 @@ public:
static std::vector<Menu*>stack;
static std::string themeSelection;
static safeunorderedmap<std::string,Theme>themes;
static const vf2d CENTERED;
private:
void MenuSelect(Crawler*game);
static const Menu InitializeTestMenu();