From 70419e9dd8c493bb26288ea891e501cca5c0aa43 Mon Sep 17 00:00:00 2001 From: Tobias Grundel Date: Tue, 25 Feb 2014 14:08:15 +0100 Subject: [PATCH] Nothing of importance --- .../GameClient/GameClientState/GamingUI.cpp | 18 +++++++++++------- .../Game/GameClient/GameClientState/GamingUI.h | 3 ++- .../GameClient/GameClientState/RespawnUI.cpp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Code/Game/GameClient/GameClientState/GamingUI.cpp b/Code/Game/GameClient/GameClientState/GamingUI.cpp index 03840881..669b3d87 100644 --- a/Code/Game/GameClient/GameClientState/GamingUI.cpp +++ b/Code/Game/GameClient/GameClientState/GamingUI.cpp @@ -16,7 +16,7 @@ GamingUI::GamingUI() : this->netClient = nullptr; this->camera = nullptr; this->plane = nullptr; - this->text = nullptr; + this->hp = nullptr; } GamingUI::GamingUI( InputClass *input, NetworkClient *connection, Camera_FPSV2 *camera ) : @@ -33,7 +33,8 @@ bool GamingUI::Init() // z value should be between 0.5 - 0.9 so that it will be behind other states // add textures and text this->plane = new Plane_UI(L"box_tex.png", Float3(0.5f, 0.0f, 0.5f), Float2(0.3f, 0.1f)); - this->text = new Text_UI(L"hej", Float3(0.5f,0.0f,0.1f), Float2(0.1f,0.1f)); + this->hp = new Text_UI(L"100", Float3(0.04f,0.91f,0.1f), Float2(0.1f,0.1f), Float4(1,0,0,1)); + this->energy = new Text_UI(L"100", Float3(0.8f,0.91f,0.1f), Float2(0.4f,0.1f), Float4(1,1,0,1)); return true; } @@ -55,12 +56,13 @@ bool GamingUI::HaveTextRender() const void GamingUI::RenderGUI() const { - this->plane->RenderTexture(); + //this->plane->RenderTexture(); } void GamingUI::RenderText() const { - this->text->RenderText(); + this->hp->RenderText(); + this->energy->RenderText(); } bool GamingUI::Release() @@ -68,13 +70,15 @@ bool GamingUI::Release() // TODO: Release UI components here. if(this->plane) delete this->plane; - if(this->text) - delete this->text; + if(this->hp) + delete this->hp; + if(this->energy) + delete this->energy; return true; } void GamingUI::SetHPtext( std::wstring hp ) { - this->text->setText(hp); + this->hp->setText(hp); } void GamingUI::ReadKeyInput() { diff --git a/Code/Game/GameClient/GameClientState/GamingUI.h b/Code/Game/GameClient/GameClientState/GamingUI.h index 36e94262..13866827 100644 --- a/Code/Game/GameClient/GameClientState/GamingUI.h +++ b/Code/Game/GameClient/GameClientState/GamingUI.h @@ -30,7 +30,8 @@ namespace DanBias { namespace Client Camera_FPSV2 *camera; // TODO add multiple UI elements - Text_UI* text; + Text_UI* hp; + Text_UI* energy; Plane_UI* plane; bool key_forward; diff --git a/Code/Game/GameClient/GameClientState/RespawnUI.cpp b/Code/Game/GameClient/GameClientState/RespawnUI.cpp index 21732df6..cb5cb6b5 100644 --- a/Code/Game/GameClient/GameClientState/RespawnUI.cpp +++ b/Code/Game/GameClient/GameClientState/RespawnUI.cpp @@ -27,7 +27,7 @@ bool RespawnUI::Init() { // z value should be between 0.5 - 0.9 so that it will be behind other states // add textures and text - this->text = new Text_UI(L"DEAD", Float3(0.5f,0.0f,0.5f), Float2(0.2f,0.2f)); + this->text = new Text_UI(L"DEAD", Float3(0.35f,0.35f,0.5f), Float2(0.5f,0.2f)); return true; } GameStateUI::UIState RespawnUI::Update( float deltaTime )