From 67b62dde3dfd4fddba82940894f5b3416eee4c06 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 30 Sep 2015 19:46:44 -0400 Subject: more fonts, entity name displays --- src/ui.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/ui.cpp') diff --git a/src/ui.cpp b/src/ui.cpp index c14b4ff..de875b9 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -78,7 +78,25 @@ namespace ui { h=ftf->glyph->bitmap.rows; glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,ftex); - if(c=='-')y+=fontSize/3; + switch(c){ + case '^': + case '*': + case '`': + case '\'': + case '\"': + case '-':y+=fontSize/3;break; + case '~': + case '<': + case '>': + case '+': + case '=':y+=fontSize/5;break; + case 'g': + case 'q': + case 'y': + case 'p': + case 'j':y-=fontSize/4;break; + default:break; + } glBegin(GL_QUADS); glColor3ub(255,255,255); glTexCoord2f(0,1);glVertex2f(x,y); @@ -97,7 +115,7 @@ namespace ui { float xo=x,yo=y; do{ if(s[i]=='\n'){ - yo-=fontSize*1.15; + yo-=fontSize*1.05; xo=x; }else if(s[i]==' '){ xo+=fontSize/2; @@ -125,6 +143,7 @@ namespace ui { if(dialogBoxExists){ glColor3ub(0,0,0); glRectf(player->loc.x-SCREEN_WIDTH/2,SCREEN_HEIGHT,player->loc.x+SCREEN_WIDTH/2,SCREEN_HEIGHT-SCREEN_HEIGHT/4); + setFontSize(16); putString(player->loc.x-SCREEN_WIDTH/2,SCREEN_HEIGHT-fontSize,dialogBoxText); } } -- cgit v1.2.3