diff --git a/asteroids/View.cc b/asteroids/View.cc index 046ff90..3f08ea2 100644 --- a/asteroids/View.cc +++ b/asteroids/View.cc @@ -851,25 +851,48 @@ void View::DrawHighscoreEntry (float x, float y, float entry_width, const std::s } void View::DrawUiHighscore() { - DrawPageTitle ("Highscores"); + // DrawPageTitle but centered: + SelectFont("console.ttf size=46 color=#808080"); + + float width, height; + DrawGLStringMeasure("Highscores", &width, &height); + + float xpos = (screen_right - width) * 0.5; + float ypos = 180; + Engine::GUI::Label (4, "Highscores", xpos - 2, ypos + 2); + + SelectFont("console.ttf size=46 color=#ffffff"); + Engine::GUI::Label (4, "Highscores", xpos, ypos); if (GetModel()->GetHighscoreIsOnline()) { - SelectFont("console.ttf size=23 color=#006600"); + SelectFont("console.ttf size=23 color=#887500"); std::string title= "-online-"; float width, height; DrawGLStringMeasure(title.c_str(), &width, &height); - float xpos = (screen_right - width) * 0.5 - 40; + float xpos = (screen_right - width) * 0.5; float ypos = 130; - Engine::GUI::Label (4, title.c_str(), xpos - 2, ypos + 2); + Engine::GUI::Label (4, title.c_str(), xpos - 1, ypos + 1); - SelectFont("console.ttf size=23 color=#00cf00"); + SelectFont("console.ttf size=23 color=#e8d500"); + Engine::GUI::Label (4, title.c_str(), xpos, ypos); + } else { + SelectFont("console.ttf size=23 color=#808080"); + std::string title= "-offline-"; + float width, height; + DrawGLStringMeasure(title.c_str(), &width, &height); + + float xpos = (screen_right - width) * 0.5; + float ypos = 130; + Engine::GUI::Label (4, title.c_str(), xpos - 1, ypos + 1); + + SelectFont("console.ttf size=23 color=#ffffff"); Engine::GUI::Label (4, title.c_str(), xpos, ypos); } SelectFont ("console.ttf size=23"); unsigned int entry_length = 32; - float char_width, height; + float char_width; DrawGLStringMeasure ("M", &char_width, &height); height = fabsf(height); float entry_width = fabsf(char_width * entry_length);