Nothing of importance

This commit is contained in:
Tobias Grundel 2014-02-25 14:08:15 +01:00
parent f8b8439874
commit 70419e9dd8
3 changed files with 14 additions and 9 deletions

View File

@ -16,7 +16,7 @@ GamingUI::GamingUI() :
this->netClient = nullptr; this->netClient = nullptr;
this->camera = nullptr; this->camera = nullptr;
this->plane = nullptr; this->plane = nullptr;
this->text = nullptr; this->hp = nullptr;
} }
GamingUI::GamingUI( InputClass *input, NetworkClient *connection, Camera_FPSV2 *camera ) : 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 // z value should be between 0.5 - 0.9 so that it will be behind other states
// add textures and text // 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->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; return true;
} }
@ -55,12 +56,13 @@ bool GamingUI::HaveTextRender() const
void GamingUI::RenderGUI() const void GamingUI::RenderGUI() const
{ {
this->plane->RenderTexture(); //this->plane->RenderTexture();
} }
void GamingUI::RenderText() const void GamingUI::RenderText() const
{ {
this->text->RenderText(); this->hp->RenderText();
this->energy->RenderText();
} }
bool GamingUI::Release() bool GamingUI::Release()
@ -68,13 +70,15 @@ bool GamingUI::Release()
// TODO: Release UI components here. // TODO: Release UI components here.
if(this->plane) if(this->plane)
delete this->plane; delete this->plane;
if(this->text) if(this->hp)
delete this->text; delete this->hp;
if(this->energy)
delete this->energy;
return true; return true;
} }
void GamingUI::SetHPtext( std::wstring hp ) void GamingUI::SetHPtext( std::wstring hp )
{ {
this->text->setText(hp); this->hp->setText(hp);
} }
void GamingUI::ReadKeyInput() void GamingUI::ReadKeyInput()
{ {

View File

@ -30,7 +30,8 @@ namespace DanBias { namespace Client
Camera_FPSV2 *camera; Camera_FPSV2 *camera;
// TODO add multiple UI elements // TODO add multiple UI elements
Text_UI* text; Text_UI* hp;
Text_UI* energy;
Plane_UI* plane; Plane_UI* plane;
bool key_forward; bool key_forward;

View File

@ -27,7 +27,7 @@ bool RespawnUI::Init()
{ {
// z value should be between 0.5 - 0.9 so that it will be behind other states // z value should be between 0.5 - 0.9 so that it will be behind other states
// add textures and text // 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; return true;
} }
GameStateUI::UIState RespawnUI::Update( float deltaTime ) GameStateUI::UIState RespawnUI::Update( float deltaTime )