Make it possible to zoom in/out, but I may make this a combat thing where it's zoomed out until you encounter an enemy.

This commit is contained in:
Zed A. Shaw 2024-10-21 20:31:59 -04:00
parent 02a45d890f
commit 9083582420
2 changed files with 32 additions and 19 deletions

View file

@ -17,6 +17,8 @@
using std::string;
using ftxui::Canvas, ftxui::Component, ftxui::Screen;
constexpr int MIN_FONT_SIZE = 20;
constexpr int MAX_FONT_SIZE = 140;
constexpr int GAME_MAP_X = 90;
constexpr int GAME_MAP_Y = 90;
constexpr int GAME_MAP_POS = 600;
@ -24,8 +26,8 @@ constexpr int SCREEN_X = 40;
constexpr int SCREEN_Y = 30;
constexpr int VIDEO_X = 1600;
constexpr int VIDEO_Y = 900;
constexpr int MAP_FONT_SIZE=90;
constexpr int UI_FONT_SIZE=30;
constexpr int BASE_MAP_FONT_SIZE=90;
enum class Value {
BLACK=0, DARK_DARK, DARK_MID,
@ -51,6 +53,7 @@ class GUI {
sf::Texture $font_texture;
std::unordered_map<wchar_t, sf::Sprite> $sprites;
Point $view_port = {0,0};
int $map_font_size;
public:
GUI();
@ -66,6 +69,7 @@ public:
void shake();
void configure_world();
void run_systems();
void resize_map(int new_size);
sf::Sprite &get_text_sprite(wchar_t tile);
int main();