Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
raycaster/combat_ui.hpp

31 lines
973 B

#pragma once
#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"
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;
GameLevel $level;
sf::Font $font;
sf::RectangleShape $background;
std::unordered_map<std::string, sf::RectangleShape> $shapes;
std::unordered_map<std::string, sf::RectangleShape> $label_boxes;
std::vector<sf::Text> $labels;
CombatUI(GameLevel level);
void render();
void draw(sf::RenderWindow& window);
void update_level(GameLevel &level) { $level = level; }
void click(int x, int y);
};
}