using now nicer font selection which also allows specification of color and size

This commit is contained in:
2010-11-01 22:33:14 +01:00
parent f84184aae1
commit bc53a7fd75
3 changed files with 118 additions and 24 deletions
+6 -5
View File
@@ -40,7 +40,7 @@ int View::OnInit (int argc, char* argv[]) {
mOverlayManager.Register (mConsoleOverlay, GameStateMainMenu);
*/
LoadFont("AldotheApache.ttf", 20);
LoadFont("AldotheApache.ttf size=20 color=#000000");
// This is a simple star field that makes the game so spacy
int i;
@@ -411,7 +411,7 @@ void View::DrawUiMainMenu() {
void View::DrawUiGameRunning() {
// We choose a different font and also draw it aligned to the right as this
// looks nicer with the points
SelectFont ("AldotheApache.ttf");
SelectFont ("AldotheApache.ttf size=20 color=#ffffff");
SetFontJustification (Engine::FontJustificationRight);
std::ostringstream out_stream;
@@ -530,9 +530,9 @@ void View::DrawUiHighscore() {
// the name)
if (GetModel()->mNewestHighscoreEntryIndex < GetModel()->mHighscoreList.size()
&& GetModel()->mNewestHighscoreEntryIndex == i) {
SetFontColor (224./255., 200/255., 0.);
SelectFont("console.ttf color=#e8d500");
Engine::DrawGLString ( x, y, out_stream.str().c_str());
SetFontColor (1., 1., 1.);
SelectFont("console.ttf color=#ffffff");
} else {
Engine::DrawGLString ( x, y, out_stream.str().c_str());
}
@@ -554,7 +554,8 @@ void View::DrawUiEnterPlayername() {
// Enter your name
std::string player_name = GetModel()->GetPlayerName();
SelectFont("console.ttf");
Engine::GUI::Label (1, "Enter your name: ", screen_right * 0.5 - 100, 250);
if (Engine::GUI::LineEdit (2, screen_right * 0.5 + 20, 238, player_name, 16)) {