Make it so the canvas for the map view is calculated based on the font size, which will allow for zooming.

This commit is contained in:
Zed A. Shaw 2024-10-21 00:12:04 -04:00
parent 9f1e9717a0
commit 02a45d890f
3 changed files with 33 additions and 18 deletions

View file

@ -17,16 +17,14 @@
using std::string;
using ftxui::Canvas, ftxui::Component, ftxui::Screen;
constexpr int GAME_MAP_X = 60;
constexpr int GAME_MAP_Y = 30;
constexpr int VIEW_PORT_X = 30;
constexpr int VIEW_PORT_Y = 15;
constexpr int GAME_MAP_X = 90;
constexpr int GAME_MAP_Y = 90;
constexpr int GAME_MAP_POS = 600;
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=60;
constexpr int MAP_FONT_SIZE=90;
constexpr int UI_FONT_SIZE=30;
enum class Value {
@ -52,6 +50,7 @@ class GUI {
DinkyECS::World $world;
sf::Texture $font_texture;
std::unordered_map<wchar_t, sf::Sprite> $sprites;
Point $view_port = {0,0};
public:
GUI();