Add Text rendering and Hull / Fuel Meters

This commit is contained in:
Bram Verhulst
2024-05-16 02:04:36 +02:00
parent 600050c198
commit 8866f33c09
18 changed files with 286 additions and 118 deletions

View File

@@ -8,7 +8,7 @@
#include "Collision.h"
#include "colors.h"
#include "GroundTileTypeManager.h"
#include "../../GridSystem/GroundTileTypeManager.h"
#include "utils.h"
#include "GridSystem/WorldTile.h"
#include "Gui/Screens/ScreenManager.h"
@@ -66,6 +66,7 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
m_topCover = TextureManager::GetInstance()->GetTexture("topBackground.png");
m_MainScreen = new MainScreen(TextureManager::GetInstance());
}
WorldLevel::~WorldLevel() {
@@ -79,6 +80,7 @@ void WorldLevel::Update(float elapsedSec) {
m_MousePos = Vector2f { float(mouseX), float(mouseY) };
m_MousePos = m_pCamera->TransformMouse(m_MousePos);
// for (size_t x { 0 }; x < WORLD_WIDTH; ++x) {
// for (size_t y { 0 }; y < WORLD_HEIGHT; ++y) {
// m_gridManager.GetTileAtIndex(x, y)->m_Hightlight = false;
@@ -133,6 +135,7 @@ void WorldLevel::Update(float elapsedSec) {
}
m_MainScreen->Update(elapsedSec);
m_MainScreen->SetDepth(std::to_string((int)-m_Player.GetPosition().y - 50) + " ft.");
//Vector2f playerPos = m_player.GetPosition();
//Vector2f newCameraPos = playerPos;