I now have a semi-functional GUI system that uses the ECS style to build gui elements rather than inheritance.
This commit is contained in:
parent
615599084a
commit
46de98e6f4
12 changed files with 213 additions and 146 deletions
|
@ -2,25 +2,15 @@
|
|||
#include "panel.hpp"
|
||||
#include "levelmanager.hpp"
|
||||
#include <SFML/Graphics/RenderWindow.hpp>
|
||||
#include <SFML/Graphics/RectangleShape.hpp>
|
||||
#include <SFML/Graphics/Font.hpp>
|
||||
#include <SFML/Graphics/Text.hpp>
|
||||
#include "lel.hpp"
|
||||
#include "gui_gadgets.hpp"
|
||||
#include "ecs_gui.hpp"
|
||||
|
||||
namespace gui {
|
||||
class CombatUI {
|
||||
public:
|
||||
std::string $grid =
|
||||
"[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]"
|
||||
"[ >.%(100,50)label_hp | *%.(200,50)bar_hp | _ ]";
|
||||
lel::Parser $layout;
|
||||
GUECS $gui;
|
||||
GameLevel $level;
|
||||
sf::Font $font;
|
||||
sf::RectangleShape $background;
|
||||
std::unordered_map<std::string, gui::Button> $buttons;
|
||||
std::vector<gui::Label> $labels;
|
||||
std::unordered_map<std::string, gui::Meter> $meters;
|
||||
|
||||
CombatUI(GameLevel level);
|
||||
|
||||
void render();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue