Level H Engine
UIManager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <unordered_map>
4 #include "../ResourceManagement/ResourceManager.h"
5 #include "Button.h"
6 
10 class UIManager
11 {
12 public:
13 
17  static void deleteAllUI();
18 
22  static void deleteAllButtons();
23 
28  static void deleteButton(std::string id) { buttons.erase(id); }
29 
38  static std::string initialiseButton(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos, Vec2 inDim);
39 
46  static std::string initialiseButton(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos);
47 
52  static Button* getButton(std::string id) { return buttons[id]; }
53 
54 private:
56  static std::unordered_map<std::string, Button*> buttons;
57 };
static void deleteButton(std::string id)
A static function to delete the button.
Definition: UIManager.h:28
Contains static variables and functions for use with UI manager.
Definition: UIManager.h:10
static Button * getButton(std::string id)
A static function to get a button.
Definition: UIManager.h:52
Contains the Vec2 structure with functions and overloaded operators.
Definition: Vec2.h:8
static std::unordered_map< std::string, Button * > buttons
The loaded buttons.
Definition: UIManager.h:56
static void deleteAllUI()
A static function to delete all the UI.
Definition: UIManager.cpp:9
static std::string initialiseButton(std::string buttonImage, std::string buttonHeldSprite, Vec2 inPos, Vec2 inDim)
A static function to initialise a button and scale it.
Definition: UIManager.cpp:23
static void deleteAllButtons()
A static function to delete all the buttons.
Definition: UIManager.cpp:14
A State for a button.
Definition: Button.h:9