Window centering and positioning added.
This commit is contained in:
+3
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user