diff --git a/Code/Game/DanBiasGame/GameClientState/MainState.cpp b/Code/Game/DanBiasGame/GameClientState/MainState.cpp index c7fe78c8..771fc1ee 100644 --- a/Code/Game/DanBiasGame/GameClientState/MainState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/MainState.cpp @@ -28,9 +28,9 @@ struct MainState::MyData EventButtonCollection button; }; -void OnButtonInteract_Create( Oyster::Event::ButtonEvent& e ); -void OnButtonInteract_Join( Oyster::Event::ButtonEvent& e ); -void OnButtonInteract_Quit( Oyster::Event::ButtonEvent& e ); +void OnButtonInteract_Create( Oyster::Event::ButtonEvent& e ); +void OnButtonInteract_Join( Oyster::Event::ButtonEvent& e ); +void OnButtonInteract_Quit( Oyster::Event::ButtonEvent& e ); MainState::MainState(void) {} @@ -50,15 +50,15 @@ bool MainState::Init( NetworkClient* nwClient ) this->privData->background = Graphics::API::CreateTexture( L"grass_md.png" ); // create buttons - ButtonRectangle *button; + ButtonRectangle *button; - button = new ButtonRectangle( L"earth_md.png", OnButtonInteract_Create, this, 0.5f, 0.2f, 0.3f, 0.1f, true ); + button = new ButtonRectangle( L"earth_md.png", L"Create", Float3(1.0f), OnButtonInteract_Create, this, Float3(0.5f, 0.2f, 0.5f), Float2(0.3f, 0.1f), ResizeAspectRatio_Width ); this->privData->button.AddButton( button ); - button = new ButtonRectangle( L"skysphere_md.png", OnButtonInteract_Join, this, 0.5f, 0.4f, 0.3f, 0.1f, true ); + button = new ButtonRectangle( L"skysphere_md.png", L"Join", Float3(1.0f), OnButtonInteract_Join, this, Float3(0.5f, 0.4f, 0.5f), Float2(0.3f, 0.1f), ResizeAspectRatio_Width ); this->privData->button.AddButton( button ); - button = new ButtonRectangle( L"plane_texture_md.png", OnButtonInteract_Quit, this, 0.5f, 0.8f, 0.3f, 0.1f, true ); + button = new ButtonRectangle( L"plane_texture_md.png", L"Quit", Float3(1.0f), OnButtonInteract_Quit, this, Float3(0.5f, 0.8f, 0.5f), Float2(0.3f, 0.1f), ResizeAspectRatio_Width ); this->privData->button.AddButton( button ); // bind button collection to the singleton eventhandler @@ -87,7 +87,10 @@ bool MainState::Render() Graphics::API::StartGuiRender(); Graphics::API::RenderGuiElement( this->privData->background, Float2(0.5f), Float2(1.0f) ); - this->privData->button.Render(); + this->privData->button.RenderTexture(); + + Graphics::API::StartTextRender(); + this->privData->button.RenderText(); Graphics::API::EndFrame(); return true; @@ -111,7 +114,7 @@ void MainState::ChangeState( ClientState next ) this->privData->nextState = next; } -void OnButtonInteract_Create( Oyster::Event::ButtonEvent& e ) +void OnButtonInteract_Create( Oyster::Event::ButtonEvent& e ) { switch( e.state ) { @@ -122,7 +125,7 @@ void OnButtonInteract_Create( Oyster::Event::ButtonEvent& e ) } } -void OnButtonInteract_Join( Oyster::Event::ButtonEvent& e ) +void OnButtonInteract_Join( Oyster::Event::ButtonEvent& e ) { switch( e.state ) { @@ -133,7 +136,7 @@ void OnButtonInteract_Join( Oyster::Event::ButtonEvent& e ) } } -void OnButtonInteract_Quit( Oyster::Event::ButtonEvent& e ) +void OnButtonInteract_Quit( Oyster::Event::ButtonEvent& e ) { switch( e.state ) {