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->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()
{

View File

@ -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;

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
// 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 )