From 21e087ded58f2c5e74ad79eb0b1e851c66ee9649 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Tue, 11 Feb 2025 14:35:54 -0500 Subject: [PATCH] Basic UI positioning and layout prior to designing the UI and setting a place for the combat system. --- constants.hpp | 4 ++-- gui.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/constants.hpp b/constants.hpp index 04b7c73..094f327 100644 --- a/constants.hpp +++ b/constants.hpp @@ -4,8 +4,8 @@ constexpr const int TEXTURE_WIDTH=256; constexpr const int TEXTURE_HEIGHT=256; -constexpr const int RAY_VIEW_WIDTH=960; -constexpr const int RAY_VIEW_HEIGHT=720; +constexpr const int RAY_VIEW_WIDTH=900; +constexpr const int RAY_VIEW_HEIGHT=600; constexpr const int SCREEN_WIDTH=1280; constexpr const int RAY_VIEW_X=(SCREEN_WIDTH - RAY_VIEW_WIDTH); constexpr const int RAY_VIEW_Y=0; diff --git a/gui.cpp b/gui.cpp index 66bf015..212a16c 100644 --- a/gui.cpp +++ b/gui.cpp @@ -212,6 +212,7 @@ namespace gui { } void FSM::draw_weapon() { + return; auto weapon = $rayview.$textures.sword.sprite; weapon->setPosition({SCREEN_WIDTH/2, SCREEN_HEIGHT/2}); weapon->setRotation(sf::degrees($rotation)); @@ -224,6 +225,11 @@ namespace gui { rect.setFillColor({50, 50, 50}); $window.draw(rect); + sf::RectangleShape lower({RAY_VIEW_WIDTH, SCREEN_HEIGHT - RAY_VIEW_HEIGHT}); + lower.setPosition({RAY_VIEW_X,RAY_VIEW_HEIGHT}); + lower.setFillColor({40, 40, 40}); + $window.draw(lower); + auto player = $level.world->get_the(); auto player_combat = $level.world->get(player.entity); @@ -249,6 +255,8 @@ namespace gui { } void FSM::render() { + draw_gui(); + if(in_state(State::MAPPING)) { $window.clear(); $map_view.render(); @@ -263,7 +271,6 @@ namespace gui { draw_weapon(); } - draw_gui(); $window.display(); }